Пример #1
0
 public function testNotojFileNamespaces()
 {
     $foo = new \Notoj\File(__DIR__ . "/fixtures/namespace.php");
     foreach ($foo as $id => $annotation) {
         if ($id < 2) {
             $expected = explode("\\", $annotation->getObjectName());
             $expected = array_pop($expected);
         } else {
             $expected = $annotation->getObjectName();
         }
         if ($annotation->getObject() instanceof \Notoj\Object\zProperty) {
             $expected = substr($expected, 1);
         }
         $this->assertEquals($annotation->getName(), $expected);
     }
     $this->assertEquals($foo->get('fooobar'), array());
     $this->assertTrue($foo->has('foobar'));
 }
Пример #2
0
    public function testMultilineQuotes()
    {
        $foo = new \Notoj\File(__DIR__ . "/fixtures/extended.php");
        $this->assertEquals('this is foo', $foo->getOne('inline')->getArg(0));
        foreach ($foo->get('long') as $annotation) {
            $this->assertEquals('this is a very long long long text and perhaps we are talking
It supports multiple paragraphs as well.
More and more texts', $annotation->getArg(0));
        }
        $this->assertTrue($foo->has('short'));
        foreach ($foo->get('short') as $annotation) {
            $this->assertEquals('hi there!', $annotation->getArg(0));
        }
    }