Fatal error: Uncaught PHPUnit\Runner\Exception: Class 'Browser' could not be found in 'C:\Users\rburton\code\MyAgsourceAPI\test\e2e\HomePage.php'. in C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\Runner\StandardTestSuiteLoader.php on line 101
PHPUnit\Runner\Exception: Class 'Browser' could not be found in 'C:\Users\rburton\code\MyAgsourceAPI\test\e2e\HomePage.php'. in C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\Runner\StandardTestSuiteLoader.php on line 101
The thing that puzzles me is that the error indicates that the 'StandardTestSuiteLoader' could not find the Browser class rather than in the test class where the class is instantiated. Does anyone have some ideas why the auxillary class cannot be found?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a test folder structure like:
I run a test like:
vendor\bin\phpunit --bootstrap vendor/autoload.php test\e2e\HomePage.php
But I get an error:
Fatal error: Uncaught PHPUnit\Runner\Exception: Class 'Browser' could not be found in 'C:\Users\rburton\code\MyAgsourceAPI\test\e2e\HomePage.php'. in C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\Runner\StandardTestSuiteLoader.php on line 101
PHPUnit\Runner\Exception: Class 'Browser' could not be found in 'C:\Users\rburton\code\MyAgsourceAPI\test\e2e\HomePage.php'. in C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\Runner\StandardTestSuiteLoader.php on line 101
Call Stack:
0.1973 357496 1. {main}() C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\phpunit:0
0.2024 746904 2. PHPUnit\TextUI\Command::main(???) C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\phpunit:53
0.2024 750064 3. PHPUnit\TextUI\Command->run(array(4), true) C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\TextUI\Command.php:141
0.2077 1007320 4. PHPUnit\TextUI\TestRunner->getTest(string(17), string(57), array(2)) C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\TextUI\Command.php:162
0.2078 1007320 5. PHPUnit\TextUI\TestRunner->loadSuiteClass(string(17), string(57)) C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:73
0.2084 1026680 6. PHPUnit\Runner\StandardTestSuiteLoader->load(string(7), string(57)) C:\Users\rburton\code\MyAgsourceAPI\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:130
The only place that I am instantiating the 'Browser' class is in the setup for the HomePage test class like:
public function setUp()
{
$this->browserDriver = new Browser();
}
The thing that puzzles me is that the error indicates that the 'StandardTestSuiteLoader' could not find the Browser class rather than in the test class where the class is instantiated. Does anyone have some ideas why the auxillary class cannot be found?