Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phony Laravel Package

eloquent/phony

View on GitHub
Deep Wiki
Context7
5.0.2
  • [FIXED] An exception is no longer thrown under non-CLI SAPIs when detecting ANSI color support (#252 - thanks [@yanneg]).
5.0.1
  • [FIXED] Functions and methods with "unavailable" default values no longer cause exceptions to be thrown when attempting to determine the default value.
5.0.0
  • [BC BREAK] PHP 7.2 is no longer supported.
  • [NEW] Added support for PHP 8 union types (#250).
  • [NEW] Added support for PHP 8 false types (#250).
  • [NEW] Added support for PHP 8 mixed types (#250).
  • [NEW] Added support for PHP 8 static return types (#250).
  • [NEW] Added support for parent types (#250).

Known issues

  • PHP 8 named arguments are not supported.
  • No guarantees are made about which specific value will be returned from a stub (or mock method) with a union return type, when no explicit return value is specified. The value may differ depending on the order in which the union type's members appear.
4.0.1
  • [FIXED] Nullable variadics can now be mocked (#248 - thanks [@keksa]).
4.0.0
  • [BC BREAK] PHP 7.1 is no longer supported.
  • [NEW] Added support for specifying ad hoc mock property types (#247).
  • [IMPROVED] Improved exporter output for array references (#244).
  • [IMPROVED] Improved exporter output for weak references (#245).
  • [IMPROVED] Improved type hints and type declarations for better integration with PHPStan.
3.2.0
  • [IMPROVED] Compatibility with the current PHP 7.4 release candidate (#246).
3.1.0
  • [IMPROVED] Support for PHP 7.3 features (#239).
3.0.1
  • [FIXED] Fixed a bug where creating handles for uncallable methods with final class return types would throw exceptions (#237 - thanks [@pmall]).
3.0.0

See the migration guide for detailed upgrade information.

  • [BC BREAK] PHP 7.0 is no longer supported (#233).
  • [BC BREAK] An explicit argument is now required in setUseColor().
  • [BC BREAK] The handle->clazz() method was renamed to handle->class().
2.0.1
2.0.0

See the migration guide for detailed upgrade information.

  • [BC BREAK] PHP 5 is no longer supported ([#216]).
  • [BC BREAK] HHVM is no longer supported ([#216], #219).
  • [BC BREAK] Removed inOrderSequence, checkInOrderSequence, anyOrderSequence, and checkAnyOrderSequence from the facade (#215).
  • [BC BREAK] Stubs created outside of a mock now have their "self" value set to the stub itself, instead of the stubbed callback (#226).
  • [NEW] Implemented anInstanceOf() (#220).
  • [NEW] Implemented emptyValue() (#218).
  • [IMPROVED] Support for PHP 7.2 features, including the object typehint (#224).
  • [IMPROVED] Improved the error message produced when a default return value cannot be produced, because the return type is a final class (#228).
  • [IMPROVED] Reduced the amount of output generated when mocks, stubs, and spies are encountered by var_dump() (#223).
1.0.1
  • [FIXED] Matcher verification no longer uses deprecated each() function.
1.0.0
  • [BC BREAK] Third-party test framework integrations have been moved to separate Composer packages (#216).
  • [BC BREAK] Dropped support for Counterpart, Mockery, Phake, and Prophecy matchers (#216).

Migrating to 1.x

No code changes should be required, but in some cases, the Composer package name and version constraint will need to be updated:

  • If you're using Phony under PHPUnit:
    • Change the Composer package from eloquent/phony to eloquent/phony-phpunit.
    • Pick the appropriate version constraint for the version of PHPUnit you intend to use. See the eloquent/phony-phpunit repository for more information.
  • If you're using Phony under Peridot:
    • If you were using eloquent/peridot-phony, change the Composer package to eloquent/phony-peridot.
    • If you were using eloquent/phony, no changes are required, but consider trying eloquent/phony-peridot for the added auto-wired mock support. See the eloquent/phony-peridot repository for more information.
  • If you're using Phony under SimpleTest, change the Composer package from eloquent/phony to eloquent/phony-simpletest.
  • If you're using Phony under Pho, change the Composer package from eloquent/phony to eloquent/phony-pho.
  • For other frameworks, or standalone use, no changes are required.
0.14.7
  • [FIXED] The "last error" state is now cleared when using the feature detector (#209, #214).
0.14.6
  • [FIXED] Partial mocks of abstract functions with return types now work as intended (#212).
  • [FIXED] Fixed regression of [#203] and [#204].
0.14.5
  • [FIXED] Mock handle substitution fixed for threw() and receivedException() verifications (#211).
  • [IMPROVED] Inline exporter now uses tilde (~) to indicate truncated content (#210).
  • [IMPROVED] Refactored the feature detector.
0.14.4
  • [FIXED] Fixed mocking of classes with self return type (#208).
0.14.3
  • [FIXED] Suppress posix_isatty warnings that occur when PHPUnit process isolation is in use (#207 - thanks [@keksa]).
0.14.2
  • [FIXED] Fixed nullable return type support for newer PHP 7.1 release candidates (#206).
0.14.1
  • [FIXED] Checking for nullable type support no longer causes fatal errors under HHVM (#203, #204 - thanks [@shadowhand]).
0.14.0
  • [BC BREAK] Removed calledOn() (#197).
  • [IMPROVED] Generator spies and iterable spies are now substituted in argument matching and verification (#193).
  • [IMPROVED] Documentation improvements (#191, #192, #198).
0.13.5
  • [IMPROVED] Support for PHP 7.1 iterable pseudo-type (#195).
  • [IMPROVED] Support for PHP 7.1 void pseudo-type (#195).
  • [IMPROVED] Support for PHP 7.1 nullable types (#195).
  • [IMPROVED] Disallow ASCII delete in symbol names, matching the change in PHP 7.1 (#195).
0.13.4
0.13.3
  • [FIXED] Verification results now return call verifiers instead of unwrapped calls (#185).
0.13.2
  • [FIXED] Fixed mocking of destructors (#183).
0.13.1
  • [IMPROVED] Improved support for mocking many problematic classes (#182).
0.13.0
  • [BC BREAK] Renamed $handle->mock() to $handle->get() (#180).
  • [BC BREAK] Removed verify() and verifyStatic() (#179).
  • [BC BREAK] Removed magic calls from mock handles. All stubbing must now use with(), and all call argument verification must now use calledWith() (#179).
  • [IMPROVED] Improved exporting of mock handles, stubs, spies, and closures (#177).
0.12.0
  • [BC BREAK] Replaced the term "traversable" with "iterable". Any function or method with "traversable" in the name has also been renamed accordingly (#164).
  • [BC BREAK] Stubs now return empty values by default, instead of forwarding (#174).
0.11.0
  • [NEW] Implemented stubGlobal() (#163).
  • [NEW] Implemented spyGlobal() (#175).
  • [IMPROVED] Traversable spies now implement ArrayAccess and Countable (#165).
0.10.2
  • [IMPROVED] Complete overhaul of verification output, with improvements to the output of all verifications (#161, #170).
  • [IMPROVED] Improved exporting of closures under HHVM (#166).
  • [FIXED] Fixed calledOn() behavior (#160).
  • [FIXED] Fixed verification output under Windows (#167).
  • [FIXED] Error reporting is now correctly restored in all cases (#168).
  • [FIXED] Fixed the recording of static magic method calls (#169).
0.9.0
  • [NEW] Implemented generator stubs (#11, #140, #144).
  • [IMPROVED] More default values for built-in return types (#138, #139).
  • [FIXED] Omitted arguments no longer pass for any() matcher (#137).
  • [FIXED] Fixed memory leak under PHP 7 (#143).
0.8.0
  • [BC BREAK] Mocking functions now accept ad hoc definitions in the $types argument, hence the $definition argument has been removed from mock(), partialMock(), and mockBuilder() (#117).
  • [BC BREAK] Mocking functions mock(), partialMock(), and mockBuilder() no longer accept the $className argument. Custom class names can still be used via named() on mock builders (#117).
  • [BC BREAK] Mocking functions mock(), partialMock(), and mockBuilder() no longer accept reflection classes or mock builders in the $types argument (#117).
  • [BC BREAK] Mock definition values can no longer be generic objects (#117).
  • [BC BREAK] Removed the $useGeneratorSpies and $useTraversableSpies argument from both spy() and stub() (#123).
  • [BC BREAK] Removed the $self and $defaultAnswerCallback arguments from stub() (#123).
  • [BC BREAK] Rewrite and rename of mock builder API methods for creating mocks (#103).
  • [BC BREAK] Renamed "proxy" to "handle" in line with documentation (#133).
  • [BC BREAK] Replaced reset() with stopRecording() and startRecording() (#99).
  • [BC BREAK] Event no longer implements event collection (#134).
  • [NEW] Mock builders can now be copied via the clone operator (#101).
  • [NEW] Implemented proxy() on mock handles (#39).
  • [IMPROVED] Made API setter style methods fluent (#98).
  • [IMPROVED] Instance handles are automatically adapted when stubbing and verifying (#126).
  • [IMPROVED] Added checks for unused stub criteria (#126).
  • [IMPROVED] Default answer callbacks are now a first-class concept for mocks (#90).
  • [IMPROVED] Stubs now return valid default values for most "in built" return type declarations (#109).
  • [IMPROVED] Verification results (event collections) now implement firstEvent() and lastEvent() (#97).
  • [IMPROVED] Requesting the return value or exception of a call that has not responded now throws an exception (#92).
  • [FIXED] Fixed bug when mocking traits with magic call methods (#127).
  • [FIXED] Mocking, and calling of return-by-reference methods no longer causes errors to be emitted (#105).
  • [FIXED] Ad hoc mocks that differ only by function body no longer result in re-use of the same mock class (#131).
0.7.0
  • [NEW] Implemented firstCall() and lastCall() (#93).
  • [IMPROVED] Support for PHP 7 engine error exceptions (#119).
  • [IMPROVED] Support for PHP 7 scalar type hints (#106 - thanks [@jmalloc]).
  • [IMPROVED] Support for PHP 7 return type declarations (#104, #108 - thanks [@jmalloc]).
  • [IMPROVED] Support for PHP 7 methods names that match tokens (#110 - thanks [@jmalloc]).
  • [IMPROVED] Partial support for PHP 7 generator returns (#111 - thanks [@jmalloc]).
  • [IMPROVED] Tidied up many interfaces and doc blocks.
0.6.4
  • [FIXED] Simplified method resolution rules. Fixes issue when mocking interfaces and traits (#112).
0.6.3
  • [FIXED] Fixed custom mocks with invocable objects as method implementations (#113).
  • [FIXED] Fixed required, but nullable parameters in function signatures (#114).
0.6.2
  • [IMPROVED] Huge additions to the documentation (#85, #88).
  • [FIXED] Fixed error with EqualToMatcher when comparing object to non-object (#100).
0.6.1
  • [IMPROVED] Mock instances labels are now compared by the equal to matcher (#91).
  • [IMPROVED] The inline exporter now outputs mock labels (#91).
0.6.0
  • [NEW] Support for stub default answer callbacks.
  • [FIXED] Fixed full mock default answer bug (#89).
0.5.2
  • [FIXED] Fixed stripping of exception xdebug message in exporter and equal to matcher (#87).
  • [DOCUMENTATION] Added documentation.
0.5.1
  • [IMPROVED] Prevent exporter and matcher from traversing into mock internals (#82).
  • [FIXED] Fixed assertion recording bug with noInteraction() (#83).
0.5.0
  • [BC BREAK] Removed fullMock(), changed mock() to create full mocks, and added partialMock() for creating partial mocks (#73).
0.4.0
  • [IMPROVED] Implemented new 'equal to' matcher (#70 - thanks [@jmalloc]).
  • [IMPROVED] Improved rendering of assertion failure messages (#71).
  • [IMPROVED] String messages now allowed by throws() (#76).
  • [FIXED] Fixed magic method mocking bug (#74).
  • [FIXED] Fixed mocking of exceptions under HHVM (#75).
  • [FIXED] Attempting to stub a final method now throws an exception (#77).
0.3.0
  • [NEW] PHP 7 support.
  • [NEW] Support for variadic functions (#64 - thanks [@jmalloc]).
  • [NEW] Implemented eventAt() and callAt() for verification results (#17).
  • [NEW] Implemented Call::argument() (#56).
  • [NEW] Implemented MockBuilder::source() for easier debugging (#45).
  • [NEW] Implemented anyOrder() (#60).
  • [IMPROVED] Vast improvements to verification failure output (#66).
  • [IMPROVED] Allow use of phonySelf parameter everywhere (#63).
  • [IMPROVED] Optimizations to the matcher driver system (#67).
  • [IMPROVED] Optimizations to the equal to matcher (#69).
  • [IMPROVED] Calls to eval() no longer use @ suppression.
0.2.1
  • [FIXED] Cardinality checks for received() now work as expected (#54).
  • [FIXED] Methods names are correctly treated as case-insensitive (#58).
  • [FIXED] Can mock an interface that extends Traversable (#59).
  • [FIXED] Calling of trait constructors (#61).
0.2.0
  • [BC BREAK] Renamed IDs to labels.
  • [NEW] Verify no interaction (#27).
  • [NEW] Manual constructor calling (#36, #46).
  • [NEW] Setters for labels (#35).
  • [NEW] Peridot integration (#50).
  • [NEW] Pho integration (#51).
  • [NEW] SimpleTest integration (#20).
  • [FIXED] Trait mocking is now working (#42, #49).
  • [FIXED] Stubbing interface bugs (#53).
  • [IMPROVED] Better assertion messages (#41).
  • [IMPROVED] Generator spies under HHVM (#29).
  • [IMPROVED] Better mock definition equality checking (#47).
  • [IMPROVED] Throw an exception when passing the wrong types to inOrder() (#52).
  • [IMPROVED] Magic 'self' parameter detection (#48).
0.10.1
  • [FIXED] Fixed magic self parameters in ad hoc mock definitions (#158).
  • [FIXED] Fixed mocking of internal classes that implement Traversable and other unimplementable interfaces directly (#159).
0.10.0
  • [BC BREAK] Removed produced(), producedAll(), received(), receivedException() and associated check verification methods in both the spy and call APIs. These methods are replaced by generator and traversable verifiers (#125).
  • [BC BREAK] Usage of setsArgument(), callsArgument(), callsArgumentWith(), and returnsArgument() can now result in exceptions when a specified argument is undefined at call time (#136).
  • [BC BREAK] Removed arguments() and argument() from all event collections, in favor of using firstCall() et al. followed by the corresponding method on the call API (#146).
  • [NEW] Implemented generator and traversable verifiers (#102, #115, #125).
  • [NEW] Implemented responded() and completed() verifications (#125).
  • [NEW] Mocks as default stub return values for arbitrary object return types (#149, #150).
  • [FIXED] Fixed exception when stubbing functions with return values (#147).
  • [FIXED] Fixed mocking of Traversable (#152).
  • [FIXED] Fixed mocking of DateTimeInterface (#153).
  • [FIXED] Fixed mocking of classes with final constructors (#154).
0.1.1
  • [IMPROVED] Performance improvements when repeatedly mocking the same types (#44).
  • [IMPROVED] Performance improvements when mocking large classes (#44).
  • [IMPROVED] Improved exception message when mocking an undefined type (#40).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views
spatie/ignition-contracts