Ao instalar o PHPUnit obtive estes warnings. Vi no google que ocorrem devido a versão do PHP 7.4, mas no site do autor ele diz q há suporte para a versão. Observação: Estes erros ocorreram com meu código, então executei o do prof e o erro se repetiu.
Alguma luz?
C:\Alura_TDD_PHP_prof>vendor\bin\phpunit --version
PHPUnit 8.0.0 by Sebastian Bergmann and contributors.
C:\Alura_TDD_PHP_prof>phpunit test
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285
PHPUnit 3.7.21 by Sebastian Bergmann.
Class 'test' could not be found in 'test.php'.
C:\Alura_TDD_PHP_prof>phpunit tests
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285
PHP Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in C:\Alura_TDD_PHP_prof\tests\Service\AvaliadorTest.php:11
Stack trace:
#0 C:\xampp\php\pear\PHPUnit\Util\Fileloader.php(92): include_once()
#1 C:\xampp\php\pear\PHPUnit\Util\Fileloader.php(76): PHPUnit_Util_Fileloader::load('C:\\Alura_TDD_PH...')
#2 C:\xampp\php\pear\PHPUnit\Framework\TestSuite.php(355): PHPUnit_Util_Fileloader::checkAndLoad('C:\\Alura_TDD_PH...')
#3 C:\xampp\php\pear\PHPUnit\Framework\TestSuite.php(416): PHPUnit_Framework_TestSuite->addTestFile('C:\\Alura_TDD_PH...')
#4 C:\xampp\php\pear\PHPUnit\Runner\BaseTestRunner.php(96): PHPUnit_Framework_TestSuite->addTestFiles(Array)
#5 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(149): PHPUnit_Runner_BaseTestRunner->getTest('tests', '', Array)
#6 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#7 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#8 {main}
thrown in C:\Alura_TDD_PHP_prof\tests\Service\AvaliadorTest.php on line 11
Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in C:\Alura_TDD_PHP_prof\tests\Service\AvaliadorTest.php:11
Stack trace:
#0 C:\xampp\php\pear\PHPUnit\Util\Fileloader.php(92): include_once()
#1 C:\xampp\php\pear\PHPUnit\Util\Fileloader.php(76): PHPUnit_Util_Fileloader::load('C:\\Alura_TDD_PH...')
#2 C:\xampp\php\pear\PHPUnit\Framework\TestSuite.php(355): PHPUnit_Util_Fileloader::checkAndLoad('C:\\Alura_TDD_PH...')
#3 C:\xampp\php\pear\PHPUnit\Framework\TestSuite.php(416): PHPUnit_Framework_TestSuite->addTestFile('C:\\Alura_TDD_PH...')
#4 C:\xampp\php\pear\PHPUnit\Runner\BaseTestRunner.php(96): PHPUnit_Framework_TestSuite->addTestFiles(Array)
#5 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(149): PHPUnit_Runner_BaseTestRunner->getTest('tests', '', Array)
#6 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#7 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#8 {main}
thrown in C:\Alura_TDD_PHP_prof\tests\Service\AvaliadorTest.php on line 11
C:\Alura_TDD_PHP_prof>php --version
PHP 7.4.2 (cli) (built: Jan 21 2020 17:52:43) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies