phpbb_extension_manager = $this->get_extension_manager(); $this->purge_cache(); } /** * Check an extension at ./ext/foobar/ which should have the class * phpbb_ext_foobar_controller */ public function test_foobar() { $this->phpbb_extension_manager->enable('foobar'); $crawler = $this->request('GET', 'index.php?ext=foobar'); $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text()); $this->phpbb_extension_manager->purge('foobar'); } /** * Check an extension at ./ext/foo/bar/ which should have the class * phpbb_ext_foo_bar_controller */ public function test_foo_bar() { $this->phpbb_extension_manager->enable('foo/bar'); $crawler = $this->request('GET', 'index.php?ext=foo/bar'); $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } /** * Check the error produced by extension at ./ext/error/class which has class * phpbb_ext_foobar_controller */ public function test_error_class_name() { $this->phpbb_extension_manager->enable('error/class'); $crawler = $this->request('GET', 'index.php?ext=error/class'); $this->assertContains("The extension error/class is missing a controller class and cannot be accessed through the front-end.", $crawler->filter('#message')->text()); $this->phpbb_extension_manager->purge('error/class'); } /** * Check the error produced by extension at ./ext/error/classtype which has class * phpbb_ext_error_classtype_controller but does not implement phpbb_extension_controller_interface */ public function test_error_class_type() { $this->phpbb_extension_manager->enable('error/classtype'); $crawler = $this->request('GET', 'index.php?ext=error/classtype'); $this->assertContains("The extension controller class phpbb_ext_error_classtype_controller is not an instance of the phpbb_extension_controller_interface.", $crawler->filter('#message')->text()); $this->phpbb_extension_manager->purge('error/classtype'); } /** * Check the error produced by extension at ./ext/error/disabled that is (obviously) * a disabled extension */ public function test_error_ext_disabled() { $crawler = $this->request('GET', 'index.php?ext=error/disabled'); $this->assertContains("The extension error/disabled is not enabled", $crawler->filter('#message')->text()); } /** * Check the error produced by extension at ./ext/error/404 that is (obviously) * not existant */ public function test_error_ext_missing() { $crawler = $this->request('GET', 'index.php?ext=error/404'); $this->assertContains("The extension error/404 does not exist.", $crawler->filter('#message')->text()); } }