/** * Testing Message getter error * * @expectedException \brightzone\rexpro\InternalException * * @return void */ public function testMessageGetError() { $db = new Connection(); $db->open('localhost:8182', 'graph', $this->username, $this->password); $this->assertTrue(isset($db->message->gremlin), 'gremlin should not be set'); $what = $db->message->something; }
/** * Testing Example 5 * * @return void */ public function testExample5() { $message = new Messages(); $message->gremlin = 'g.V()'; $message->op = 'eval'; $message->processor = ''; $message->setArguments(['language' => 'gremlin-groovy']); $message->registerSerializer('\\brightzone\\rexpro\\serializers\\Json'); $db = new Connection(); $db->open(); $result = $db->send($message); //do something with result $db->close(); }
/** * Testing transactionStop() with no running transaction * * @expectedException \brightzone\rexpro\InternalException * * @return void */ public function testTransactionStopWithNoTransaction() { $db = new Connection(); $db->open('localhost:8182', 'graphT', $this->username, $this->password); $db->transactionStop(); }
/** * Testing getSerializer * * @expectedException \brightzone\rexpro\ServerException * * @return void */ public function testEmptyResult() { $db = new Connection(); $message = $db->open('localhost:8182', 'graph', $this->username, $this->password); $this->assertNotEquals($message, FALSE, 'Failed to connect to db'); $result = $db->send('g.V().has("idontexists")'); }
/** * Testing failing message connection close() * * @return void */ public function testConnectCloseFailingMessage() { $db = new Connection(); $db->open('localhost', 'tinkergraph', $this->username, $this->password); $db->sessionUuid = ''; $result = $db->close(); $this->assertFalse($result, 'Failed to return false with no transaction started'); }