GraphAware\Neo4j\OGM\Tests\Integration\SingleEntityTest::testEntityIsPersisted PHP Method

testEntityIsPersisted() public method

    public function testEntityIsPersisted()
    {
        $user = new User('neo', 33);
        $this->em->persist($user);
        $this->em->flush();
        $query = 'MATCH (n:User {login:"neo"}) RETURN n';
        $result = $this->client->run($query);
        $this->assertCount(1, $result->records());
        $record = $result->records()[0];
        $userNode = $record->value('n');
        $this->assertEquals('neo', $userNode->value('login'));
        $this->assertEquals(33, $userNode->value('age'));
        $this->assertCount(1, $userNode->labels());
    }