GraphAware\Neo4j\Client\Tests\Integration\TransactionIntegrationTest::testTransactionIsRolledBackInCaseOfException PHP Méthode

testTransactionIsRolledBackInCaseOfException() public méthode

    public function testTransactionIsRolledBackInCaseOfException()
    {
        $this->emptyDb();
        $tx = $this->client->transaction('http');
        try {
            $result = $tx->run('CREATE (n:Test) RETURN x');
            $this->assertEquals(1, 2);
            // If we reached here then there is a bug
        } catch (Neo4jException $e) {
            $this->assertEquals(Neo4jExceptionInterface::EFFECT_ROLLBACK, $e->effect());
        }
        $this->assertEquals(Transaction::ROLLED_BACK, $tx->status());
        $this->assertXNodesWithLabelExist('Test', 0);
    }