jeudi 3 août 2017

PHPUnit Laravel - $suiteClassName is an object

I'm trying to test an application I'm making in Laravel 5.4 but when I type the phpunit command on the console I get this error:

PHP Warning: is_dir() expects parameter 1 to be a valid path, object given in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php on line 56

Warning: is_dir() expects parameter 1 to be a valid path, object given in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php on line 56 PHP Recoverable fatal error: Object of class PHPUnit\Framework\TestSuite could not be converted to string in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php on line 32

Recoverable fatal error: Object of class PHPUnit\Framework\TestSuite could not be converted to string in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php on line 32 ~/code/intranet $ phpunit PHP Warning: is_dir() expects parameter 1 to be a valid path, object given in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php on line 56

Warning: is_dir() expects parameter 1 to be a valid path, object given in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php on line 56 PHP Recoverable fatal error: Object of class PHPUnit\Framework\TestSuite could not be converted to string in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php on line 32

Recoverable fatal error: Object of class PHPUnit\Framework\TestSuite could not be converted to string in /Users/nico/.composer/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php on line 32 ~/code/intranet $

The parameter to which the error refers to and the $suiteClassName variable that somewhere in the code is transformed into an object instead of a string as supposed

public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '')
    {
        if (\is_dir($suiteClassName) &&
            !\is_file($suiteClassName . '.php') && empty($suiteClassFile)) {
            $facade = new File_Iterator_Facade;
            $files  = $facade->getFilesAsArray(
                $suiteClassName,
                $suffixes
            );

            $suite = new TestSuite($suiteClassName);
            $suite->addTestFiles($files);

            return $suite;
        }

Thank you in advance for the help

Aucun commentaire:

Enregistrer un commentaire