-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw exception when handler method is missing
- Loading branch information
Showing
3 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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
33 changes: 33 additions & 0 deletions
33
tests/Tactician/Tests/Fixtures/Handler/DynamicMethodsHandler.php
This file contains 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
namespace Tactician\Tests\Fixtures\Handler; | ||
|
||
/** | ||
* Some folks prefer to rely on __call to proxy the incoming commands to | ||
* methods, rather than do the routing externally. This test spy can be used to | ||
* verify this works correctly. | ||
*/ | ||
class DynamicMethodsHandler | ||
{ | ||
/** | ||
* @var string[] | ||
*/ | ||
private $methods = []; | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getMethodsInvoked() | ||
{ | ||
return $this->methods; | ||
} | ||
|
||
/** | ||
* @param string $methodName | ||
* @param array $args | ||
*/ | ||
public function __call($methodName, $args) | ||
{ | ||
$this->methods[] = $methodName; | ||
} | ||
} | ||
|