forked from zendframework/zendframework
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests on the module loader helper
- Loading branch information
1 parent
ff400af
commit 8b63488
Showing
1 changed file
with
54 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
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-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
namespace ZendTest\Test\PHPUnit\Util; | ||
|
||
use Zend\Test\PHPUnit\Util\ModuleLoader; | ||
|
||
class ModuleLoaderTest extends ModuleLoader | ||
{ | ||
public function testCanLoadModule() | ||
{ | ||
require_once __DIR__ . '/../../_files/Baz/Module.php'; | ||
|
||
$this->loadModule('Baz'); | ||
|
||
$baz = $this->getModule('Baz'); | ||
$this->assertTrue($baz instanceof \Baz\Module); | ||
} | ||
|
||
public function testCanLoadModuleWithPath() | ||
{ | ||
$this->loadModule(array('Baz' => __DIR__ . '/../../_files/Baz')); | ||
} | ||
|
||
public function testCanLoadModules() | ||
{ | ||
require_once __DIR__ . '/../../_files/Baz/Module.php'; | ||
require_once __DIR__ . '/../../_files/modules-path/with-subdir/Foo/Module.php'; | ||
|
||
$this->loadModules(array('Baz', 'Foo')); | ||
} | ||
|
||
public function testCanLoadModulesWithPath() | ||
{ | ||
$this->loadModules(array( | ||
'Baz' => __DIR__ . '/../../_files/Baz', | ||
'Foo' => __DIR__ . '/../../_files/modules-path/with-subdir/Foo', | ||
)); | ||
|
||
$fooObject = $this->getServiceManager()->get('FooObject'); | ||
$this->assertTrue($fooObject instanceof \stdClass); | ||
} | ||
|
||
public function testCanLoadModulesFromConfig() | ||
{ | ||
$config = include __DIR__ . '/../../_files/application.config.php'; | ||
$this->loadModulesFromConfig($config); | ||
} | ||
} |