aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension/manager_test.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-06-29 23:33:47 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-06-29 23:33:47 +0200
commit5652f33ccca36b093a20033f17cb42ec79a581da (patch)
tree90f7bae5fae10cc031b84ad6071776cfd9cb1cac /tests/extension/manager_test.php
parent404c2f11448f53e55eca4cfdf082671230711241 (diff)
parentdaeb635d6c27d94fe2f7135ab4d921da5d870447 (diff)
downloadforums-5652f33ccca36b093a20033f17cb42ec79a581da.tar
forums-5652f33ccca36b093a20033f17cb42ec79a581da.tar.gz
forums-5652f33ccca36b093a20033f17cb42ec79a581da.tar.bz2
forums-5652f33ccca36b093a20033f17cb42ec79a581da.tar.xz
forums-5652f33ccca36b093a20033f17cb42ec79a581da.zip
Merge pull request #2669 from Nicofuma/ticket/12777
[ticket/12777] Rename extension status functions and add is_configured() * Nicofuma/ticket/12777: [ticket/12777] Add tests for unavailable extension [ticket/12777] Add tests [ticket/12777] Add is_purged() [ticket/12777] Update doc block of is_configured() [ticket/12777] Rename extension status functions and add is_configured()
Diffstat (limited to 'tests/extension/manager_test.php')
-rw-r--r--tests/extension/manager_test.php46
1 files changed, 43 insertions, 3 deletions
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index d9f8fbd1a4..230c90c7c7 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -32,22 +32,62 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$this->extension_manager = $this->create_extension_manager();
}
- public function test_available()
+ public function test_all_available()
{
// barfoo and vendor3/bar should not listed due to missing composer.json. barfoo also has incorrect dir structure.
$this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo'), array_keys($this->extension_manager->all_available()));
}
- public function test_enabled()
+ public function test_all_enabled()
{
$this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
}
- public function test_configured()
+ public function test_all_configured()
{
$this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
}
+ public function test_is_enabled()
+ {
+ $this->assertSame(true, $this->extension_manager->is_enabled('vendor2/foo'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('bertie/worlddominationplan'));
+ }
+
+ public function test_is_disabled()
+ {
+ $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_disabled('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_disabled('bertie/worlddominationplan'));
+ }
+
+ public function test_is_purged()
+ {
+ $this->assertSame(false, $this->extension_manager->is_purged('vendor2/foo'));
+ $this->assertSame(false, $this->extension_manager->is_purged('vendor/moo'));
+ $this->assertSame(true, $this->extension_manager->is_purged('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_purged('bertie/worlddominationplan'));
+ }
+
+ public function test_is_configured()
+ {
+ $this->assertSame(true, $this->extension_manager->is_configured('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_configured('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_configured('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_configured('bertie/worlddominationplan'));
+ }
+
+ public function test_is_available()
+ {
+ $this->assertSame(true, $this->extension_manager->is_available('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_available('vendor/moo'));
+ $this->assertSame(true, $this->extension_manager->is_available('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_available('bertie/worlddominationplan'));
+ }
+
public function test_enable()
{
vendor2\bar\ext::$state = 0;