Skip to content

Commit eab50ff

Browse files
kukulichondrejmirtes
authored andcommitted
Check CS in compiler tests
1 parent ee2499e commit eab50ff

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

compiler/tests/Filesystem/SymfonyFilesystemTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,47 @@
33
namespace PHPStan\Compiler\Filesystem;
44

55
use PHPUnit\Framework\TestCase;
6+
use Symfony\Component\Filesystem\Filesystem;
7+
use function unlink;
68

79
final class SymfonyFilesystemTest extends TestCase
810
{
911

1012
public function testExists(): void
1113
{
12-
$inner = $this->createMock(\Symfony\Component\Filesystem\Filesystem::class);
14+
$inner = $this->createMock(Filesystem::class);
1315
$inner->expects(self::once())->method('exists')->with('foo')->willReturn(true);
1416

1517
self::assertTrue((new SymfonyFilesystem($inner))->exists('foo'));
1618
}
1719

1820
public function testRemove(): void
1921
{
20-
$inner = $this->createMock(\Symfony\Component\Filesystem\Filesystem::class);
22+
$inner = $this->createMock(Filesystem::class);
2123
$inner->expects(self::once())->method('remove')->with('foo')->willReturn(true);
2224

2325
(new SymfonyFilesystem($inner))->remove('foo');
2426
}
2527

2628
public function testMkdir(): void
2729
{
28-
$inner = $this->createMock(\Symfony\Component\Filesystem\Filesystem::class);
30+
$inner = $this->createMock(Filesystem::class);
2931
$inner->expects(self::once())->method('mkdir')->with('foo')->willReturn(true);
3032

3133
(new SymfonyFilesystem($inner))->mkdir('foo');
3234
}
3335

3436
public function testRead(): void
3537
{
36-
$inner = $this->createMock(\Symfony\Component\Filesystem\Filesystem::class);
38+
$inner = $this->createMock(Filesystem::class);
3739

3840
$content = (new SymfonyFilesystem($inner))->read(__DIR__ . '/data/composer.json');
3941
self::assertSame("{}\n", $content);
4042
}
4143

4244
public function testWrite(): void
4345
{
44-
$inner = $this->createMock(\Symfony\Component\Filesystem\Filesystem::class);
46+
$inner = $this->createMock(Filesystem::class);
4547

4648
@unlink(__DIR__ . '/data/test.json');
4749
(new SymfonyFilesystem($inner))->write(__DIR__ . '/data/test.json', "{}\n");

phpcs.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
<arg name="encoding" value="utf-8"/>
77
<arg name="tab-width" value="4"/>
88
<arg name="cache" value="tmp/cache/phpcs"/>
9-
<arg name="ignore" value="tests/*/data,tests/*/traits,tests/notAutoloaded,tests/*/cache,src/Reflection/SignatureMap/functionMap.php,tests/e2e/magic-setter,tests/e2e/anon-class"/>
9+
<arg name="ignore" value="compiler/tests/*/data,tests/*/data,tests/*/traits,tests/notAutoloaded,tests/*/cache,src/Reflection/SignatureMap/functionMap.php,tests/e2e/magic-setter,tests/e2e/anon-class"/>
1010
<arg value="sp"/>
1111
<file>src</file>
1212
<file>tests</file>
1313
<file>compiler/src</file>
14+
<file>compiler/tests</file>
1415

1516
<rule ref="build-cs/vendor/consistence-community/coding-standard/Consistence/ruleset.xml">
1617
<exclude name="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.InvalidFormat"/>
@@ -71,7 +72,7 @@
7172
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
7273
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
7374
<properties>
74-
<property name="rootNamespaces" type="array" value="compiler/src =>PHPStan\Compiler,src=>PHPStan,tests/PHPStan=>PHPStan, tests/e2e => PHPStan\Tests"/>
75+
<property name="rootNamespaces" type="array" value="compiler/src =>PHPStan\Compiler,compiler/tests =>PHPStan\Compiler,src=>PHPStan,tests/PHPStan=>PHPStan, tests/e2e => PHPStan\Tests"/>
7576
</properties>
7677
</rule>
7778
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>

0 commit comments

Comments
 (0)