Skip to content

Commit 6076e21

Browse files
committed
More tests for UnusedUsesSniff
1 parent 5b806df commit 6076e21

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/Sniffs/Namespaces/UnusedUsesSniffTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public function testUnusedUse(): void
3232
);
3333
}
3434

35+
public function testUnusedUseNoNamespaceNoErrors(): void
36+
{
37+
$report = $this->checkFile(__DIR__ . '/data/unusedUsesNoNamespaceNoErrors.php');
38+
$this->assertNoSniffErrorInFile($report);
39+
}
40+
3541
public function testUnusedUseWithAsPart(): void
3642
{
3743
$this->assertSniffError(
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
use function GuzzleHttp\json_decode;
4+
5+
class Boo
6+
{
7+
8+
public function foo(string $jsonInput)
9+
{
10+
return json_decode($jsonInput);
11+
}
12+
13+
}

0 commit comments

Comments
 (0)