- Update syntax for data providers in the examples (see Class Notes)
Data Providers:
- The provider method needs to be declared
static
- Need to add a
use
statement when using PHP 8 attribute notation
use PHPUnit\Framework\Attributes\DataProvider;
- Dependency Injection
- See PSR-11: https://www.php-fig.org/psr/psr-11/
- Also Martin Fowler's website
The API simulation and data is located here:
/home/vagrant/Zend/api
- Correct paths in the last lab
- API simulator is located in
/home/vagrant/Zend/api
not under "/completed/api" - Also make sure
setup()
andteardown()
declare return typevoid
- API simulator is located in
- When using Prophecy you need to add the composer package as follows:
composer require phpspec/prophecy