public function scalarTypes() { return array(array(function () { return Type::ascii(); }), array(function () { return Type::bigint(); }), array(function () { return Type::blob(); }), array(function () { return Type::boolean(); }), array(function () { return Type::counter(); }), array(function () { return Type::decimal(); }), array(function () { return Type::double(); }), array(function () { return Type::float(); }), array(function () { return Type::inet(); }), array(function () { return Type::int(); }), array(function () { return Type::text(); }), array(function () { return Type::timestamp(); }), array(function () { return Type::timeuuid(); }), array(function () { return Type::uuid(); }), array(function () { return Type::varchar(); }), array(function () { return Type::varint(); })); }
public function notEqualTypes() { return array(array(Type::collection(Type::varchar()), Type::collection(Type::int())), array(Type::collection(Type::collection(Type::varchar())), Type::collection(Type::collection(Type::int()))), array(Type::collection(Type::collection(Type::int())), Type::collection(Type::set(Type::int())))); }
/** * Invalid datatypes for tuples. * * This test will ensure that an exception will occur when an invalid * datatype is used inside a tuple; issues from the server. * * @test * @ticket PHP-58 * @expectedException \Cassandra\Exception\InvalidQueryException */ public function testInvalidType() { $validType = Type::tuple(Type::int()); $invalidType = Type::tuple(Type::varchar()); $tableName = $this->createTable($validType); $options = new ExecutionOptions(array('arguments' => array("key", $invalidType->create("value")))); $this->insertValue($tableName, $options); }
public function notEqualTypes() { return array(array(Type::userType('a', Type::int()), Type::userType('a', Type::varchar())), array(Type::userType('a', Type::int(), 'b', Type::varchar()), Type::userType('a', Type::int(), 'b', Type::bigint())), array(Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::varint()), Type::userType('a', Type::int(), 'b', Type::varchar(), 'c', Type::bigint())), array(Type::userType('a', Type::collection(Type::int()), 'b', Type::set(Type::varchar())), Type::userType('a', Type::collection(Type::int()), 'b', Type::set(Type::int()))), array(Type::userType('a', Type::int()), Type::userType('b', Type::int())), array(Type::userType('a', Type::int(), 'c', Type::varchar()), Type::userType('b', Type::int(), 'c', Type::varchar()))); }
/** * @expectedException InvalidArgumentException * @expectedExceptionMessage argument must be a string, '1' given */ public function testPreventsCreatingMapWithUnsupportedTypes() { Type::map(Type::varchar(), Type::int())->create(1, "a"); }
public function notEqualTypes() { $setType = Type::set(Type::int()); return array(array(Type::map(Type::int(), Type::int())->create(), Type::map(Type::int(), Type::varchar())->create()), array(Type::map(Type::int(), Type::varchar())->create(1, 'a', 2, 'b', 3, 'c'), Type::map(Type::int(), Type::varchar())->create(1, 'a')), array(Type::map($setType, Type::varchar())->create($setType->create(4, 5, 6), 'a', $setType->create(7, 8, 9), 'b'), Type::map($setType, Type::varchar())->create($setType->create(1, 2, 3), 'a', $setType->create(4, 5, 6), 'b'))); }