Skip to content

Commit

Permalink
UnusedUsesSniff - test for complex annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 9, 2016
1 parent 27e8bcc commit b9311f2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Sniffs/Namespaces/UnusedUsesSniffTest.php
Expand Up @@ -136,4 +136,12 @@ public function testMatchingCaseOfUseAndPhpFunction()
$this->assertNoSniffErrorInFile($report);
}

public function testAnnotations()
{
$report = $this->checkFile(__DIR__ . '/data/unusedUses-annotations.php', [
'searchAnnotations' => true,
]);
$this->assertNoSniffErrorInFile($report);
}

}
23 changes: 23 additions & 0 deletions tests/Sniffs/Namespaces/data/unusedUses-annotations.php
@@ -0,0 +1,23 @@
<?php

namespace Lavito\ApiBundle;

use Lavito\ApiBundle\EmailAddress\EmailAddress;
use Lavito\ApiBundle\String\LowercaseValidator\LowercaseConstraint as AssertLowercase;

use Symfony\Component\Validator\Constraints as Assert;

class PasswordLoginRequest
{

/**
* @JMS\Type("string")
* @Assert\NotBlank()
* @AssertLowercase()
* @Assert\Length(max=EmailAddress::EMAIL_ADDRESS_MAX_LENGTH)
* @Assert\Email()
* @var string
*/
public $email;

}

0 comments on commit b9311f2

Please sign in to comment.