mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11162] This test really only works for bookmarks.
PHPBB3-11162
This commit is contained in:
parent
58951ef105
commit
efe122b032
3 changed files with 50 additions and 3 deletions
|
@ -0,0 +1,47 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<dataset>
|
||||||
|
<table name="phpbb_bookmarks">
|
||||||
|
<column>user_id</column>
|
||||||
|
<column>topic_id</column>
|
||||||
|
|
||||||
|
<!-- one entry for this topic -->
|
||||||
|
<row>
|
||||||
|
<value>1</value>
|
||||||
|
<value>1</value>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<!-- non-conflicting entries -->
|
||||||
|
<row>
|
||||||
|
<value>2</value>
|
||||||
|
<value>2</value>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<value>3</value>
|
||||||
|
<value>3</value>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<!-- conflicting entries -->
|
||||||
|
<row>
|
||||||
|
<value>1</value>
|
||||||
|
<value>4</value>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<value>1</value>
|
||||||
|
<value>5</value>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<!-- conflicting and non-conflicting entries -->
|
||||||
|
<row>
|
||||||
|
<value>1</value>
|
||||||
|
<value>6</value>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<value>1</value>
|
||||||
|
<value>7</value>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<value>2</value>
|
||||||
|
<value>6</value>
|
||||||
|
</row>
|
||||||
|
</table>
|
||||||
|
</dataset>
|
|
@ -13,7 +13,7 @@ class phpbb_update_rows_avoiding_duplicates_test extends phpbb_database_test_cas
|
||||||
{
|
{
|
||||||
public function getDataSet()
|
public function getDataSet()
|
||||||
{
|
{
|
||||||
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/duplicates.xml');
|
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/bookmarks_duplicates.xml');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function fixture_data()
|
public static function fixture_data()
|
||||||
|
@ -57,10 +57,10 @@ class phpbb_update_rows_avoiding_duplicates_test extends phpbb_database_test_cas
|
||||||
{
|
{
|
||||||
$db = $this->new_dbal();
|
$db = $this->new_dbal();
|
||||||
|
|
||||||
phpbb_update_rows_avoiding_duplicates($db, TOPICS_WATCH_TABLE, 'topic_id', $from, $to);
|
phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $from, $to);
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(*) AS remaining_rows
|
$sql = 'SELECT COUNT(*) AS remaining_rows
|
||||||
FROM ' . TOPICS_WATCH_TABLE . '
|
FROM ' . BOOKMARKS_TABLE . '
|
||||||
WHERE topic_id = ' . (int) $to;
|
WHERE topic_id = ' . (int) $to;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$result_count = $db->sql_fetchfield('remaining_rows');
|
$result_count = $db->sql_fetchfield('remaining_rows');
|
||||||
|
|
Loading…
Add table
Reference in a new issue