Download the PHP package pamil/prophecy-common without Composer
On this page you can find all versions of the php package pamil/prophecy-common. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pamil/prophecy-common
More information about pamil/prophecy-common
Files in pamil/prophecy-common
Package prophecy-common
Short Description Common helper classes for Prophecy
License MIT
Informations about the package prophecy-common
Prophecy Common
Bunch of useful classes to solve some issues I've encountered while using PhpSpec. MIT licensed.
CompositePromise
Allows the same method to throw different exceptions, return and throw exceptions at the same time and limit calls without
using shouldBeCalledTimes()
.
Differences
-
CompositePromise::willReturn()
andCompositePromise::andThenReturn()
behave the same asMethodProphecy::willReturn()
(in PhpSpec:$collabolator->callMethod()->willReturn()
) -
CompositePromise::willThrow()
andCompositePromiser::andThenThrow()
behave the same asMethodProphecy::willThrow()
(in PhpSpec:$collabolator->callMethod()->willThrow()
), but they can receive more than one argument, e.g.CompositePromise::willThrow(\FirstException::class)->andThenThrow(\SecondException::class)
is equal toCompositePromise::willThrow(\FirstException::class, \SecondException::class)
CompositePromise::will()
andCompositePromise::andThen()
behave the same asMethodProphecy::will()
, but they can receive more than one argument just as the previous methods