Example #1
0
 public function testCreateNewNodes()
 {
     $root = $this->getStore()->rootNode;
     // Create content node
     self::$newNode = $this->getCompanyHome()->createChild("cm_content", "cm_contains", "cm_" . self::$fileName1);
     self::$newNode->cm_name = self::$fileName1;
     self::$newNode->addAspect("cm_titled");
     self::$newNode->cm_title = NodeTest::TITLE;
     self::$newNode->cm_description = NodeTest::DESCRIPTION;
     // Create a new folder node
     self::$newFolderNode = $this->getCompanyHome()->createChild("cm_folder", "cm_contains", "cm_" . self::$folderName1);
     self::$newFolderNode->cm_name = self::$folderName1;
     // Create another content node in the folder just created
     self::$newNode2 = $this->getCompanyHome()->createChild("cm_content", "cm_contains", "cm_" . self::$fileName2);
     self::$newNode2->cm_name = self::$fileName2;
     self::$newNode2->addAspect("cm_titled");
     self::$newNode2->cm_title = NodeTest::TITLE;
     self::$newNode2->cm_description = NodeTest::DESCRIPTION;
     // Save the newly created nodes
     $this->getSession()->save();
     // Do a couple of sanity checks to ensure that the nodes have been created correctly
     $this->assertEquals(NodeTest::TITLE, self::$newNode->cm_title);
     // TODO add more tests ...
 }