상속: implements ArrayAcces\ArrayAccess, implements PhpSpec\Wrapper\WrapperInterface
예제 #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');
 }
예제 #2
0
 public function __call($method, array $arguments = array())
 {
     if (preg_match('/^(to|notTo)(.+)$/', $method, $matches)) {
         $method = 'should' . $matches[2];
         if ('notTo' === $matches[1]) {
             $method = 'shouldNot' . $matches[2];
         }
     }
     return parent::__call($method, $arguments);
 }
예제 #3
0
 /**
  * Unsets a position in the ArrayAccess object
  *
  * @param string|integer $key
  */
 public function offsetUnset($key)
 {
     $this->object->offsetUnset($key);
 }
 function it_ignores_any_other_exception(Subject $subject, WrappedObject $wrapped)
 {
     $subject->callOnWrappedObject('getWrappedObject', array())->willThrow('\\Exception');
     $wrapped->getClassName()->willReturn('\\stdClass');
     $this->shouldNotThrow('\\Exception')->duringMatch('be', $subject, array(), $wrapped);
 }