Beispiel #1
0
 public function testDropLabels()
 {
     //create a new model object
     $m = new Labeled();
     $m->setLabel(array('User', 'Fan', 'Superuniqelabel2'));
     //set some labels
     $m->save();
     //get the node id, we need it to verify if the label is actually added in graph
     $id = $m->id;
     //drop the label
     $m->dropLabels(array('Superuniqelabel2'));
     //get the Node for $id using Everyman lib
     $connection = $this->getConnectionWithConfig('neo4j');
     $client = $connection->getClient();
     $node = $client->getNode($id);
     $this->assertNotNull($node);
     //it should exist
     $labels = $node->getLabels();
     //get labels as array on the Everyman nodes
     $strLabels = array();
     foreach ($labels as $lbl) {
         $strLabels[] = $lbl->getName();
     }
     $this->assertFalse(in_array('Superuniqelabel2', $strLabels));
 }
 public function testOverriddenNodeLabel()
 {
     $m = new Labeled();
     $label = $m->getDefaultNodeLabel();
     $this->assertEquals('Labeled', reset($label));
 }