Skip to content

Commit

Permalink
Failure test for error "Case of reference name join and use statement…
Browse files Browse the repository at this point in the history
… Join do not match (SlevomatCodingStandard.Namespaces.UnusedUses.MismatchingCaseSensitivity)"
  • Loading branch information
jirastom authored and ondrejmirtes committed Aug 8, 2016
1 parent ef4c333 commit 232ef22
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Sniffs/Namespaces/UnusedUsesSniffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,10 @@ public function testMatchingCaseOfUseAndClassConstant()
$this->assertNoSniffErrorInFile($report);
}

public function testMatchingCaseOfUseAndPhpFunction()
{
$report = $this->checkFile(__DIR__ . '/data/matchingCaseOfUseAndPhpFunction.php');
$this->assertNoSniffErrorInFile($report);
}

}
13 changes: 13 additions & 0 deletions tests/Sniffs/Namespaces/data/join.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php declare(strict_types = 1);

namespace Doctrine\ORM\Query\Expr;

class Join
{

public static function foo()
{

}

}
18 changes: 18 additions & 0 deletions tests/Sniffs/Namespaces/data/matchingCaseOfUseAndPhpFunction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php declare(strict_types = 1);

use Doctrine\ORM\Query\Expr\Join;

class TestJoin
{

public function testJoin()
{
$arr[0] = '1';
$arr[2] = '2';
$arr[3] = '3';

join('item', $arr);
Join::foo();
}

}

0 comments on commit 232ef22

Please sign in to comment.