/** * Testing transactionStart() with an other running transaction * * @expectedException \brightzone\rexpro\InternalException * * @return void */ public function testSeveralRunningTransactionStart() { $db = new Connection(); $db->open('localhost:8182', 'graphT', $this->username, $this->password); $db->transactionStart(); $db->transactionStart(); }
/** * Testing Example 4 * * @return void */ public function testExample4() { $db = new Connection(); $db->open('localhost:8182', 'graphT'); $originalCount = $db->send('n.V().count()'); $db->transactionStart(); $db->send('n.addVertex("name","michael")'); $db->send('n.addVertex("name","john")'); $db->transactionStop(FALSE); //rollback changes. Set to true to commit. $newCount = $db->send('n.V().count()'); $this->assertEquals($newCount, $originalCount, 'Rollback was not done for eample 4'); $db->close(); }
/** * Testing transactionStart() with an other running transaction * * @return void */ public function testSeveralRunningTransactionStart() { $db = new Connection(); $db->open('localhost:8184', 'graph', $this->username, $this->password); $db->transactionStart(); $result = $db->transactionStart(); $this->assertFalse($result, 'Failed to return false with an other started transaction'); }