Exemplo n.º 1
0
 public function testScannerReturnsClassNames()
 {
     $tokenScanner = new TokenArrayScanner(token_get_all(file_get_contents(__DIR__ . '/../TestAsset/FooClass.php')));
     $classes = $tokenScanner->getClassNames();
     $this->assertInternalType('array', $classes);
     $this->assertContains('ZendTest\\Code\\TestAsset\\FooClass', $classes);
 }
Exemplo n.º 2
0
 /**
  * @group gh-4989
  */
 public function testScannerReturnsClassNamesForTraits()
 {
     if (version_compare(PHP_VERSION, '5.4', 'lt')) {
         $this->markTestSkipped('Skipping; PHP 5.4 or greater is needed');
     }
     $tokenScanner = new TokenArrayScanner(token_get_all(file_get_contents(__DIR__ . '/../TestAsset/FooTrait.php')));
     $classes = $tokenScanner->getClassNames();
     $this->assertInternalType('array', $classes);
     $this->assertContains('ZendTest\\Code\\TestAsset\\FooTrait', $classes);
 }