/** @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); }
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]); }
/** * @return array|\Notoj\Annotation\Annotations */ public function getAnnotations() { return $this->reflectionClass->getAnnotations(); }