Пример #1
0
 public function testGetChildNodeDefinitions()
 {
     $children = self::$file->getChildNodeDefinitions();
     $this->assertInternalType('array', $children);
     $this->assertCount(1, $children);
     list($key, $child) = each($children);
     $this->assertInstanceOf('\\PHPCR\\NodeType\\NodeDefinitionInterface', $child);
     $this->assertEquals('jcr:content', $child->getName());
     // the rest is tested in NodeDefinitionTest
 }
 public function setUp()
 {
     parent::setUp();
     try {
         $defs = self::$file->getChildNodeDefinitions();
         $this->assertInternalType('array', $defs);
         $this->assertCount(1, $defs);
         list($key, $this->content) = each($defs);
         $this->assertInstanceOf('\\PHPCR\\NodeType\\NodeDefinitionInterface', $this->content);
         $this->assertEquals('jcr:content', $this->content->getName());
         $defs = self::$folder->getChildNodeDefinitions();
         $this->assertInternalType('array', $defs);
         $this->assertCount(1, $defs);
         list($key, $this->hierarchyNodeDef) = each($defs);
         $this->assertInstanceOf('\\PHPCR\\NodeType\\NodeDefinitionInterface', $this->hierarchyNodeDef);
         $this->assertEquals('*', $this->hierarchyNodeDef->getName());
     } catch (\Exception $e) {
         $this->markTestSkipped('getChildNodeDefinitions not working as it should, skipping tests about NodeDefinitionInterface: ' . $e->getMessage());
     }
 }