PHP Class Scalr\Tests\Functional\Api\V2\SpecSchema\Constraint\Validator

Validate SpecObject created form swagger specification with api response
Since: 5.11 (03.12.2015)
Author: Andrii Penchuk ([email protected])
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Protected Properties

Свойство Type Description
$errors array List of errors
$ignoreDiscriminatorValues array Mark test incomplete this discriminator not yet implemented
$ignoreEnumVal array List of ignore enum values in test
$ignoreRequiredVal array List of ignore required values This values is required but will not be included in response. Example privateKey in cloud credentials key based on object name in Api definitions

Méthodes publiques

Méthode Description
appendError ( string $property, string $message ) Add errors to this validator
check ( mixed $value, AbstractSpecObject $schema ) Invokes the validation of an element
getErrors ( ) : array
isValid ( ) : boolean

Méthodes protégées

Méthode Description
checkItems ( stdClass $element, AbstractSpecObject $schema ) Check each items in element
checkObject ( stdClass $element, AbstractSpecObject $schema ) Validates an object
checkProperty ( mixed $element, Property $schema ) Check property form spec object
checkRequired ( stdClass $element, ObjectEntity $schema ) Check required element
checkSample ( stdClass $element, Property $schema ) Check each sample element
getConcreteTypes ( AbstractSpecObject $schema, string $objectName ) : boolean | AbstractSpecObject if element has concrete type return schema this element

Method Details

appendError() public méthode

Add errors to this validator
public appendError ( string $property, string $message )
$property string error property
$message string error message

check() public méthode

Invokes the validation of an element
public check ( mixed $value, AbstractSpecObject $schema )
$value mixed value what we should check
$schema Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\AbstractSpecObject schema value generated of api specification

checkItems() protected méthode

Check each items in element
protected checkItems ( stdClass $element, AbstractSpecObject $schema )
$element stdClass the list of items
$schema Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\AbstractSpecObject items schema generated of api specification

checkObject() protected méthode

Validates an object
protected checkObject ( stdClass $element, AbstractSpecObject $schema )
$element stdClass object properties
$schema Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\AbstractSpecObject schema this object generated of api specification

checkProperty() protected méthode

Check property form spec object
protected checkProperty ( mixed $element, Property $schema )
$element mixed property value
$schema Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\Property property schema generated of api specification

checkRequired() protected méthode

Check required element
protected checkRequired ( stdClass $element, ObjectEntity $schema )
$element stdClass object with required element
$schema Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\ObjectEntity schema value generated of api specification

checkSample() protected méthode

Check each sample element
protected checkSample ( stdClass $element, Property $schema )
$element stdClass sample element not described in properties
$schema Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\Property schema each sample element generated of api specification

getConcreteTypes() protected méthode

if element has concrete type return schema this element
protected getConcreteTypes ( AbstractSpecObject $schema, string $objectName ) : boolean | AbstractSpecObject
$schema Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\AbstractSpecObject schema value generated of api specification
$objectName string concrete type name
Résultat boolean | Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\AbstractSpecObject

getErrors() public méthode

public getErrors ( ) : array
Résultat array

isValid() public méthode

public isValid ( ) : boolean
Résultat boolean

Property Details

$errors protected_oe property

List of errors
protected array $errors
Résultat array

$ignoreDiscriminatorValues protected_oe static_oe property

Mark test incomplete this discriminator not yet implemented
protected static array $ignoreDiscriminatorValues
Résultat array

$ignoreEnumVal protected_oe static_oe property

List of ignore enum values in test
protected static array $ignoreEnumVal
Résultat array

$ignoreRequiredVal protected_oe static_oe property

List of ignore required values This values is required but will not be included in response. Example privateKey in cloud credentials key based on object name in Api definitions
protected static array $ignoreRequiredVal
Résultat array