public function userTypeWithMultipleEmptyComponents() { $scalarCassandraTypes = $this->scalarCassandraTypes(); $sizes = range(2, count($scalarCassandraTypes)); return array_map(function ($size) use($scalarCassandraTypes) { $types = array(); for ($i = 0; $i < $size; $i++) { $types["field{$i}"] = $scalarCassandraTypes[$i][0]; } $user = new UserTypeValue($types); $userType = $user->type()->withName(self::userTypeString($user->type())); return array($userType, $user); }, $sizes); }
/** * @expectedException InvalidArgumentException * @expectedExceptionMessage argument must be an int, 'text' given */ public function testInvalidType() { $udt = new UserTypeValue(array('name1' => Type::int())); $udt->set('name1', 'text'); }