mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
[ticket/12777] Add tests
PHPBB3-12777
This commit is contained in:
parent
8e8b493fae
commit
e6b8ae6bd5
1 changed files with 38 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue