Cassandra\UserTypeValueTest::testSetAndGetFields PHP Method

testSetAndGetFields() public method

public testSetAndGetFields ( )
    public function testSetAndGetFields()
    {
        $fields = array('a' => Type::int(), 'b' => Type::text(), 'c' => Type::bigint());
        $udt = new UserTypeValue($fields);
        $udt->set('a', 1);
        $udt->set('b', 'xyz');
        $udt->set('c', new Bigint('123'));
        $this->assertEquals($udt->get('a'), 1);
        $this->assertEquals($udt->get('b'), 'xyz');
        $this->assertEquals($udt->get('c'), new Bigint('123'));
        $other = new UserTypeValue($fields);
        $other->set('a', 1);
        $other->set('b', 'xyz');
        $other->set('c', new Bigint('123'));
        $this->assertEquals($udt, $other);
    }