Skip to content

Chain of responsibility example implementing discount calculator

Notifications You must be signed in to change notification settings

chuano/discount-chain-of-responsibiliy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chain of resposibility discount calculator

Academic purpouse discount calculator using the chain of responsibility pattern.

Spanish post in Patrón cadena de responsabilidad en PHP

Implemented tests for these cases:

  • Return 15% of discount given more than 300€ amount and more than 50 units.
  • Return 12% of discount given less or equal than 300€ amount and more than 50 units.
  • Return 10% of discount given any amount, more than 30 units and less or equal 50 units.
  • Return 5% of discount given more than 100€ amount and less or equal 30 units.
  • Return 0% else.

Execute tests

./vendor/bin/phpunit tests

About

Chain of responsibility example implementing discount calculator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages