-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PresenterComponentReflection::combineArgs() should retype variables i…
…n the $res array. [Fixes #99] Use foreach's automatic indexing instead of manual one.
- Loading branch information
1 parent
68db80c
commit 8e87ae8
Showing
2 changed files
with
28 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/** | ||
* Test: PresenterComponentReflection::combineArgs() | ||
*/ | ||
|
||
use Nette\Application\UI\PresenterComponentReflection; | ||
use Tester\Assert; | ||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
class MyPresenter | ||
{ | ||
|
||
public function myMethod($intParam = 0, $strParam = '') | ||
{ | ||
} | ||
|
||
} | ||
|
||
$reflection = new ReflectionMethod('MyPresenter', 'myMethod'); | ||
|
||
Assert::same(array(10, 'str'), PresenterComponentReflection::combineArgs($reflection, array('intParam' => '10', 'strParam' => 'str'))); | ||
Assert::same(array(0, ''), PresenterComponentReflection::combineArgs($reflection, array())); |