diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-29 13:24:59 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-10-29 14:17:15 +0100 |
commit | 1787ccb5852e09566ba13040ad3f8ca53052e6dd (patch) | |
tree | bcb31f93875f581aa8e101cdba1b3d3bfd6cd6e7 /tests | |
parent | b868886b25ccf6228b31dd1e4950eba1b3a67243 (diff) | |
download | forums-1787ccb5852e09566ba13040ad3f8ca53052e6dd.tar forums-1787ccb5852e09566ba13040ad3f8ca53052e6dd.tar.gz forums-1787ccb5852e09566ba13040ad3f8ca53052e6dd.tar.bz2 forums-1787ccb5852e09566ba13040ad3f8ca53052e6dd.tar.xz forums-1787ccb5852e09566ba13040ad3f8ca53052e6dd.zip |
[ticket/13241] Remove sleep() and change flood interval instead
PHPBB3-13241
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/feed_test.php | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index ddf17d4749..9041c8dc69 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -840,9 +840,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case 'Feeds #1.1', ), )); - - // We have to wait because of the flood interval. - sleep(15); + $this->set_flood_interval(0); $this->login('disapprove_user'); $post = $this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #3', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD'); @@ -850,6 +848,27 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Feeds #1.1']}&sid={$this->sid}"); $this->assertNotContains('Feeds #1.1 - Topic #3', $crawler->filter('html')->text()); + + $this->logout(); + $this->set_flood_interval(15); + } + + protected function set_flood_interval($flood_interval) + { + $this->login(); + $this->admin_login(); + + $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post'); + + $form = $crawler->selectButton('Submit')->form(); + $values = $form->getValues(); + + $values["config[flood_interval]"] = $flood_interval; + $form->setValues($values); + $crawler = self::submit($form); + $this->assertGreaterThan(0, $crawler->filter('.successbox')->count()); + + $this->logout(); } public function test_feeds_unapproved_topic_admin() |