aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicofuma <github@nicofuma.fr>2014-04-24 00:52:04 +0200
committerNicofuma <github@nicofuma.fr>2014-05-02 13:25:42 +0200
commitac59b6a19914a86bc434fd8ac6aae4f901c72f98 (patch)
tree5e9469724d66b4f54938c489673feba844ecc6d1
parentedf0fd0fbd4e76e57bb3899aaffeee730eec8261 (diff)
downloadforums-ac59b6a19914a86bc434fd8ac6aae4f901c72f98.tar
forums-ac59b6a19914a86bc434fd8ac6aae4f901c72f98.tar.gz
forums-ac59b6a19914a86bc434fd8ac6aae4f901c72f98.tar.bz2
forums-ac59b6a19914a86bc434fd8ac6aae4f901c72f98.tar.xz
forums-ac59b6a19914a86bc434fd8ac6aae4f901c72f98.zip
[ticket/12413] Fixing the failed test
The test was failing because travis is too fast: 2 posts had the same timestamp. PHPBB3-12413
-rw-r--r--tests/functional/feed_test.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php
index 2612d5a138..98a3bf2aa4 100644
--- a/tests/functional/feed_test.php
+++ b/tests/functional/feed_test.php
@@ -1,15 +1,15 @@
<?php
/**
-*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
+ *
+ * @package testing
+ * @copyright (c) 2014 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
/**
-* @group functional
-*/
+ * @group functional
+ */
class phpbb_functional_feed_test extends phpbb_functional_test_case
{
protected $data = array();
@@ -320,9 +320,15 @@ 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');
@@ -448,6 +454,9 @@ 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'];
}
@@ -483,6 +492,9 @@ 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}");