aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-10-29 13:08:53 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-10-29 13:42:43 +0100
commite42202e794e970342f4fd31c1436c7f061656826 (patch)
tree847384b8c64a89e873d1be8b863e015ff2a7e70d /tests
parent9ee177573dc838bf0c1cf800c72667a35af828e7 (diff)
downloadforums-e42202e794e970342f4fd31c1436c7f061656826.tar
forums-e42202e794e970342f4fd31c1436c7f061656826.tar.gz
forums-e42202e794e970342f4fd31c1436c7f061656826.tar.bz2
forums-e42202e794e970342f4fd31c1436c7f061656826.tar.xz
forums-e42202e794e970342f4fd31c1436c7f061656826.zip
[ticket/13241] Sleep for 1 second when posting twice in the same second
PHPBB3-13241
Diffstat (limited to 'tests')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php7
-rw-r--r--tests/test_framework/phpbb_test_case.php2
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 840ff981cb..51bae7a723 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -38,6 +38,7 @@ class phpbb_functional_test_case extends phpbb_test_case
static protected $config = array();
static protected $already_installed = false;
+ static protected $last_post_timestamp = 0;
static public function setUpBeforeClass()
{
@@ -1098,6 +1099,12 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
protected function submit_message($posting_url, $posting_contains, $form_data)
{
+ if (time() == self::$last_post_timestamp)
+ {
+ // Travis is too fast, so we have to wait to not mix up the post/topic order
+ sleep(1);
+ }
+ self::$last_post_timestamp = time();
$crawler = self::request('GET', $posting_url);
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php
index c39f7835d1..01d26fb67d 100644
--- a/tests/test_framework/phpbb_test_case.php
+++ b/tests/test_framework/phpbb_test_case.php
@@ -26,7 +26,7 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase
'PHP_Token_Stream' => array('customTokens'),
'PHP_Token_Stream_CachingFactory' => array('cache'),
- 'phpbb_database_test_case' => array('already_connected'),
+ 'phpbb_database_test_case' => array('already_connected', 'last_post_timestamp'),
);
}