Skip to content

Commit

Permalink
enforce test class name exists in filename
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Sep 7, 2019
1 parent 26301f0 commit 09ae16c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Runner/StandardTestSuiteLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ public function load(string $suiteClassName, string $suiteClassFile = ''): Refle
}
}

if (!\class_exists($suiteClassName, false)) {
throw new Exception(
\sprintf(
"Class '%s' could not be found in '%s'.",
$suiteClassName,
$suiteClassFile
)
);
}

return $class;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/regression/GitHub/2830.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GH-2830: @runClassInSeparateProcess fails for tests with a @dataProvider
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'Issue2830';
$_SERVER['argv'][2] = 'Issue2830Test';
$_SERVER['argv'][3] = __DIR__ . '/2830/Issue2830Test.php';

require __DIR__ . '/../../../bootstrap.php';
Expand Down

0 comments on commit 09ae16c

Please sign in to comment.