This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/zendframework/zendframework#6083-hydrator-number…
…-of-parameters-filter-honored' Close zendframework/zendframework#6083
- Loading branch information
Showing
2 changed files
with
56 additions
and
6 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,54 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace ZendTest\Stdlib\Hydrator\Filter; | ||
|
||
use Zend\Stdlib\Hydrator\Filter\NumberOfParameterFilter; | ||
|
||
/** | ||
* Unit tests for {@see \Zend\Stdlib\Hydrator\Filter\NumberOfParameterFilter} | ||
* | ||
* @covers \Zend\Stdlib\Hydrator\Filter\NumberOfParameterFilter | ||
*/ | ||
class NumberOfParameterFilterTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @group 6083 | ||
*/ | ||
public function testArityZero() | ||
{ | ||
$filter = new NumberOfParameterFilter(); | ||
$this->assertTrue($filter->filter(__CLASS__ . '::methodWithNoParameters')); | ||
$this->assertFalse($filter->filter(__CLASS__ . '::methodWithOptionalParameters')); | ||
} | ||
|
||
/** | ||
* @group 6083 | ||
*/ | ||
public function testArityOne() | ||
{ | ||
$filter = new NumberOfParameterFilter(1); | ||
$this->assertFalse($filter->filter(__CLASS__ . '::methodWithNoParameters')); | ||
$this->assertTrue($filter->filter(__CLASS__ . '::methodWithOptionalParameters')); | ||
} | ||
|
||
/** | ||
* Test asset method | ||
*/ | ||
public function methodWithOptionalParameters($parameter = 'foo') | ||
{ | ||
} | ||
|
||
/** | ||
* Test asset method | ||
*/ | ||
public function methodWithNoParameters() | ||
{ | ||
} | ||
} |