aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/extension_controller_test.php
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-03-18 16:50:41 -0400
committerDavid King <imkingdavid@gmail.com>2012-03-19 09:12:34 -0400
commit76e61951942048e3e98dbe60a3683d5269a4fa0e (patch)
tree1ba70d747f612d8716b76b4578ee1ad7ec693171 /tests/functional/extension_controller_test.php
parent7d1e4bca334dc9fcef3eb6e62cb412226ebc7ca4 (diff)
downloadforums-76e61951942048e3e98dbe60a3683d5269a4fa0e.tar
forums-76e61951942048e3e98dbe60a3683d5269a4fa0e.tar.gz
forums-76e61951942048e3e98dbe60a3683d5269a4fa0e.tar.bz2
forums-76e61951942048e3e98dbe60a3683d5269a4fa0e.tar.xz
forums-76e61951942048e3e98dbe60a3683d5269a4fa0e.zip
[ticket/10586] trying to get tests to work
PHPBB3-10586
Diffstat (limited to 'tests/functional/extension_controller_test.php')
-rw-r--r--tests/functional/extension_controller_test.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
index 46f3dc6f96..4123853151 100644
--- a/tests/functional/extension_controller_test.php
+++ b/tests/functional/extension_controller_test.php
@@ -12,6 +12,7 @@
*/
class phpbb_functional_extension_controller_test extends phpbb_functional_test_case
{
+ protected $phpbb_extension_manager;
/**
* This should only be called once before the tests are run.
* This is used to copy the fixtures to the phpBB install
@@ -76,17 +77,23 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
// and port it into here instead of writing it from scratch
}
+ public function setUp()
+ {
+ parent::setUp();
+ $this->phpbb_extension_manager = !($this->phpbb_extension_manager instanceof phpbb_extension_manager) ? $this->get_ext_manager() : $this->phpbb_extension_manager;
+ $this->cache->purge('_ext');
+ }
+
/**
* Check an extension at ./ext/foobar/ which should have the class
* phpbb_ext_foobar_controller
*/
public function test_foobar()
{
- $phpbb_extension_manager = $this->get_ext_manager();
- $phpbb_extension_manager->enable('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());
- $phpbb_extension_manager->purge('foobar');
+ $this->phpbb_extension_manager->purge('foobar');
}
/**
@@ -95,11 +102,10 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
*/
public function test_foo_bar()
{
- $phpbb_extension_manager = $this->get_ext_manager();
- $phpbb_extension_manager->enable('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());
- $phpbb_extension_manager->purge('foo/bar');
+ $this->phpbb_extension_manager->purge('foo/bar');
}
/**
@@ -108,11 +114,10 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
*/
public function test_error_class_name()
{
- $phpbb_extension_manager = $this->get_ext_manager();
- $phpbb_extension_manager->enable('error/class');
+ $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());
- $phpbb_extension_manager->purge('error/class');
+ $this->phpbb_extension_manager->purge('error/class');
}
/**
@@ -121,11 +126,10 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
*/
public function test_error_class_type()
{
- $phpbb_extension_manager = $this->get_ext_manager();
- $phpbb_extension_manager->enable('error/classtype');
+ $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());
- $phpbb_extension_manager->purge('error/classtype');
+ $this->phpbb_extension_manager->purge('error/classtype');
}
/**