I study design patterns, read about the pattern strategy - I decided to fix it with practice, downloaded the repository https://github.com/sebastianbergmann/state.git installed the composer registered the composer require phpunit / php-token-stream there he downloaded some files in the vendor / phpunit
Let's start disassembling the pattern and the tests (demo) do not run - D: \ wamp \ www \ patterns \ state \ example \ tests \ ClosedDoorTest.php writes Fatal error: Class 'PHPUnit_Framework_TestCase' not found Found answers - https: // stackoverflow .com / questions / 6065730 / why-fatal-error-class-phpunit-framework-test-not-found-in tried not to help.
Please tell me how you need to connect it to find the tests?
thank.
|
1 answer
just so take and run the test can not be.
- You can create a file phpunit.xml, specify the tests to be run in it + specify bootstrap in the form "vendor / autoload.php". More on the official website
- run phpunit by specifying the bootstrap option
phpunit --bootstrap src/autoload.php tests/MoneyTest. Taken from here
Also, if you downloaded phpunit with composer, then phpunit will be in vendor / bin
|
require __DIR__ . '/vendor/autoload.php';- Bookin