You are here

public function PHP_Token_ClassTest::testAnonymousClassesAreHandledCorrectly in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/php-token-stream/tests/Token/ClassTest.php \PHP_Token_ClassTest::testAnonymousClassesAreHandledCorrectly()

@requires PHP 7

File

vendor/phpunit/php-token-stream/tests/Token/ClassTest.php, line 88

Class

PHP_Token_ClassTest
Tests for the PHP_Token_CLASS class.

Code

public function testAnonymousClassesAreHandledCorrectly() {
  $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'class_with_method_that_declares_anonymous_class.php');
  $classes = $ts
    ->getClasses();
  $this
    ->assertEquals(array(
    'class_with_method_that_declares_anonymous_class',
  ), array_keys($classes));
}