diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-06-25 11:35:04 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-06-25 11:35:04 +0200 |
commit | 72377075f465119241026728874e35791bbd1f0a (patch) | |
tree | db4666adaa452ced98294470181915e6f8003767 /tests | |
parent | 25acf3f74cd5ea42dbdf23f5743feb17014c22a0 (diff) | |
download | forums-72377075f465119241026728874e35791bbd1f0a.tar forums-72377075f465119241026728874e35791bbd1f0a.tar.gz forums-72377075f465119241026728874e35791bbd1f0a.tar.bz2 forums-72377075f465119241026728874e35791bbd1f0a.tar.xz forums-72377075f465119241026728874e35791bbd1f0a.zip |
[ticket/11600] Use local variable for $user in test_localize_errors
PHPBB3-11600
Diffstat (limited to 'tests')
-rw-r--r-- | tests/avatar/manager_test.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 58cad06c5d..4d332e6b0d 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -11,8 +11,6 @@ require_once dirname(__FILE__) . '/driver/foobar.php'; class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase { - protected $user; - public function setUp() { global $phpbb_root_path, $phpEx; @@ -230,23 +228,23 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase public function test_localize_errors() { - $this->user = $this->getMock('phpbb_user'); + $user = $this->getMock('phpbb_user'); $lang_array = array( array('FOOBAR_OFF', 'foobar_off'), array('FOOBAR_EXPLAIN', 'FOOBAR_EXPLAIN %s'), ); - $this->user->expects($this->any()) + $user->expects($this->any()) ->method('lang') ->will($this->returnValueMap($lang_array)); // Pass error as string - $this->assertEquals(array('foobar_off'), $this->manager->localize_errors($this->user, array('FOOBAR_OFF'))); + $this->assertEquals(array('foobar_off'), $this->manager->localize_errors($user, array('FOOBAR_OFF'))); // Pass error as array for vsprintf() - $this->assertEquals(array('FOOBAR_EXPLAIN foo'), $this->manager->localize_errors($this->user, array(array('FOOBAR_EXPLAIN', 'foo')))); + $this->assertEquals(array('FOOBAR_EXPLAIN foo'), $this->manager->localize_errors($user, array(array('FOOBAR_EXPLAIN', 'foo')))); // Pass both types - $this->assertEquals(array('foobar_off', 'FOOBAR_EXPLAIN foo'), $this->manager->localize_errors($this->user, array( + $this->assertEquals(array('foobar_off', 'FOOBAR_EXPLAIN foo'), $this->manager->localize_errors($user, array( 'FOOBAR_OFF', array('FOOBAR_EXPLAIN', 'foo'), ))); |