Skip to content

Commit 3187892

Browse files
authored
Merge pull request Codeception#6138 from Codeception/4.1-remove-DataProviderTestSuite-conditions
4.1 Remove dead DataProviderTestSuite code
2 parents bea8ae1 + bc5ffac commit 3187892

File tree

4 files changed

+2
-27
lines changed

4 files changed

+2
-27
lines changed

src/Codeception/Command/DryRun.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ 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\DataProviderTestSuite) {
89-
foreach ($test as $t) {
90-
if ($t instanceof Test) {
91-
$this->dryRunTest($output, $dispatcher, $t);
92-
}
93-
}
94-
}
9588
if ($test instanceof Test and $test instanceof ScenarioDriven) {
9689
$this->dryRunTest($output, $dispatcher, $test);
9790
}

src/Codeception/Lib/GroupManager.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,6 @@ 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\DataProviderTestSuite) {
153-
$firstTest = $test->testAt(0);
154-
if ($firstTest != false && $firstTest instanceof TestInterface) {
155-
$groups = array_merge($groups, $firstTest->getMetadata()->getGroups());
156-
$filename = Descriptor::getTestFileName($firstTest);
157-
}
158-
}
159152

160153
foreach ($this->testsInGroups as $group => $tests) {
161154
foreach ($tests as $testPattern) {
@@ -169,14 +162,6 @@ public function groupsForTest(\PHPUnit\Framework\Test $test)
169162
&& mb_strtolower($filename . ':' . $test->getMetadata()->getFeature()) === mb_strtolower($testPattern)) {
170163
$groups[] = $group;
171164
}
172-
if ($test instanceof \PHPUnit\Framework\DataProviderTestSuite) {
173-
$firstTest = $test->testAt(0);
174-
if ($firstTest != false && $firstTest instanceof TestInterface) {
175-
if (strpos($filename . ':' . $firstTest->getName(false), $testPattern) === 0) {
176-
$groups[] = $group;
177-
}
178-
}
179-
}
180165
}
181166
}
182167
return array_unique($groups);

src/Codeception/Subscriber/BeforeAfterTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ 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\DataProviderTestSuite) {
26-
$potentialTestClass = strstr($test->getName(), '::', true);
27-
$this->hooks[$potentialTestClass] = \PHPUnit\Util\Test::getHookMethods($potentialTestClass);
28-
}
29-
3025
$testClass = get_class($test);
3126
$this->hooks[$testClass] = \PHPUnit\Util\Test::getHookMethods($testClass);
3227
}

tests/cli/DryRunCest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public function runCestWithExamples(CliGuy $I)
1010
{
1111
$I->executeCommand('dry-run scenario ExamplesCest --no-ansi');
1212
$I->seeInShellOutput('ExamplesCest: Files exists annotation');
13+
$I->seeInShellOutput('I see file found "scenario.suite.yml"');
14+
$I->seeInShellOutput('I see file found "dummy.suite.yml"');
1315
}
1416

1517
public function runFeature(CliGuy $I)

0 commit comments

Comments
 (0)