-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDuplicatedScenarioNamesAnalyzerTest.php
More file actions
36 lines (25 loc) · 1.2 KB
/
DuplicatedScenarioNamesAnalyzerTest.php
File metadata and controls
36 lines (25 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace Rector\Behastan\Tests\Analyzer\DuplicatedScenarioNamesAnalyzer;
use Rector\Behastan\Analyzer\DuplicatedScenarioNamesAnalyzer;
use Rector\Behastan\Finder\BehatMetafilesFinder;
use Rector\Behastan\Tests\AbstractTestCase;
final class DuplicatedScenarioNamesAnalyzerTest extends AbstractTestCase
{
private DuplicatedScenarioNamesAnalyzer $duplicatedScenarioNamesAnalyzer;
protected function setUp(): void
{
parent::setUp();
$this->duplicatedScenarioNamesAnalyzer = $this->make(DuplicatedScenarioNamesAnalyzer::class);
}
public function test(): void
{
$featureFiles = BehatMetafilesFinder::findFeatureFiles([__DIR__ . '/Fixture']);
$this->assertCount(2, $featureFiles);
$duplicatedScenarioNamesToFiles = $this->duplicatedScenarioNamesAnalyzer->analyze($featureFiles);
$this->assertCount(1, $duplicatedScenarioNamesToFiles);
$this->assertArrayHasKey('Same scenario name', $duplicatedScenarioNamesToFiles);
$givenFiles = $duplicatedScenarioNamesToFiles['Same scenario name'];
$this->assertSame([__DIR__ . '/Fixture/some.feature', __DIR__ . '/Fixture/another.feature'], $givenFiles);
}
}