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 61
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/navigation-plugin-manager'
Close #47 Fixes #46 Fixes #45 Fixes zendframework/zend-navigation#19
- Loading branch information
Showing
6 changed files
with
134 additions
and
17 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
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,68 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace ZendTest\View\Helper\Navigation; | ||
|
||
use Zend\ServiceManager\Config; | ||
use Zend\ServiceManager\ServiceManager; | ||
use Zend\ServiceManager\Test\CommonPluginManagerTrait; | ||
use Zend\View\Exception\InvalidHelperException; | ||
use Zend\View\Helper\Navigation\AbstractHelper; | ||
use Zend\View\Helper\Navigation\PluginManager; | ||
|
||
/** | ||
* @group Zend_View | ||
*/ | ||
class PluginManagerCompatibilityTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
use CommonPluginManagerTrait; | ||
|
||
protected function getPluginManager() | ||
{ | ||
return new PluginManager(new ServiceManager()); | ||
} | ||
|
||
protected function getV2InvalidPluginException() | ||
{ | ||
return InvalidHelperException::class; | ||
} | ||
|
||
protected function getInstanceOf() | ||
{ | ||
return AbstractHelper::class; | ||
} | ||
|
||
/** | ||
* @group 43 | ||
*/ | ||
public function testConstructorArgumentsAreOptionalUnderV2() | ||
{ | ||
$helpers = $this->getPluginManager(); | ||
if (method_exists($helpers, 'configure')) { | ||
$this->markTestSkipped('zend-servicemanager v3 plugin managers require a container argument'); | ||
} | ||
|
||
$helpers = new PluginManager(); | ||
$this->assertInstanceOf(PluginManager::class, $helpers); | ||
} | ||
|
||
/** | ||
* @group 43 | ||
*/ | ||
public function testConstructorAllowsConfigInstanceAsFirstArgumentUnderV2() | ||
{ | ||
$helpers = $this->getPluginManager(); | ||
if (method_exists($helpers, 'configure')) { | ||
$this->markTestSkipped('zend-servicemanager v3 plugin managers require a container argument'); | ||
} | ||
|
||
$helpers = new PluginManager(new Config([])); | ||
$this->assertInstanceOf(PluginManager::class, $helpers); | ||
} | ||
} |
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