/** * Nested composite Cassandra types (list, map, set, tuple, and UDT) to be * used by data providers */ public function nestedCassandraTypes() { $compositeCassandraTypes = $this->compositeCassandraTypes(); foreach ($compositeCassandraTypes as $nestedType) { $type = Type::collection($nestedType[0]); $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0]))); } foreach ($compositeCassandraTypes as $nestedType) { $type = Type::set($nestedType[0]); $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0]))); } foreach ($compositeCassandraTypes as $nestedType) { $type = Type::map($nestedType[0], $nestedType[0]); $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0], $nestedType[1][1]))); } foreach ($compositeCassandraTypes as $nestedType) { $type = Type::tuple($nestedType[0], $nestedType[0]); $nestedCassandraTypes[] = array($type, array($type->create($nestedType[1][0], $nestedType[1][1]))); } foreach ($compositeCassandraTypes as $nestedType) { $type = Type::userType("a", $nestedType[0], "b", $nestedType[0]); $type = $type->withName(self::userTypeString($type)); $nestedCassandraTypes[] = array($type, array($type->create("a", $nestedType[1][0], "b", $nestedType[1][1]))); } return $nestedCassandraTypes; }
public function notEqualTypes() { $setType = Type::set(Type::int()); return array(array(Type::collection(Type::int())->create(), Type::collection(Type::varchar())->create()), array(Type::collection(Type::int())->create(1, 2, 3), Type::collection(Type::int())->create(4, 5, 6)), array(Type::collection(Type::int())->create(1, 2, 3), Type::collection(Type::int())->create(1)), array(Type::collection(Type::varchar())->create('a', 'b', 'c'), Type::collection(Type::varchar())->create('a', 'b', 'd')), array(Type::collection($setType)->create($setType->create(1, 2, 3)), Type::collection($setType)->create($setType->create(4, 5, 6)))); }
public function notEqualTypes() { $setType = Type::set(Type::int()); return array(array(Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::varint())->create(), Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::bigint())->create()), array(Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::bigint())->create(), Type::userType('x', Type::int(), 'y', Type::varchar(), 'z', Type::bigint())->create()), array(Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::bigint())->create('a', 1, 'b', 'x', 'c', new Bigint(99)), Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::bigint())->create('a', 2, 'b', 'y', 'c', new Bigint(999))), array(Type::userType('a', $setType, 'b', Type::varchar())->create('a', $setType->create(1, 2, 3), 'b', 'x'), Type::userType('a', $setType, 'b', Type::varchar())->create('a', $setType->create(4, 5, 6), 'b', 'x'))); }
/** * Bind statment with an null set */ public function testNull() { $setType = Type::set(Type::int()); $this->createTableInsertAndVerifyValueByIndex($setType, null); $this->createTableInsertAndVerifyValueByName($setType, null); }
public function notEqualTypes() { $setType = Type::set(Type::int()); return array(array(Type::tuple(Type::int(), Type::varchar(), Type::varint())->create(), Type::tuple(Type::int(), Type::varchar(), Type::bigint())->create()), array(Type::tuple(Type::int(), Type::varchar(), Type::bigint())->create(1, 'a', new Bigint(99)), Type::tuple(Type::int(), Type::varchar(), Type::bigint())->create(2, 'b', new Bigint(99))), array(Type::tuple($setType, Type::varchar())->create($setType->create(1, 2, 3), 'a'), Type::tuple($setType, Type::varchar())->create($setType->create(4, 5, 6), 'a'))); }