From 1787ccb5852e09566ba13040ad3f8ca53052e6dd Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 29 Oct 2014 13:24:59 +0100 Subject: [ticket/13241] Remove sleep() and change flood interval instead PHPBB3-13241 --- tests/functional/feed_test.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'tests') 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() -- cgit v1.2.1