Inheritance: implements ArrayAcces\ArrayAccess, implements PhpSpec\Wrapper\WrapperInterface
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');
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }