PHP Class PhpSpec\ObjectBehavior

Most specs will extend this class directly. Its responsibility is to proxy method calls to PhpSpec caller which will wrap the results into PhpSpec subjects. This results will then be able to be matched against expectations.
Inheritance: implements ArrayAcces\ArrayAccess, implements PhpSpec\Matcher\MatchersProvider, implements PhpSpec\Wrapper\SubjectContainer, implements PhpSpec\Wrapper\ObjectWrapper, implements Specification
Afficher le fichier Open project: phpspec/phpspec Class Usage Examples

Protected Properties

Свойство Type Description
$object PhpSpec\Wrapper\Subject

Méthodes publiques

Méthode Description
__call ( string $method, array $arguments = [] ) : mixed Proxies all calls to the PhpSpec subject
__get ( string $property ) : mixed Proxies getting to the PhpSpec subject
__invoke ( ) : mixed Proxies functor calls to PhpSpec subject
__set ( string $property, mixed $value ) Proxies setting to the PhpSpec subject
getMatchers ( ) : array Override this method to provide your own inline matchers
getWrappedObject ( ) : object Gets the unwrapped proxied object from PhpSpec subject
offsetExists ( string | integer $key ) : Subject Checks if a key exists in case object implements ArrayAccess
offsetGet ( string | integer $key ) : Subject Gets the value in a particular position in the ArrayAccess object
offsetSet ( string | integer $key, mixed $value ) Sets the value in a particular position in the ArrayAccess object
offsetUnset ( string | integer $key ) Unsets a position in the ArrayAccess object
setSpecificationSubject ( Subject $subject ) Used by { @link PhpSpec\Runner\Maintainer\SubjectMaintainer::prepare() } to prepare the subject with all the needed collaborators for proxying object behaviour

Method Details

__call() public méthode

Proxies all calls to the PhpSpec subject
public __call ( string $method, array $arguments = [] ) : mixed
$method string
$arguments array
Résultat mixed

__get() public méthode

Proxies getting to the PhpSpec subject
public __get ( string $property ) : mixed
$property string
Résultat mixed

__invoke() public méthode

Proxies functor calls to PhpSpec subject
public __invoke ( ) : mixed
Résultat mixed

__set() public méthode

Proxies setting to the PhpSpec subject
public __set ( string $property, mixed $value )
$property string
$value mixed

getMatchers() public méthode

Override this method to provide your own inline matchers
public getMatchers ( ) : array
Résultat array a list of inline matchers

getWrappedObject() public méthode

Gets the unwrapped proxied object from PhpSpec subject
public getWrappedObject ( ) : object
Résultat object

offsetExists() public méthode

Checks if a key exists in case object implements ArrayAccess
public offsetExists ( string | integer $key ) : Subject
$key string | integer
Résultat PhpSpec\Wrapper\Subject

offsetGet() public méthode

Gets the value in a particular position in the ArrayAccess object
public offsetGet ( string | integer $key ) : Subject
$key string | integer
Résultat PhpSpec\Wrapper\Subject

offsetSet() public méthode

Sets the value in a particular position in the ArrayAccess object
public offsetSet ( string | integer $key, mixed $value )
$key string | integer
$value mixed

offsetUnset() public méthode

Unsets a position in the ArrayAccess object
public offsetUnset ( string | integer $key )
$key string | integer

setSpecificationSubject() public méthode

Used by { @link PhpSpec\Runner\Maintainer\SubjectMaintainer::prepare() } to prepare the subject with all the needed collaborators for proxying object behaviour
public setSpecificationSubject ( Subject $subject )
$subject PhpSpec\Wrapper\Subject

Property Details

$object protected_oe property

protected Subject,PhpSpec\Wrapper $object
Résultat PhpSpec\Wrapper\Subject