aboutsummaryrefslogtreecommitdiffstats
path: root/tests/avatar/manager_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-10-26 12:42:47 -0700
committerMarc Alexander <admin@m-a-styles.de>2014-10-26 12:42:47 -0700
commitb0942fe31db36e2c53533fb67d0e62dabecb53e6 (patch)
treecf044037271a6deeed79c7e10ecf8df92be32b55 /tests/avatar/manager_test.php
parent1da1a7065086d451f61cf470777dbd69bec3ee79 (diff)
downloadforums-b0942fe31db36e2c53533fb67d0e62dabecb53e6.tar
forums-b0942fe31db36e2c53533fb67d0e62dabecb53e6.tar.gz
forums-b0942fe31db36e2c53533fb67d0e62dabecb53e6.tar.bz2
forums-b0942fe31db36e2c53533fb67d0e62dabecb53e6.tar.xz
forums-b0942fe31db36e2c53533fb67d0e62dabecb53e6.zip
[ticket/13197] Test that user's group avatar is deleted by group avatar delete
PHPBB3-13197
Diffstat (limited to 'tests/avatar/manager_test.php')
-rw-r--r--tests/avatar/manager_test.php56
1 files changed, 45 insertions, 11 deletions
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
index 81c153aed4..a109a7b5de 100644
--- a/tests/avatar/manager_test.php
+++ b/tests/avatar/manager_test.php
@@ -299,17 +299,32 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
public function data_handle_avatar_delete()
{
return array(
- array(array(
- 'avatar' => '',
- 'avatar_type' => '',
- 'avatar_width' => 0,
- 'avatar_height' => 0,
- ), 1, array(
- 'avatar' => 'foobar@example.com',
- 'avatar_type' => 'avatar.driver.gravatar',
- 'avatar_width' => '16',
- 'avatar_height' => '16',
- ), USERS_TABLE, 'user_'),
+ array(
+ array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), 1, array(
+ 'avatar' => 'foobar@example.com',
+ 'avatar_type' => 'avatar.driver.gravatar',
+ 'avatar_width' => '16',
+ 'avatar_height' => '16',
+ ), USERS_TABLE, 'user_',
+ ),
+ array(
+ array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), 5, array(
+ 'avatar' => 'g5_1414350991.jpg',
+ 'avatar_type' => 'avatar.driver.upload',
+ 'avatar_width' => '80',
+ 'avatar_height' => '80'
+ ), GROUPS_TABLE, 'group_',
+ ),
);
}
@@ -333,4 +348,23 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
$this->assertEquals($value, $row[$key]);
}
}
+
+ /**
+ * @dependsOn test_handle_avatar_delete
+ */
+ public function test_user_group_avatar_deleted()
+ {
+ $sql = 'SELECT * FROM ' . USERS_TABLE . '
+ WHERE user_id = 3';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->manager->clean_row($this->db->sql_fetchrow($result), 'user');
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals(array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), $row);
+ }
}