PHP Class Cassandra\UserTypeIntegrationTest

Inheritance: extends CollectionsIntegrationTest
Show file Open project: datastax/php-driver Class Usage Examples

Public Methods

Method Description
assertAddressValue ( UserTypeValue $address, UserTypeValue $expected = null ) Make assertions on a address user type.
generateAddressValue ( ) : UserTypeValue Generate a valid address user type with values that can be used for testing.
getAddressUserType ( ) : UserTypeValue Get the address user type for assigning values.
getPhoneUserType ( ) : UserTypeValue Get the phone user type for assigning values.
testCompleteUserType ( ) User type using a complete user type value.
testCompositeTypes ( $type, $value ) User types with composite types
testEmpty ( $type, $value ) Bind statement with an empty user type
testFrozenRequired ( ) Frozen decoration required for user type.
testInvalidAddressUserTypeAssignedValue ( ) Invalid value assigned to user type .
testInvalidPhoneUserTypeAssignedValue ( ) Invalid value assigned to user type .
testMultipleComponents ( $type, $value ) User types with multiple components
testNestedTypes ( $type, $value ) User types with nested composite types
testNull ( ) Bind statement with an null user type
testPartial ( ) Partial user type
testPartialUserType ( ) User type using a partial user type value.
testScalarTypes ( $type, $value ) User types using scalar/simple datatypes
testUnavailableUserType ( ) Unavailable user type referenced.
userTypeWithCompositeTypes ( ) Data provider for user types with composite types
userTypeWithMultipleComponents ( ) Data provider for user types with multiple components
userTypeWithMultipleEmptyComponents ( )
userTypeWithNestedTypes ( ) Data provider for user types with nested composite types
userTypeWithScalarTypes ( ) Data provider for user types with scalar types

Protected Methods

Method Description
setUp ( ) Setup the database for the user type tests.

Private Methods

Method Description
insertAddress ( UserTypeValue $address ) : Timeuuid Insert an address into the table.
selectAddress ( Timeuuid $key ) : UserTypeValue Select the address from the table.

Method Details

assertAddressValue() public static method

Make assertions on a address user type.
public static assertAddressValue ( UserTypeValue $address, UserTypeValue $expected = null )
$address UserTypeValue Address user type to validate
$expected UserTypeValue Expected address user type value (DEFAULT: self::generateAddressValue())

generateAddressValue() public static method

Generate a valid address user type with values that can be used for testing.
public static generateAddressValue ( ) : UserTypeValue
return UserTypeValue Valid address user type for testing

getAddressUserType() public static method

Get the address user type for assigning values.
public static getAddressUserType ( ) : UserTypeValue
return UserTypeValue Address user type

getPhoneUserType() public static method

Get the phone user type for assigning values.
public static getPhoneUserType ( ) : UserTypeValue
return UserTypeValue Phone user type

setUp() protected method

Setup the database for the user type tests.
protected setUp ( )

testCompleteUserType() public method

This test will ensure that the PHP driver supports the user types. This test uses a complete user type will all values assigned for the associated user type.

testCompositeTypes() public method

This test ensures that user types work with other nested collections and other composite types such as UDTs and tuples.
public testCompositeTypes ( $type, $value )

testEmpty() public method

Bind statement with an empty user type
public testEmpty ( $type, $value )

testFrozenRequired() public method

This test will ensure that the PHP driver throws an exception when interacting with Cassandra 2.1+ (< 3.0) and the frozen decoration is omitted.
public testFrozenRequired ( )

testInvalidAddressUserTypeAssignedValue() public method

This test will ensure that the PHP driver throws and exception when assigning a value to a user type that is not valid for that type.

testInvalidPhoneUserTypeAssignedValue() public method

This test will ensure that the PHP driver throws and exception when assigning a value to a user type that is not valid for that type.

testMultipleComponents() public method

User types with multiple components
public testMultipleComponents ( $type, $value )

testNestedTypes() public method

This test ensures that user types work with other nested collections and other composite types such as UDTs and tuples.
public testNestedTypes ( $type, $value )

testNull() public method

Bind statement with an null user type
public testNull ( )

testPartial() public method

This test will ensure that partial user types return the correct value.
public testPartial ( )

testPartialUserType() public method

This test will ensure that the PHP driver supports the user types. This test uses a partial user type where some values will not be assigned.
public testPartialUserType ( )

testScalarTypes() public method

This test will ensure that the PHP driver supports the user types collection with all PHP driver supported scalar/simple datatypes.
public testScalarTypes ( $type, $value )

testUnavailableUserType() public method

This test will ensure that the PHP driver throws an exception when referencing a non-existent user type.

userTypeWithCompositeTypes() public method

Data provider for user types with composite types

userTypeWithMultipleComponents() public method

Data provider for user types with multiple components

userTypeWithMultipleEmptyComponents() public method

userTypeWithNestedTypes() public method

Data provider for user types with nested composite types

userTypeWithScalarTypes() public method

Data provider for user types with scalar types