PHP Class Cascade\Tests\Config\Loader\ClassLoader\Resolver\ConstructorResolverTest

Author: Raphael Antonmattei ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Afficher le fichier Open project: theorchard/monolog-cascade

Protected Properties

Свойство Type Description
$reflected ReflectionClass Reflection class for which you want to resolve extra options
$resolver Cascade\Config\Loader\ClassLoader\Resolver\ConstructorResolver Constructor Resolver

Méthodes publiques

Méthode Description
invalidOptionsProvider ( ) : array Data provider for testResolveWithInvalidOptions
missingOptionsProvider ( ) : array Data provider for testResolveWithInvalidOptions.
optionsProvider ( ) : array Data provider for testResolve
setUp ( ) Set up function
tearDown ( ) Tear down function
testConstructor ( ) Test the resolver contructor
testHashToArgsArray ( ) Test the hashToArgsArray function
testInitConstructorArgs ( ) Test that constructor args were pulled properly
testResolve ( array $expectedResolvedOptions, array $options ) Test resolving with valid options
testResolveWithInvalidOptions ( array $invalidOptions ) Test resolving with invalid options. It should throw an exception.
testResolveWithMissingOptions ( array $incompleteOptions ) Test resolving with missing/incomplete options. It should throw an exception.

Méthodes protégées

Méthode Description
getConstructorArgs ( ) : ReflectionParameter[] Return the contructor args of the reflected class

Method Details

getConstructorArgs() protected méthode

Return the contructor args of the reflected class
protected getConstructorArgs ( ) : ReflectionParameter[]
Résultat ReflectionParameter[] array of params

invalidOptionsProvider() public méthode

The order of the input options does not matter and is somewhat random. The resolution should reconcile those options and match them up with the contructor param position
public invalidOptionsProvider ( ) : array
Résultat array of arrays with expected resolved values and options used as input

missingOptionsProvider() public méthode

The order of the input options does not matter and is somewhat random. The resolution should reconcile those options and match them up with the contructor param position
public missingOptionsProvider ( ) : array
Résultat array of arrays with expected resolved values and options used as input

optionsProvider() public méthode

The order of the input options does not matter and is somewhat random. The resolution should reconcile those options and match them up with the contructor param position
public optionsProvider ( ) : array
Résultat array of arrays with expected resolved values and options used as input

setUp() public méthode

Set up function
public setUp ( )

tearDown() public méthode

Tear down function
public tearDown ( )

testConstructor() public méthode

Test the resolver contructor
public testConstructor ( )

testHashToArgsArray() public méthode

Test the hashToArgsArray function
public testHashToArgsArray ( )

testInitConstructorArgs() public méthode

Note that we need to deuplicate the CamelCase conversion here for old fashioned classes

testResolve() public méthode

Test resolving with valid options
public testResolve ( array $expectedResolvedOptions, array $options )
$expectedResolvedOptions array Array of expected resolved options (i.e. parsed and validated)
$options array Array of raw options

testResolveWithInvalidOptions() public méthode

Test resolving with invalid options. It should throw an exception.
public testResolveWithInvalidOptions ( array $invalidOptions )
$invalidOptions array Array of invalid options

testResolveWithMissingOptions() public méthode

Test resolving with missing/incomplete options. It should throw an exception.
public testResolveWithMissingOptions ( array $incompleteOptions )
$incompleteOptions array Array of invalid options

Property Details

$reflected protected_oe property

Reflection class for which you want to resolve extra options
protected ReflectionClass $reflected
Résultat ReflectionClass

$resolver protected_oe property

Constructor Resolver
protected ConstructorResolver,Cascade\Config\Loader\ClassLoader\Resolver $resolver
Résultat Cascade\Config\Loader\ClassLoader\Resolver\ConstructorResolver