Lines Matching refs:prophecy

3 … release](https://poser.pugx.org/phpspec/prophecy/version.svg)](https://packagist.org/packages/php…
4 …uild Status](https://travis-ci.org/phpspec/prophecy.svg?branch=master)](https://travis-ci.org/phps…
56 "phpspec/prophecy": "~1.0"
76 behavior of objects with very limited knowledge about them. But as with any other prophecy,
86 $prophecy = $prophet->prophesize();
90 that's your specific object prophecy, which describes how your object would behave
95 $prophecy->willExtend('stdClass');
96 $prophecy->willImplement('SessionHandlerInterface');
100 object prophecy that our object should extend specific class, the second one says that
106 Ok, now we have our object prophecy. What can we do with it? First of all, we can get
107 our object *dummy* by revealing its prophecy:
110 $dummy = $prophecy->reveal();
120 You need to understand one thing - a dummy is not a prophecy. Your object prophecy is still
121 assigned to `$prophecy` variable and in order to manipulate with your expectations, you
123 prophecy.
137 $prophecy->read('123')->willReturn('value');
140 Oh wow. We've just made an arbitrary call on the object prophecy? Yes, we did. And this
142 method with arguments prophecy. Method prophecies give you the ability to create method
147 Promises are logical blocks, that represent your fictional methods in prophecy terms
153 $prophecy->read('123')->will(new Prophecy\Promise\ReturnPromise(array('value')));
174 $methodProphecy1 = $prophecy->read('123');
175 $methodProphecy2 = $prophecy->read('123');
176 $methodProphecy3 = $prophecy->read('321');
216 You see, even if method arguments used during method prophecy creation look
275 That's it. Now our `{set,get}Name()` prophecy will work with any string argument provided to it.
307 wildcard then uses to calculate the final arguments match score and use the method prophecy
310 `setName()` method prophecy and its promise. The simple rule of thumb - more precise token
315 Ok, now we know how to define our prophecy method promises, let's get our stub from
319 $stub = $prophecy->reveal();
326 the `UnexpectedCallException` for any call you didn't describe with object prophecy before
342 The `shouldBeCalled()` method here assigns `CallPrediction` to our method prophecy.