- Install Docker
- Clone this project:
git clone https://github.com/marydn/basket.git
- Move to the project folder:
cd basket
- Install PHP dependencies and bring up the project Docker containers with Docker Compose:
make build
- Check everything's up using:
$ docker-composer ps
. It should showphp
service up. - Execute tests:
make test
Note: If you want to bring down Docker service use:
make destroy
- Install Composer
- Check PHP version. Should be 7.4 at least
- Clone this project:
git clone https://github.com/marydn/basket.git
- Move to the project folder:
cd basket
- Install dependencies:
composer install
- Execute tests:
make run-tests
$ tree -L 4 src
src
├── Basket.php # Collection that holds products to check
├── Exception
│ └── ProductNotFount.php
├── Inventory.php # Collection that holds products available at the store
├── Pricing.php # Sets a price by unit or volume
├── Product.php # Represents a Product
├── ProductPrices.php # Collection of prices per Product
├── Shared
│ └── Collection.php # Holds collections of objects
├── Terminal.php # Main objet to interact with basket, inventory and get Total
└── ValueObject
└── ProductCode.php