コード例 #1
0
ファイル: CacheTest.php プロジェクト: agpmedia/notoj
 /** @depends testCacheInit */
 function testCacheContent()
 {
     $obj = new ReflectionClass(__CLASS__);
     $arr = $obj->getAnnotations();
     $this->assertEquals(1, \Notoj\Cache::save());
     $this->assertEquals(0, \Notoj\Cache::save());
     $content = file_get_contents(CACHE);
     $this->assertTrue(strpos($content, sha1($obj->getDocComment())) !== FALSE);
 }
コード例 #2
0
ファイル: SimpleTest.php プロジェクト: agpmedia/notoj
 public function testNestedAnnatations()
 {
     require __DIR__ . '/fixtures/extended.php';
     $class = new ReflectionClass("Extended");
     $annotations = $class->GetAnnotations();
     $this->AssertEquals($annotations[0]->getName(), 'foobar');
     $args = $annotations[0]->GetArgs();
     $this->assertTrue($args[0] instanceof \Notoj\Annotation\Annotation);
     $this->AssertEquals('foobar', $args[0]->getName());
     $this->AssertEquals(array('foobar'), $args[0]->getArgs());
     $this->AssertEquals('foobar', $args[1]);
 }
コード例 #3
0
 /**
  * @return array|\Notoj\Annotation\Annotations
  */
 public function getAnnotations()
 {
     return $this->reflectionClass->getAnnotations();
 }