Skip to content
This repository
Browse code

Removed remains of old Zend test folder.

  • Loading branch information...
commit 03145847f1646d956e99034418aab914dffba54c 1 parent 0cf04b3
Eric Boh authored September 13, 2012
15  tests/Zend/Loader/_files/BarModule/Module.php
... ...
@@ -1,15 +0,0 @@
1  
-<?php
2  
-/**
3  
- * Zend Framework (http://framework.zend.com/)
4  
- *
5  
- * @link      http://github.com/zendframework/zf2 for the canonical source repository
6  
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7  
- * @license   http://framework.zend.com/license/new-bsd New BSD License
8  
- * @package   Zend_Loader
9  
- */
10  
-
11  
-namespace BarModule;
12  
-
13  
-class Module
14  
-{
15  
-}
BIN  tests/Zend/Loader/_files/PharModuleMap.phar
Binary file not shown
96  tests/Zend/ModuleManager/Listener/ModuleLoaderListenerTest.php
... ...
@@ -1,96 +0,0 @@
1  
-<?php
2  
-/**
3  
- * Zend Framework (http://framework.zend.com/)
4  
- *
5  
- * @link      http://github.com/zendframework/zf2 for the canonical source repository
6  
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7  
- * @license   http://framework.zend.com/license/new-bsd New BSD License
8  
- * @package   Zend_ModuleManager
9  
- */
10  
-
11  
-namespace ZendTest\ModuleManager\Listener;
12  
-
13  
-use ArrayObject;
14  
-use InvalidArgumentException;
15  
-use PHPUnit_Framework_TestCase as TestCase;
16  
-use Zend\ModuleManager\Listener\ModuleResolverListener;
17  
-use Zend\ModuleManager\Listener\ModuleLoaderListener;
18  
-use Zend\ModuleManager\Listener\ListenerOptions;
19  
-use Zend\ModuleManager\ModuleManager;
20  
-use Zend\ModuleManager\ModuleEvent;
21  
-
22  
-class ModuleLoaderListenerTest extends TestCase
23  
-{
24  
-    public function setUp()
25  
-    {
26  
-        $this->tmpdir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'zend_module_cache_dir';
27  
-        @mkdir($this->tmpdir);
28  
-
29  
-        $this->moduleManager = new ModuleManager(array());
30  
-        $this->moduleManager->getEventManager()->attach('loadModule.resolve', new ModuleResolverListener, 1000);
31  
-    }
32  
-
33  
-    public function tearDown()
34  
-    {
35  
-        $file = glob($this->tmpdir . DIRECTORY_SEPARATOR . '*');
36  
-        @unlink($file[0]); // change this if there's ever > 1 file
37  
-        @rmdir($this->tmpdir);
38  
-    }
39  
-
40  
-    public function testModuleLoaderListenerFunctionsAsAggregateListenerEnabledCache()
41  
-    {
42  
-        $options = new ListenerOptions(array(
43  
-            'cache_dir'                => $this->tmpdir,
44  
-            'module_map_cache_enabled' => true,
45  
-            'module_map_cache_key'     => 'foo',
46  
-        ));
47  
-
48  
-        $moduleLoaderListener = new ModuleLoaderListener($options);
49  
-
50  
-        $moduleManager = $this->moduleManager;
51  
-        $this->assertEquals(1, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES)));
52  
-        $this->assertEquals(0, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES_POST)));
53  
-
54  
-        $moduleLoaderListener->attach($moduleManager->getEventManager());
55  
-        $this->assertEquals(2, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES)));
56  
-        $this->assertEquals(1, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES_POST)));
57  
-    }
58  
-
59  
-    public function testModuleLoaderListenerFunctionsAsAggregateListenerDisabledCache()
60  
-    {
61  
-        $options = new ListenerOptions(array(
62  
-            'cache_dir' => $this->tmpdir,
63  
-        ));
64  
-
65  
-        $moduleLoaderListener = new ModuleLoaderListener($options);
66  
-
67  
-        $moduleManager = $this->moduleManager;
68  
-        $this->assertEquals(1, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES)));
69  
-        $this->assertEquals(0, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES_POST)));
70  
-
71  
-        $moduleLoaderListener->attach($moduleManager->getEventManager());
72  
-        $this->assertEquals(2, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES)));
73  
-        $this->assertEquals(0, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES_POST)));
74  
-    }
75  
-
76  
-    public function testModuleLoaderListenerFunctionsAsAggregateListenerHasCache()
77  
-    {
78  
-        $options = new ListenerOptions(array(
79  
-            'cache_dir'                => $this->tmpdir,
80  
-            'module_map_cache_key'     => 'foo',
81  
-            'module_map_cache_enabled' => true,
82  
-        ));
83  
-
84  
-        file_put_contents($options->getModuleMapCacheFile(), '<?php return array();');
85  
-
86  
-        $moduleLoaderListener = new ModuleLoaderListener($options);
87  
-
88  
-        $moduleManager = $this->moduleManager;
89  
-        $this->assertEquals(1, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES)));
90  
-        $this->assertEquals(0, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES_POST)));
91  
-
92  
-        $moduleLoaderListener->attach($moduleManager->getEventManager());
93  
-        $this->assertEquals(2, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES)));
94  
-        $this->assertEquals(0, count($moduleManager->getEventManager()->getListeners(ModuleEvent::EVENT_LOAD_MODULES_POST)));
95  
-    }
96  
-}

0 notes on commit 0314584

Please sign in to comment.
Something went wrong with that request. Please try again.