Created
September 2, 2012 16:52
-
-
Save andho/3601439 to your computer and use it in GitHub Desktop.
merge conflict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Invokes a matcher or proxies the method call to the intercepted object | |
* magic call method, if one exists | |
* | |
* @param string $method | |
* @param array $args | |
* @return boolean|mixed | |
*/ | |
public function __call($method, $args) | |
{ | |
if (MatcherRepository::has($method)) { | |
$this->performMatchingWithUserDefinedMatcher($method, $args); | |
return true; | |
} | |
try { | |
$this->setExpectedValue($args); | |
$this->_matcher = $this->getMatcherFactory() | |
->create($method, $args); | |
$this->performMatching(); | |
return true; | |
} catch (InvalidMatcherType $e) { | |
throw new InvalidMatcher($e->getMessage()); | |
} catch (InvalidMatcher $e) { | |
} | |
if ($this->interceptedHasAMagicCall()) { | |
return $this->invokeInterceptedMagicCall($method, $args); | |
} | |
<<<<<<< HEAD | |
if ($this->callingExpectationsAsMethods($method)) { | |
$this->throwErrorExpectationsAreProperties(); | |
======= | |
if (method_exists($this->_actualValue, '__call')) { | |
$parentInterceptor = new \ReflectionMethod( | |
$this->_actualValue, '__call' | |
); | |
$value = $parentInterceptor->invokeArgs( | |
$this->_actualValue, array($method, $args) | |
); | |
return \PHPSpec\Specification\Interceptor | |
\InterceptorFactory::create($value, $this); | |
>>>>>>> junit | |
} | |
if ($this->interceptedIsNotAnObject() && | |
$this->anExpectationHasBeenUsed()) { | |
$this->throwNotAMatcherException($method); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ phpspec spec
................................................................................................................................................................................E
Errors:
PHPSpec\Specification\Result\Error: $calculator->add(40, 2)->should->equal(42);
PHP Notice: Trying to get property of non-object
./spec/Specification/Interceptor/ObjectSpec.php:27
./src/PHPSpec/Specification/Example.php:43
./src/PHPSpec/Specification/BaseExample.php:93
Finished in 1.385272 seconds
177 examples, 1 error