TokenTest.php 758 B

12345678910111213141516171819202122232425262728293031
  1. <?php declare(strict_types = 1);
  2. namespace TheSeer\Tokenizer;
  3. use PHPUnit\Framework\TestCase;
  4. class TokenTest extends TestCase {
  5. /** @var Token */
  6. private $token;
  7. protected function setUp() {
  8. $this->token = new Token(1,'test-dummy', 'blank');
  9. }
  10. public function testTokenCanBeCreated() {
  11. $this->assertInstanceOf(Token::class, $this->token);
  12. }
  13. public function testTokenLineCanBeRetrieved() {
  14. $this->assertEquals(1, $this->token->getLine());
  15. }
  16. public function testTokenNameCanBeRetrieved() {
  17. $this->assertEquals('test-dummy', $this->token->getName());
  18. }
  19. public function testTokenValueCanBeRetrieved() {
  20. $this->assertEquals('blank', $this->token->getValue());
  21. }
  22. }