From ffedce6e1467c39ae6eb8197586f533257b63a8a Mon Sep 17 00:00:00 2001 From: butschster Date: Wed, 8 Sep 2021 22:24:43 +0300 Subject: [PATCH] Added test for ignored files --- tests/CodeStyle/CodeStyleCheckTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/CodeStyle/CodeStyleCheckTest.php b/tests/CodeStyle/CodeStyleCheckTest.php index 2774c32..c0cd637 100644 --- a/tests/CodeStyle/CodeStyleCheckTest.php +++ b/tests/CodeStyle/CodeStyleCheckTest.php @@ -27,7 +27,6 @@ public function testWrongFormattedClass(): void public function testWellFormattedClass(): void { - $out = $this->execCommand([ 'bin/spiral-cs', 'check', @@ -37,4 +36,17 @@ public function testWellFormattedClass(): void $this->assertArrayHasKey(0, $out); $this->assertEquals($out[0], 'No codestyle issues'); } + + public function testIgnoredFilesShouldBeSkipped() + { + $out = $this->execCommand([ + 'bin/spiral-cs', + 'check', + '--ignore=NotFormattedClass.php', + 'tests/fixtures/temp/' + ]); + + $this->assertArrayHasKey(0, $out); + $this->assertEquals($out[0], 'No codestyle issues'); + } }