Lines Matching refs:to

7 framework. Though initially it was created to fulfil phpspec2 needs, it is flexible
8 enough to be used inside any testing framework out there with minimal effort.
51 First, add Prophecy to the list of dependencies inside your `composer.json`:
69 ## How to use it
91 in the near future. But first, you need to specify which object you're talking about,
118 a token object to satisfy a method typehint.
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
122 should work with it. `$dummy` is a dummy - a simple php object that tries to fulfil your
127 Ok, now we know how to create basic prophecies and reveal dummies from them. That's
129 interactions. If we do, we need to use *stubs* or *mocks*.
142 method with arguments prophecy. Method prophecies give you the ability to create method
150 shortcut to:
156 This promise will cause any call to our double's `read()` method with exactly one
157 argument - `'123'` to always return `'value'`. But that's only for this
162 - `ThrowPromise` or `->willThrow($exception)` - causes the method to throw specific exception
163 - `CallbackPromise` or `->will($callback)` - gives you a quick way to define your own custom logic
226 `Prophecy\Argument\Token\TokenInterface` and tell Prophecy how to compare real arguments
228 shortcut class `Prophecy\Argument`, which you can use to create tokens like that:
236 `ExactValueToken` is not very useful in our case as it forced us to hardcode the username.
239 - `IdenticalValueToken` or `Argument::is($value)` - checks that the argument is identical to a spec…
247 - `AnyValuesToken` or `Argument::cetera()` - matches any arguments to the rest of the signature
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
315 Ok, now we know how to define our prophecy method promises, let's get our stub from
325 (method call), Prophecy will force you to define all the communications - it throws
331 Now we know how to define doubles without behavior (dummies) and doubles with behavior, but
342 The `shouldBeCalled()` method here assigns `CallPrediction` to our method prophecy.
345 code. After that, Prophecy can use this collected information to check if it matches defined
346 predictions. You can assign predictions to method prophecies using the
348 the `shouldBeCalled()` method we used earlier is just a shortcut to:
362 In PHPUnit, you would want to put this call into the `tearDown()` method. If no predictions
363 are defined, it would do nothing. So it won't harm to call it after every test.
380 you don't need to record predictions in order to check them. You can also do it