Package Data | |
---|---|
Maintainer Username: | FractalizeR |
Package Create Date: | 2015-03-28 |
Package Last Update: | 2018-12-16 |
Language: | PHP |
License: | GPL-2.0 |
Last Refreshed: | 2024-11-23 03:25:22 |
Package Statistics | |
---|---|
Total Downloads: | 490 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 6 |
Total Forks: | 0 |
Total Open Issues: | 1 |
Metrics | _ ---|--- Version | Compatibility | Quality |
This small library contains some helpers for phpUnit.
TestBase class contains the following features:
$appContract
property$bootstrapPath
propertyBase test class allows you to use automatically configuring traits. It works in the following way:
When test setUp method is called, traits are initialized first. If a trait has any special methods, they are called at
the appropriate time. Suppose your test uses trait named HiddenMembersTestTrait
. Then the following trait methods
will be called on the test class instance:
beforeAppHiddenMembersTestTrait()
- before Laravel application is createdafterAppHiddenMembersTestTrait(Application $app)
- right after Laravel application is created, but before leaving
phpUnit setUp()
methodWARNING: Testing an object's protected or private properties / methods is generally a bad idea. Use with caution.
If you need to test private or protected test members of your class, you can use HiddenMembersTestTrait in your test classes. It adds the following methods:
assertMembersEqual
. This method accepts an object and an associative array of object's expected property values
and tests if all of the given expected property values equal to those of the objectassertMembersSame
. This is variant of the above, which tests for sameness instead of equalitygetObjectProperties
. Just returns an array of object's requested properties with their values
(disregarding visibility)getMethodCallResult
. Returns a result of the method call (disregarding visibility)