Skip to content

Commit bfa7b24

Browse files
author
kaizen-ci
committed
[ECS] Add test for #3113 (#3146)
1 parent c449a9d commit bfa7b24

File tree

4 files changed

+71
-11
lines changed

4 files changed

+71
-11
lines changed

src/Exception/DependencyInjection/Extension/InvalidSniffPropertyException.php

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
testFunction([ 'a' => 'xyz', 'b' => 'pqr' ]);
4+
5+
testFunction([]);
6+
7+
testFunction([ 'a' => 'xyz', 'b' => 'pqr' ]);
8+
9+
?>
10+
-----
11+
<?php
12+
13+
testFunction([
14+
'a' => 'xyz',
15+
'b' => 'pqr',
16+
]);
17+
18+
testFunction([]);
19+
20+
testFunction([
21+
'a' => 'xyz',
22+
'b' => 'pqr',
23+
]);
24+
25+
?>

tests/Issues/Issue3113Test.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Symplify\EasyCodingStandard\Tests\Issues;
6+
7+
use Iterator;
8+
use Symplify\EasyCodingStandardTester\Testing\AbstractCheckerTestCase;
9+
use Symplify\SmartFileSystem\SmartFileInfo;
10+
11+
/**
12+
* @see https://github.com/symplify/symplify/issues/3113
13+
*/
14+
final class Issue3113Test extends AbstractCheckerTestCase
15+
{
16+
/**
17+
* @dataProvider provideData()
18+
*/
19+
public function test(SmartFileInfo $fileInfo): void
20+
{
21+
$this->doTestFileInfo($fileInfo);
22+
}
23+
24+
/**
25+
* @return Iterator<SmartFileInfo[]>
26+
*/
27+
public function provideData(): Iterator
28+
{
29+
yield [new SmartFileInfo(__DIR__ . '/Fixture/fixture3113.php.inc')];
30+
}
31+
32+
protected function provideConfig(): string
33+
{
34+
return __DIR__ . '/config/config3113.php';
35+
}
36+
}

tests/Issues/config/config3113.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
7+
8+
return static function (ContainerConfigurator $containerConfigurator): void {
9+
$containerConfigurator->import(SetList::ARRAY);
10+
};

0 commit comments

Comments
 (0)