PhpSpec\Wrapper\Subject::__call PHP Method

__call() public method

public __call ( string $method, array $arguments = [] ) : mixed | Subject
$method string
$arguments array
return mixed | Subject
    public function __call($method, array $arguments = array())
    {
        if (0 === strpos($method, 'should')) {
            return $this->callExpectation($method, $arguments);
        }
        if (preg_match('/^beConstructedThrough(?P<method>[0-9A-Z]+)/i', $method, $matches)) {
            return $this->beConstructedThrough(lcfirst($matches['method']), $arguments);
        }
        if (preg_match('/^beConstructed(?P<method>[0-9A-Z]+)/i', $method, $matches)) {
            return $this->beConstructedThrough(lcfirst($matches['method']), $arguments);
        }
        return $this->caller->call($method, $arguments);
    }

Usage Example

Ejemplo n.º 1
0
 function it_creates_negative_throw_expectations(MatcherManager $matchers, Matcher $matcher, Subject $subject)
 {
     $matchers->find(Argument::cetera())->willReturn($matcher);
     $subject->__call('getWrappedObject', array())->willReturn(new \stdClass());
     $expectation = $this->create('shouldNotThrow', $subject);
     $expectation->shouldHaveType('PhpSpec\\Wrapper\\Subject\\Expectation\\NegativeThrow');
 }
All Usage Examples Of PhpSpec\Wrapper\Subject::__call