Skip to content

Commit 4c90917

Browse files
authored
Merge pull request #128 from iMattPro/fix-composer
Ignore ext tests folders when looking for composer.json
2 parents c0dedc6 + db30d9c commit 4c90917

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Tests/TestRunner.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,14 @@ private function setBasedir()
140140
$iterator = $finder
141141
->files()
142142
->name('composer.json')
143-
->exclude('vendor')
143+
->exclude(['vendor', 'tests'])
144144
->in($this->directory);
145145

146-
if (count($iterator) != 1)
146+
$iteratorCount = count($iterator);
147+
148+
if ($iteratorCount !== 1)
147149
{
148-
throw new TestException("Can't find the required composer.json file.");
150+
throw new TestException($iteratorCount === 0 ? 'Could not find the required composer.json file.' : 'Found multiple composer.json files.');
149151
}
150152

151153
$composer = '';

0 commit comments

Comments
 (0)