DocLexerTest.php 736B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Doctrine\Tests\Common\Annotations;
  3. use Doctrine\Common\Annotations\DocLexer;
  4. class DocLexerTest extends \PHPUnit_Framework_TestCase
  5. {
  6. public function testMarkerAnnotation()
  7. {
  8. $lexer = new DocLexer;
  9. $lexer->setInput("@Name");
  10. $this->assertNull($lexer->token);
  11. $this->assertNull($lexer->lookahead);
  12. $this->assertTrue($lexer->moveNext());
  13. $this->assertNull($lexer->token);
  14. $this->assertEquals('@', $lexer->lookahead['value']);
  15. $this->assertTrue($lexer->moveNext());
  16. $this->assertEquals('@', $lexer->token['value']);
  17. $this->assertEquals('Name', $lexer->lookahead['value']);
  18. $this->assertFalse($lexer->moveNext());
  19. }
  20. }