Ejemplo n.º 1
0
 public function testNotojDir()
 {
     $foo = new \Notoj\Dir(__DIR__ . '/fixtures');
     $this->AssertTrue($foo->has('foobar'));
     $this->AssertFalse($foo->has('foobardasdas'));
     $this->assertEquals($foo->get('fooinvalid'), array());
     $this->assertEquals($foo->has('xxxdasdaysdasadjhasjd,barfoo'), false);
     $this->assertEquals($foo->has('xxxdasdaysdasadjhasjd,foobar,barfoo'), true);
     $this->assertEquals($foo->getOne('xxxdasdaysdasadjhasjd,foobar,barfoo')->getName(), 'foobar');
     foreach ($foo->get('foobar,barfoo') as $annotation) {
         $this->assertTrue($annotation->getObject() instanceof \Notoj\Object\Base);
         $this->assertTrue(file_exists($annotation->getFile()));
         $this->assertTrue($annotation->isClass());
         $this->assertFalse($annotation->isMethod());
         $this->assertFalse($annotation->isProperty());
     }
 }
Ejemplo n.º 2
0
 public function testBugDuplicateAnnotations()
 {
     $fs = new \Notoj\Dir(__DIR__);
     $this->assertEquals(1, count($fs->get('weird_alone')));
 }