aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functions
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functions')
-rw-r--r--tests/functions/fixtures/duplicates.xml56
-rw-r--r--tests/functions/update_rows_avoiding_duplicates_test.php71
2 files changed, 0 insertions, 127 deletions
diff --git a/tests/functions/fixtures/duplicates.xml b/tests/functions/fixtures/duplicates.xml
deleted file mode 100644
index bc08016a8f..0000000000
--- a/tests/functions/fixtures/duplicates.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<dataset>
- <table name="phpbb_topics_watch">
- <column>user_id</column>
- <column>topic_id</column>
- <column>notify_status</column>
-
- <!-- one entry for this topic -->
- <row>
- <value>1</value>
- <value>1</value>
- <value>1</value>
- </row>
-
- <!-- non-conflicting entries -->
- <row>
- <value>2</value>
- <value>2</value>
- <value>1</value>
- </row>
- <row>
- <value>3</value>
- <value>3</value>
- <value>1</value>
- </row>
-
- <!-- conflicting entries -->
- <row>
- <value>1</value>
- <value>4</value>
- <value>1</value>
- </row>
- <row>
- <value>1</value>
- <value>5</value>
- <value>1</value>
- </row>
-
- <!-- conflicting and non-conflicting entries -->
- <row>
- <value>1</value>
- <value>6</value>
- <value>1</value>
- </row>
- <row>
- <value>1</value>
- <value>7</value>
- <value>1</value>
- </row>
- <row>
- <value>2</value>
- <value>6</value>
- <value>1</value>
- </row>
- </table>
-</dataset>
diff --git a/tests/functions/update_rows_avoiding_duplicates_test.php b/tests/functions/update_rows_avoiding_duplicates_test.php
deleted file mode 100644
index 0d68e22d4a..0000000000
--- a/tests/functions/update_rows_avoiding_duplicates_test.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
-class phpbb_update_rows_avoiding_duplicates_test extends phpbb_database_test_case
-{
- public function getDataSet()
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/duplicates.xml');
- }
-
- public static function fixture_data()
- {
- return array(
- // description
- // from array
- // to value
- // expected count with to value post update
- array(
- 'trivial',
- array(1),
- 10,
- 1,
- ),
- array(
- 'no conflict',
- array(2),
- 3,
- 2,
- ),
- array(
- 'conflict',
- array(4),
- 5,
- 1,
- ),
- array(
- 'conflict and no conflict',
- array(6),
- 7,
- 2,
- ),
- );
- }
-
- /**
- * @dataProvider fixture_data
- */
- public function test_trivial_update($description, $from, $to, $expected_result_count)
- {
- $db = $this->new_dbal();
-
- phpbb_update_rows_avoiding_duplicates($db, TOPICS_WATCH_TABLE, 'topic_id', $from, $to);
-
- $sql = 'SELECT COUNT(*) AS remaining_rows
- FROM ' . TOPICS_WATCH_TABLE . '
- WHERE topic_id = ' . (int) $to;
- $result = $db->sql_query($sql);
- $result_count = $db->sql_fetchfield('remaining_rows');
- $db->sql_freeresult($result);
-
- $this->assertEquals($expected_result_count, $result_count);
- }
-}