Skip to content

Commit bea8ae1

Browse files
authored
Merge pull request Codeception#6136 from Codeception/4.1-fix-data-provider-conditions
4.1 Use correct name of DataProviderTestSuite in conditions
2 parents 01932d7 + ff8af53 commit bea8ae1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Codeception/Command/DryRun.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function execute(InputInterface $input, OutputInterface $output)
8585
$this->dispatch($dispatcher, Events::SUITE_INIT, new SuiteEvent($suiteManager->getSuite(), null, $settings));
8686
$this->dispatch($dispatcher, Events::SUITE_BEFORE, new SuiteEvent($suiteManager->getSuite(), null, $settings));
8787
foreach ($tests as $test) {
88-
if ($test instanceof \PHPUnit\Framework\TestSuite\DataProvider) {
88+
if ($test instanceof \PHPUnit\Framework\DataProviderTestSuite) {
8989
foreach ($test as $t) {
9090
if ($t instanceof Test) {
9191
$this->dryRunTest($output, $dispatcher, $t);

src/Codeception/Lib/GroupManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function groupsForTest(\PHPUnit\Framework\Test $test)
149149
if ($test instanceof \PHPUnit\Framework\TestCase) {
150150
$groups = array_merge($groups, \PHPUnit\Util\Test::getGroups(get_class($test), $test->getName(false)));
151151
}
152-
if ($test instanceof \PHPUnit\Framework\TestSuite\DataProvider) {
152+
if ($test instanceof \PHPUnit\Framework\DataProviderTestSuite) {
153153
$firstTest = $test->testAt(0);
154154
if ($firstTest != false && $firstTest instanceof TestInterface) {
155155
$groups = array_merge($groups, $firstTest->getMetadata()->getGroups());
@@ -169,7 +169,7 @@ public function groupsForTest(\PHPUnit\Framework\Test $test)
169169
&& mb_strtolower($filename . ':' . $test->getMetadata()->getFeature()) === mb_strtolower($testPattern)) {
170170
$groups[] = $group;
171171
}
172-
if ($test instanceof \PHPUnit\Framework\TestSuite\DataProvider) {
172+
if ($test instanceof \PHPUnit\Framework\DataProviderTestSuite) {
173173
$firstTest = $test->testAt(0);
174174
if ($firstTest != false && $firstTest instanceof TestInterface) {
175175
if (strpos($filename . ':' . $firstTest->getName(false), $testPattern) === 0) {

src/Codeception/Subscriber/BeforeAfterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function beforeClass(SuiteEvent $e)
2222
{
2323
foreach ($e->getSuite()->tests() as $test) {
2424
/** @var $test \PHPUnit\Framework\Test * */
25-
if ($test instanceof \PHPUnit\Framework\TestSuite\DataProvider) {
25+
if ($test instanceof \PHPUnit\Framework\DataProviderTestSuite) {
2626
$potentialTestClass = strstr($test->getName(), '::', true);
2727
$this->hooks[$potentialTestClass] = \PHPUnit\Util\Test::getHookMethods($potentialTestClass);
2828
}

0 commit comments

Comments
 (0)