extension_manager = new phpbb_mock_extension_manager( dirname(__FILE__) . '/', array( 'foo' => array( 'ext_name' => 'foo', 'ext_active' => '1', 'ext_path' => 'ext/foo/', ), )); } public function test_provider() { $provider = new \phpbb\controller\provider; $routes = $provider ->import_paths_from_finder($this->extension_manager->get_finder()) ->find(__DIR__); // This will need to be updated if any new routes are defined $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('core_controller')); $this->assertEquals('/core_foo', $routes->get('core_controller')->getPath()); $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('controller1')); $this->assertEquals('/foo', $routes->get('controller1')->getPath()); $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('controller2')); $this->assertEquals('/foo/bar', $routes->get('controller2')->getPath()); } public function test_controller_resolver() { $container = new ContainerBuilder(); // YamlFileLoader only uses one path at a time, so we need to loop // through all of the ones we are using. foreach (array(__DIR__.'/config', __DIR__.'/ext/foo/config') as $path) { $loader = new YamlFileLoader($container, new FileLocator($path)); $loader->load('services.yml'); } // Autoloading classes within the tests folder does not work // so I'll include them manually. if (!class_exists('foo\\controller')) { include(__DIR__.'/ext/foo/controller.php'); } if (!class_exists('phpbb\\controller\\foo')) { include(__DIR__.'/phpbb/controller/foo.php'); } $resolver = new \phpbb\controller\resolver(new \phpbb\user, $container); $symfony_request = new Request(); $symfony_request->attributes->set('_controller', 'foo.controller:handle'); $this->assertEquals($resolver->getController($symfony_request), array(new foo\controller, 'handle')); $symfony_request = new Request(); $symfony_request->attributes->set('_controller', 'core_foo.controller:bar'); $this->assertEquals($resolver->getController($symfony_request), array(new phpbb\controller\foo, 'bar')); } } Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Samir <ahmad@mageia.org>2011-04-04 22:08:51 +0000
committerAhmad Samir <ahmad@mageia.org>2011-04-04 22:08:51 +0000
commit0b067ac321acf0f3c518d820928f283a23bed8a0 (patch)
treef6f9e143aa2929aa77eb88f0bb86d13c3da72ba9
parent489e616a8f0a2410c6b83a6cc8fe061d9ac5c833 (diff)
downloaddrakx-0b067ac321acf0f3c518d820928f283a23bed8a0.tar
drakx-0b067ac321acf0f3c518d820928f283a23bed8a0.tar.gz
drakx-0b067ac321acf0f3c518d820928f283a23bed8a0.tar.bz2
drakx-0b067ac321acf0f3c518d820928f283a23bed8a0.tar.xz
drakx-0b067ac321acf0f3c518d820928f283a23bed8a0.zip
- 's!Just select your tv card parameters!Just select your TV card parameters!'
Diffstat