Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail when files are found in _specs #232

Merged
merged 14 commits into from
Jul 1, 2018
File renamed without changes.
19 changes: 13 additions & 6 deletions tests/Scoper/PhpScoperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,22 @@ public function test_can_scope_valid_files(string $spec, string $contents, strin
);
}

/**
* This test is to ensure no file is left in _specs for the CI. It is fine otherwise for this test to fail locally
* when developing something.
*/
public function test_it_uses_the_right_specs_directory()
{
$files = (new Finder())->files()->in(self::SECONDARY_SPECS_PATH);

$this->assertCount(0, $files);
}

public function provideValidFiles()
{
if (file_exists(self::SECONDARY_SPECS_PATH)) {
$files = (new Finder())->files()->in(self::SECONDARY_SPECS_PATH);
$files = (new Finder())->files()->in(self::SECONDARY_SPECS_PATH);

if (0 === count($files)) {
$files = (new Finder())->files()->in(self::SPECS_PATH);
}
} else {
if (0 === count($files)) {
$files = (new Finder())->files()->in(self::SPECS_PATH);
}

Expand Down