diff options
author | Andreas Fischer <bantu@phpbb.com> | 2014-10-29 15:10:40 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2014-10-29 15:10:40 +0100 |
commit | 57afbbb48aea55cdec56c4807eaa7c9ed77eb3d0 (patch) | |
tree | 34d7b5acb89fdd674414173769513e3cf352d8c3 /tests/functional/feed_test.php | |
parent | ae55db6da49e15418020f0901619c4c832460a4d (diff) | |
parent | 17928563a2a265f4b70feef64e5030ea3c602269 (diff) | |
download | forums-57afbbb48aea55cdec56c4807eaa7c9ed77eb3d0.tar forums-57afbbb48aea55cdec56c4807eaa7c9ed77eb3d0.tar.gz forums-57afbbb48aea55cdec56c4807eaa7c9ed77eb3d0.tar.bz2 forums-57afbbb48aea55cdec56c4807eaa7c9ed77eb3d0.tar.xz forums-57afbbb48aea55cdec56c4807eaa7c9ed77eb3d0.zip |
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus:
[ticket/13241] Remove sleep() and change flood interval instead
[ticket/13241] Remove sleep() since the method takes care of this now
[ticket/13241] Sleep for 1 second when posting twice in the same second
[ticket/13241] Fix pagination with global announcements
[ticket/13241] Correctly ignore announcements from topics list
[ticket/13241] Add a functional test for viewforum with global announcement
Diffstat (limited to 'tests/functional/feed_test.php')
-rw-r--r-- | tests/functional/feed_test.php | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index 7aa2d0da7d..9041c8dc69 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -322,15 +322,9 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case $post = $this->create_topic($this->data['forums']['Feeds #news'], 'Feeds #news - Topic #1', 'This is a test topic posted by the testing framework.'); $this->data['topics']['Feeds #news - Topic #1'] = (int) $post['topic_id']; - // Travis is too fast, so we have to wait - sleep(1); - $post = $this->create_topic($this->data['forums']['Feeds #news'], 'Feeds #news - Topic #2', 'This is a test topic posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - // Travis is too fast, so we have to wait - sleep(1); - $this->assertContains('Feeds #news - Topic #2', $crawler->filter('html')->text()); $this->data['topics']['Feeds #news - Topic #2'] = (int) $post['topic_id']; $this->data['posts']['Feeds #news - Topic #2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -456,9 +450,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case $post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #1', 'This is a test topic posted by the testing framework.'); $this->data['topics']['Feeds #1 - Topic #1'] = (int) $post['topic_id']; - // Travis is too fast, so we have to wait - sleep(1); - $post = $this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #1', 'This is a test topic posted by the testing framework.'); $this->data['topics']['Feeds #1.1 - Topic #1'] = (int) $post['topic_id']; } @@ -494,9 +485,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case $post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #2', 'This is a test topic posted by the testing framework.'); $this->data['topics']['Feeds #1 - Topic #2'] = (int) $post['topic_id']; - // Travis is too fast, so we have to wait - sleep(1); - // Test creating a reply $post2 = $this->create_post($this->data['forums']['Feeds #1'], $post['topic_id'], 'Re: Feeds #1 - Topic #2', 'This is a test post posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); @@ -852,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'); @@ -862,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() |