evseevnn\Cassandra\Tests\QueryVarIntTest::testVarIntMap PHP Method

testVarIntMap() public method

public testVarIntMap ( )
    public function testVarIntMap()
    {
        self::$connection->query('CREATE TABLE VarIntMapTest (foo varint PRIMARY KEY, bar map<varint,varint>)');
        self::$connection->query('INSERT INTO VarIntMapTest (foo, bar) VALUES (:foo, :bar)', ['foo' => '2', 'bar' => ['52' => '25']]);
        $result = self::$connection->query('SELECT * FROM VarIntMapTest WHERE foo = :foo', ['foo' => '2']);
        $this->assertEquals(['52' => '25'], $result[0]['bar']);
        $this->assertEquals('2', $result[0]['foo']);
        self::$connection->query('INSERT INTO VarIntMapTest (foo, bar) VALUES (:foo, :bar)', ['foo' => '22', 'bar' => ['522' => '14156250080000000000003002']]);
        $result = self::$connection->query('SELECT * FROM VarIntMapTest WHERE foo = :foo', ['foo' => '22']);
        $this->assertEquals(['522' => '14156250080000000000003002'], $result[0]['bar']);
        $this->assertEquals('22', $result[0]['foo']);
    }