diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-06-27 16:53:14 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-06-27 16:53:14 +0200 |
commit | e6b8ae6bd5eb211cc61b19f09c96cf7641f8491f (patch) | |
tree | 4dc1ec8bb1fc03485d7d8950948c0f18e658d6e7 | |
parent | 8e8b493fae59aba59e1ea732c1f93d66f59fb640 (diff) | |
download | forums-e6b8ae6bd5eb211cc61b19f09c96cf7641f8491f.tar forums-e6b8ae6bd5eb211cc61b19f09c96cf7641f8491f.tar.gz forums-e6b8ae6bd5eb211cc61b19f09c96cf7641f8491f.tar.bz2 forums-e6b8ae6bd5eb211cc61b19f09c96cf7641f8491f.tar.xz forums-e6b8ae6bd5eb211cc61b19f09c96cf7641f8491f.zip |
[ticket/12777] Add tests
PHPBB3-12777
-rw-r--r-- | tests/extension/manager_test.php | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index d9f8fbd1a4..de7afdee65 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -32,22 +32,57 @@ 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')); + } + + 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')); + } + + 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')); + } + + 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')); + } + + 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')); + } + public function test_enable() { vendor2\bar\ext::$state = 0; |