diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-04-25 16:50:11 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-04-25 16:50:11 +0200 |
| commit | 94dee77647a7ae1a263632a156b5afc14722ad6a (patch) | |
| tree | 28311f33ade8a410f1a85ff1e3e60c238249a80c | |
| parent | c72f5bf48704675b673e1eae26c9bf9471fc72ed (diff) | |
| download | forums-94dee77647a7ae1a263632a156b5afc14722ad6a.tar forums-94dee77647a7ae1a263632a156b5afc14722ad6a.tar.gz forums-94dee77647a7ae1a263632a156b5afc14722ad6a.tar.bz2 forums-94dee77647a7ae1a263632a156b5afc14722ad6a.tar.xz forums-94dee77647a7ae1a263632a156b5afc14722ad6a.zip | |
[ticket/11495] Replace fixtures content with manual calls
Should be easier to maintain
PHPBB3-11495
| -rw-r--r-- | tests/nestedset/fixtures/phpbb_forums.xml | 110 | ||||
| -rw-r--r-- | tests/nestedset/set_forum_base.php | 25 |
2 files changed, 25 insertions, 110 deletions
diff --git a/tests/nestedset/fixtures/phpbb_forums.xml b/tests/nestedset/fixtures/phpbb_forums.xml index 016c8ea7c5..8f133078a9 100644 --- a/tests/nestedset/fixtures/phpbb_forums.xml +++ b/tests/nestedset/fixtures/phpbb_forums.xml @@ -9,115 +9,5 @@ <column>forum_name</column> <column>forum_desc</column> <column>forum_rules</column> - <row> - <value>1</value> - <value>0</value> - <value>1</value> - <value>6</value> - <value></value> - <value>Parent with two flat children</value> - <value></value> - <value></value> - </row> - <row> - <value>2</value> - <value>1</value> - <value>2</value> - <value>3</value> - <value></value> - <value>Flat child #1</value> - <value></value> - <value></value> - </row> - <row> - <value>3</value> - <value>1</value> - <value>4</value> - <value>5</value> - <value></value> - <value>Flat child #2</value> - <value></value> - <value></value> - </row> - <row> - <value>4</value> - <value>0</value> - <value>7</value> - <value>12</value> - <value></value> - <value>Parent with two nested children</value> - <value></value> - <value></value> - </row> - <row> - <value>5</value> - <value>4</value> - <value>8</value> - <value>11</value> - <value></value> - <value>Nested child #1</value> - <value></value> - <value></value> - </row> - <row> - <value>6</value> - <value>5</value> - <value>9</value> - <value>10</value> - <value></value> - <value>Nested child #2</value> - <value></value> - <value></value> - </row> - <row> - <value>7</value> - <value>0</value> - <value>13</value> - <value>22</value> - <value></value> - <value>Parent with flat and nested children</value> - <value></value> - <value></value> - </row> - <row> - <value>8</value> - <value>7</value> - <value>14</value> - <value>15</value> - <value></value> - <value>Mixed child #1</value> - <value></value> - <value></value> - </row> - <row> - <value>9</value> - <value>7</value> - <value>16</value> - <value>19</value> - <value></value> - <value>Mixed child #2</value> - <value></value> - <value></value> - </row> - <row> - <value>10</value> - <value>9</value> - <value>17</value> - <value>18</value> - <value></value> - <value>Nested child #1 of Mixed child #2</value> - <value></value> - <value></value> - </row> - <row> - <value>11</value> - <value>7</value> - <value>20</value> - <value>21</value> - <value></value> - <value>Mixed child #3</value> - <value></value> - <value></value> - </row> </table> </dataset> diff --git a/tests/nestedset/set_forum_base.php b/tests/nestedset/set_forum_base.php index 4523f12897..93d4dc3522 100644 --- a/tests/nestedset/set_forum_base.php +++ b/tests/nestedset/set_forum_base.php @@ -57,5 +57,30 @@ class phpbb_tests_nestedset_set_forum_base extends phpbb_database_test_case $this->lock = new phpbb_lock_db('nestedset_forum_lock', $this->config, $this->db); $this->set = new phpbb_nestedset_forum($this->db, $this->lock, 'phpbb_forums'); + + $this->set_up_forums(); + } + + protected function set_up_forums() + { + $this->create_forum('Parent with two flat children'); + $this->create_forum('Flat child #1', 1); + $this->create_forum('Flat child #2', 1); + + $this->create_forum('Parent with two nested children'); + $this->create_forum('Nested child #1', 4); + $this->create_forum('Nested child #2', 5); + + $this->create_forum('Parent with flat and nested children'); + $this->create_forum('Mixed child #1', 7); + $this->create_forum('Mixed child #2', 7); + $this->create_forum('Nested child #1 of Mixed child #2', 9); + $this->create_forum('Mixed child #3', 7); + } + + protected function create_forum($name, $parent_id = 0) + { + $forum = $this->set->insert(array('forum_name' => $name, 'forum_desc' => '', 'forum_rules' => '')); + $this->set->change_parent($forum['forum_id'], $parent_id); } } |
