kenjis/ci-phpunit-test

Argument 1 passed to PHPUnit\Runner\TestSuiteSorter::reorderTestsInSuite() must implement interface PHPUnit\Framework\Test, instance of PHPUnit\Framework\TestSuite given

ParthasarathySWD opened this issue · 3 comments

Argument 1 passed to PHPUnit\Runner\TestSuiteSorter::reorderTestsInSuite() must implement interface PHPUnit\Framework\Test, instance of PHPUnit\Framework\TestSuite given, called in /var/www/html/D2TAssignment/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 209

Whenever I run vendor/bin/phpunit -c application/tests/ getting below error

Argument 1 passed to PHPUnit\Runner\TestSuiteSorter::reorderTestsInSuite() must implement interface PHPUnit\Framework\Test, instance of PHPUnit\Framework\TestSuite given, called in /var/www/html/D2TAssignment/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 209

Composer.json

{
	"description": "The CodeIgniter framework with HMVC Library",
	"name": "alzen8work/ci_hmvc",
	"type": "project",
	"homepage": "https://github.com/alzen8work/ci_hmvc",
	"license": "MIT",
	"require": {
		"php": ">=7.3",
		"mpdf/mpdf": "^8.0",
		"mikehaertl/php-pdftk": "^0.11.0",
		"phpunit/phpunit": "^9.5"
	},
	"suggest": {
		"paragonie/random_compat": "Provides better randomness in PHP 5.x"
	},
	"require-dev": {
		"mikey179/vfsstream": "1.1.*",
		"phpoffice/phpword": "^0.17.0"
	}
}

Worked fine yesterday, suddenly nothing working after doing composer update

Cannot reproduce.

$ vendor/bin/phpunit -c application/tests

PHPUnit 9.5.24 #StandWithUkraine

...................................................SS..........  63 / 248 ( 25%)
.....SSSSSS..........SSSSSS.................................... 126 / 248 ( 50%)
............................................................... 189 / 248 ( 76%)
...........................................................     248 / 248 (100%)

Time: 00:09.452, Memory: 50.50 MB

OK, but incomplete, skipped, or risky tests!
Tests: 248, Assertions: 356, Skipped: 14.

Generating code coverage report in Clover XML format ... done [00:00.058]

Generating code coverage report in HTML format ... done [00:01.074]

Thanks @kenjis

This resolves my problem #376

Problem is I have two vendor directory one in root and another inside application. Updating same phpunit version in both vendor folders solved the issue.