aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-27 20:39:02 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-27 20:39:02 +0100
commitea6bf00977a44d437806e87e9cac1b9d5fcef238 (patch)
tree2520cfb0142ac59953ad0f10ca798030a606d1c6
parentc9338b38b35675bd1d620e4a8ca7d44a522faace (diff)
downloadforums-ea6bf00977a44d437806e87e9cac1b9d5fcef238.tar
forums-ea6bf00977a44d437806e87e9cac1b9d5fcef238.tar.gz
forums-ea6bf00977a44d437806e87e9cac1b9d5fcef238.tar.bz2
forums-ea6bf00977a44d437806e87e9cac1b9d5fcef238.tar.xz
forums-ea6bf00977a44d437806e87e9cac1b9d5fcef238.zip
[feature/avatars] Improve testing to also check for enabled drivers
PHPBB3-10018
-rw-r--r--tests/avatar/manager_test.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
index cae72c982b..b910db59ee 100644
--- a/tests/avatar/manager_test.php
+++ b/tests/avatar/manager_test.php
@@ -31,6 +31,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
->method('get_name')
->will($this->returnValue('avatar.driver.foobar'));
$avatar_drivers = array($this->avatar_foobar);
+ $config['allow_avatar_' . get_class($this->avatar_foobar)] = true;
// Set up avatar manager
$this->manager = new phpbb_avatar_manager($config, $avatar_drivers, $this->phpbb_container);
@@ -45,14 +46,24 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
$this->assertNull($driver);
$driver = $this->manager->get_driver('avatar.driver.foobar');
+ $this->assertEquals('avatar.driver.foobar', $driver);
+
+ $driver = $this->manager->get_driver('avatar.driver.foo_wrong');
$this->assertNull($driver);
}
- public function test_get_valid_drivers()
+ public function test_get_all_drivers()
+ {
+ $drivers = $this->manager->get_all_drivers();
+ $this->assertArrayHasKey('avatar.driver.foobar', $drivers);
+ $this->assertEquals('avatar.driver.foobar', $drivers['avatar.driver.foobar']);
+ }
+
+ public function test_get_enabled_drivers()
{
- $valid_drivers = $this->manager->get_all_drivers();
- $this->assertArrayHasKey('avatar.driver.foobar', $valid_drivers);
- $this->assertEquals('avatar.driver.foobar', $valid_drivers['avatar.driver.foobar']);
+ $drivers = $this->manager->get_enabled_drivers();
+ $this->assertArrayHasKey('avatar.driver.foobar', $drivers);
+ $this->assertEquals('avatar.driver.foobar', $drivers['avatar.driver.foobar']);
}
public function test_get_avatar_settings()