PHP Класс eZ\Publish\Core\FieldType\Tests\CountryTest

Наследование: extends FieldTypeTest
Показать файл Открыть проект

Открытые методы

Метод Описание
provideDataForGetName ( )
provideInputForFromHash ( ) : array Provide input to fromHash() method.
provideInputForToHash ( ) : array Provide input for the toHash() method.
provideInvalidDataForValidate ( ) : array Provides data sets with validator configuration and/or field settings, field value and corresponding validation errors returned by the {@link validate()} method.
provideInvalidInputForAcceptValue ( ) : array Data provider for invalid input to acceptValue().
provideValidDataForValidate ( ) : array Provides data sets with validator configuration and/or field settings and field value which are considered valid by the {@link validate()} method.
provideValidInputForAcceptValue ( ) : array Data provider for valid input to acceptValue().

Защищенные методы

Метод Описание
createFieldTypeUnderTest ( ) : FieldType Returns the field type under test.
getEmptyValueExpectation ( ) : Value Returns the empty value expected from the field type.
getSettingsSchemaExpectation ( ) : array Returns the settings schema expected from the field type.
getValidatorConfigurationSchemaExpectation ( ) : array Returns the validator configuration schema expected from the field type.
provideFieldTypeIdentifier ( )

Описание методов

createFieldTypeUnderTest() защищенный Метод

This method is used by all test cases to retrieve the field type under test. Just create the FieldType instance using mocks from the provided get*Mock() methods and/or custom get*Mock() implementations. You MUST NOT take care for test case wide caching of the field type, just return a new instance from this method!
protected createFieldTypeUnderTest ( ) : FieldType
Результат FieldType

getEmptyValueExpectation() защищенный Метод

Returns the empty value expected from the field type.
protected getEmptyValueExpectation ( ) : Value
Результат eZ\Publish\Core\FieldType\Checkbox\Value

getSettingsSchemaExpectation() защищенный Метод

Returns the settings schema expected from the field type.
protected getSettingsSchemaExpectation ( ) : array
Результат array

getValidatorConfigurationSchemaExpectation() защищенный Метод

Returns the validator configuration schema expected from the field type.
protected getValidatorConfigurationSchemaExpectation ( ) : array
Результат array

provideDataForGetName() публичный Метод

provideFieldTypeIdentifier() защищенный Метод

provideInputForFromHash() публичный Метод

Returns an array of data provider sets with 2 arguments: 1. The valid input to fromHash(), 2. The expected return value from fromHash(). For example: return array( array( null, null ), array( array( 'path' => 'some/file/here', 'fileName' => 'sindelfingen.jpg', 'fileSize' => 2342, 'downloadCount' => 0, 'mimeType' => 'image/jpeg', ), new BinaryFileValue( array( 'path' => 'some/file/here', 'fileName' => 'sindelfingen.jpg', 'fileSize' => 2342, 'downloadCount' => 0, 'mimeType' => 'image/jpeg', ) ) ), ... );
public provideInputForFromHash ( ) : array
Результат array

provideInputForToHash() публичный Метод

Returns an array of data provider sets with 2 arguments: 1. The valid input to toHash(), 2. The expected return value from toHash(). For example: return array( array( null, null ), array( new BinaryFileValue( array( 'path' => 'some/file/here', 'fileName' => 'sindelfingen.jpg', 'fileSize' => 2342, 'downloadCount' => 0, 'mimeType' => 'image/jpeg', ) ), array( 'path' => 'some/file/here', 'fileName' => 'sindelfingen.jpg', 'fileSize' => 2342, 'downloadCount' => 0, 'mimeType' => 'image/jpeg', ) ), ... );
public provideInputForToHash ( ) : array
Результат array

provideInvalidDataForValidate() публичный Метод

ATTENTION: This is a default implementation, which must be overwritten if a FieldType supports validation! For example: return array( array( array( "validatorConfiguration" => array( "IntegerValueValidator" => array( "minIntegerValue" => 5, "maxIntegerValue" => 10 ), ), ), new IntegerValue( 3 ), array( new ValidationError( "The value can not be lower than %size%.", null, array( "size" => 5 ), ), ), ), array( array( "fieldSettings" => array( "isMultiple" => false ), ), new CountryValue( "BE" => array( "Name" => "Belgium", "Alpha2" => "BE", "Alpha3" => "BEL", "IDC" => 32, ), "FR" => array( "Name" => "France", "Alpha2" => "FR", "Alpha3" => "FRA", "IDC" => 33, ), ) ), array( new ValidationError( "Field definition does not allow multiple countries to be selected." ), ), ... );
public provideInvalidDataForValidate ( ) : array
Результат array

provideInvalidInputForAcceptValue() публичный Метод

Returns an array of data provider sets with 2 arguments: 1. The invalid input to acceptValue(), 2. The expected exception type as a string. For example: return array( array( new \stdClass(), 'eZ\\Publish\\Core\\Base\\Exceptions\\InvalidArgumentException', ), array( array(), 'eZ\\Publish\\Core\\Base\\Exceptions\\InvalidArgumentException', ), ... );
public provideInvalidInputForAcceptValue ( ) : array
Результат array

provideValidDataForValidate() публичный Метод

ATTENTION: This is a default implementation, which must be overwritten if a FieldType supports validation! For example: return array( array( array( "validatorConfiguration" => array( "StringLengthValidator" => array( "minStringLength" => 2, "maxStringLength" => 10, ), ), ), new TextLineValue( "lalalala" ), ), array( array( "fieldSettings" => array( 'isMultiple' => true ), ), new CountryValue( array( "BE" => array( "Name" => "Belgium", "Alpha2" => "BE", "Alpha3" => "BEL", "IDC" => 32, ), ), ), ), ... );
public provideValidDataForValidate ( ) : array
Результат array

provideValidInputForAcceptValue() публичный Метод

Returns an array of data provider sets with 2 arguments: 1. The valid input to acceptValue(), 2. The expected return value from acceptValue(). For example: return array( array( null, null ), array( __FILE__, new BinaryFileValue( array( 'path' => __FILE__, 'fileName' => basename( __FILE__ ), 'fileSize' => filesize( __FILE__ ), 'downloadCount' => 0, 'mimeType' => 'text/plain', ) ) ), ... );
public provideValidInputForAcceptValue ( ) : array
Результат array