Skip to content

Commit

Permalink
UnusedUsesSniff: More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed May 13, 2021
1 parent 4a8efc9 commit 29bbdc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/Sniffs/Namespaces/UnusedUsesSniffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ public function testUnusedUse(): void
// Used constant as named parameter
self::assertNoSniffError($report, 26);

// Used class::cosntant as named parameter
// Used class::constant as named parameter
self::assertNoSniffError($report, 27);
self::assertNoSniffError($report, 28);

// Used class with static variable
self::assertNoSniffError($report, 29);
}

public function testUnusedUseWithMultipleNamespaces(): void
Expand Down
4 changes: 4 additions & 0 deletions tests/Sniffs/Namespaces/data/unusedUses.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
use UnionType2;
use const STR_PAD_RIGHT;
use EnumClass;
use ReferenceClass;
use ClassWithStaticVariable;

class TestClass implements FirstInterface, SecondInterface
{
Expand All @@ -49,7 +51,9 @@ public function test(S $s): Rasmus
echo str_pad('123', 1, pad_type: STR_PAD_RIGHT);

new Foo(
ClassWithStaticVariable::$variable,
enum_type: EnumClass::VALUE(),
reference_type: ReferenceClass::SOME_CONSTANT
);

return new NewObject();
Expand Down

0 comments on commit 29bbdc9

Please sign in to comment.