-
Notifications
You must be signed in to change notification settings - Fork 134
Update codebase to PHP 7.4 #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update docs
- Loading branch information
commit 5f45fc6fc56b0fa3409f370d53411447a879ecda
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,24 +10,22 @@ ClassProxy represents a class of your project. | |
| * It can be used to check class definitions. | ||
|
|
||
|
|
||
| ``` php | ||
| ```php | ||
| <?php | ||
| $userModel = test::double('UserModel'); | ||
| UserModel::tableName(); | ||
| $user = $userModel->construct(); | ||
| $user->save(); | ||
| $userModel->verifyInvoked('tableName'); | ||
| $userModel->verifyInvoked('save'); | ||
| ?> | ||
| ``` | ||
|
|
||
| You can get a class name of a proxy via `className` property. | ||
|
|
||
| ``` php | ||
| ```php | ||
| <?php | ||
| $userModel = test::double('UserModel'); | ||
| $userModel->className; // UserModel | ||
| ?> | ||
| ``` | ||
|
|
||
| Also, you can get the list of calls for a specific method. | ||
|
|
@@ -37,65 +35,50 @@ Also, you can get the list of calls for a specific method. | |
| $user = test::double('UserModel'); | ||
| $user->someMethod('arg1', 'arg2'); | ||
| $user->getCallsForMethod('someMethod') // [ ['arg1', 'arg2'] ] | ||
| ?> | ||
| ``` | ||
|
|
||
| #### *public* getCallsForMethod($method) | ||
| #### *public* isDefined() | ||
| Returns true if class exists. | ||
| Returns false if class is not defined yet, and was declared via `test::spec`. | ||
|
|
||
| * return bool | ||
|
|
||
| #### *public* interfaces() | ||
| Returns an array with all interface names of a class | ||
|
|
||
| * return array | ||
|
|
||
| #### *public* parent() | ||
| Returns a name of the parent of a class. | ||
|
|
||
| * return null | ||
|
|
||
| #### *public* hasMethod($method) | ||
| * `param` $method | ||
| * return bool | ||
| * `param mixed` $method | ||
|
|
||
| #### *public* hasProperty($property) | ||
| * `param` $property | ||
| * return bool | ||
| * `param mixed` $property | ||
|
|
||
| #### *public* traits() | ||
| Returns array of all trait names of a class. | ||
|
|
||
| * return array | ||
|
|
||
| #### *public* construct() | ||
| Creates an instance of a class via constructor. | ||
|
|
||
| ``` php | ||
| ```php | ||
| <? | ||
| $user = test::double('User')->construct([ | ||
| 'name' => 'davert', | ||
| 'email' => '[email protected]' | ||
| ]); | ||
|
|
||
| ?> | ||
| ``` | ||
| * return object | ||
|
|
||
| #### *public* make() | ||
| Creates a class instance without calling a constructor. | ||
|
|
||
| ``` php | ||
| ```php | ||
| <? | ||
| $user = test::double('User')->make(); | ||
|
|
||
| ?> | ||
| ``` | ||
| * return object | ||
|
|
||
| #### *public* verifyInvoked($name, $params = null) | ||
| #### *public* verifyInvoked($name, array $params = null) | ||
| Verifies a method was invoked at least once. | ||
| In second argument you can specify with which params method expected to be invoked; | ||
|
|
||
|
|
@@ -104,38 +87,24 @@ In second argument you can specify with which params method expected to be invok | |
| $user->verifyInvoked('save'); | ||
| $user->verifyInvoked('setName',['davert']); | ||
|
|
||
| ?> | ||
| ``` | ||
|
|
||
| * `param` $name | ||
| * `param null` $params | ||
| * throws \PHPUnit_Framework_ExpectationFailedException | ||
| * `param array` $params | ||
| * throws fail | ||
|
|
||
| #### *public* verifyInvokedOnce($name, $params = null) | ||
| #### *public* verifyInvokedOnce($name, array $params = null) | ||
| Verifies that method was invoked only once. | ||
|
|
||
| * `param` $name | ||
| * `param array` $params | ||
|
|
||
| #### *public* verifyInvokedMultipleTimes($name, $times, $params = null) | ||
| #### *public* verifyInvokedMultipleTimes($name, $times, array $params = null) | ||
| Verifies that method was called exactly $times times. | ||
|
|
||
| ``` php | ||
| <?php | ||
| $user->verifyInvokedMultipleTimes('save',2); | ||
| $user->verifyInvokedMultipleTimes('dispatchEvent',3,['before_validate']); | ||
| $user->verifyInvokedMultipleTimes('dispatchEvent',4,['after_save']); | ||
| ?> | ||
| ``` | ||
|
|
||
| * `param` $name | ||
| * `param` $times | ||
| * `param array` $params | ||
| * throws \PHPUnit_Framework_ExpectationFailedException | ||
| * throws ExpectationFailedException | ||
|
|
||
| #### *public* verifyNeverInvoked($name, $params = null) | ||
| #### *public* verifyNeverInvoked($name, array $params = null) | ||
| Verifies that method was not called. | ||
| In second argument with which arguments is not expected to be called. | ||
|
|
||
|
|
@@ -146,11 +115,8 @@ $user->verifyNeverInvoked('setName'); // fail | |
| $user->verifyNeverInvoked('setName',['davert']); // fail | ||
| $user->verifyNeverInvoked('setName',['bob']); // success | ||
| $user->verifyNeverInvoked('setName',[]); // success | ||
| ?> | ||
| ``` | ||
|
|
||
| * `param` $name | ||
| * `param null` $params | ||
| * throws \PHPUnit_Framework_ExpectationFailedException | ||
| * throws ExpectationFailedException | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.