diff options
author | Nils Adermann <naderman@naderman.de> | 2011-08-29 17:17:40 -0400 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2011-09-29 15:42:48 +0200 |
commit | c7a986eccdac183cc81b3da486092f4ab82109ba (patch) | |
tree | 6a0d855eda1a083fb94d09b0d60bce530805c868 /tests/extension | |
parent | 897063d3e269a7c11ef6d6602abc37ec30266a72 (diff) | |
download | forums-c7a986eccdac183cc81b3da486092f4ab82109ba.tar forums-c7a986eccdac183cc81b3da486092f4ab82109ba.tar.gz forums-c7a986eccdac183cc81b3da486092f4ab82109ba.tar.bz2 forums-c7a986eccdac183cc81b3da486092f4ab82109ba.tar.xz forums-c7a986eccdac183cc81b3da486092f4ab82109ba.zip |
[feature/extension-manager] Use an incremental process for enable and purge
The enable or purge operation of an extension could take a long time if an
expensive operation needs to be executed on a large set of data. To allow
this to succeed from a web interface with max_execution_time set in the
webserver's php configuration, subsequent requests must continue the
operation started earlier. So individual enable and purge implementations
must be able to spread their work across multiple steps.
PHPBB3-10323
Diffstat (limited to 'tests/extension')
-rw-r--r-- | tests/extension/manager_test.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index 2035264559..70c3543a69 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -8,6 +8,8 @@ */ require_once dirname(__FILE__) . '/../mock/cache.php'; +require_once dirname(__FILE__) . '/ext/bar/bar.php'; +require_once dirname(__FILE__) . '/ext/moo/moo.php'; class phpbb_extension_manager_test extends phpbb_database_test_case { @@ -49,10 +51,14 @@ class phpbb_extension_manager_test extends phpbb_database_test_case public function test_enable() { + phpbb_ext_bar::$state = 0; + $this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled())); $this->extension_manager->enable('bar'); $this->assertEquals(array('bar', 'foo'), array_keys($this->extension_manager->all_enabled())); $this->assertEquals(array('bar', 'foo', 'moo'), array_keys($this->extension_manager->all_configured())); + + $this->assertEquals(4, phpbb_ext_bar::$state); } public function test_disable() @@ -65,10 +71,14 @@ class phpbb_extension_manager_test extends phpbb_database_test_case public function test_purge() { + phpbb_ext_moo::$purged = false; + $this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled())); $this->assertEquals(array('foo', 'moo'), array_keys($this->extension_manager->all_configured())); $this->extension_manager->purge('moo'); $this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled())); $this->assertEquals(array('foo'), array_keys($this->extension_manager->all_configured())); + + $this->assertTrue(phpbb_ext_moo::$purged); } } |