From 010492b67ec6471130d8bab505a80d00ab386597 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Tue, 28 Sep 2021 12:27:09 -0500 Subject: [PATCH] Stub e_date::convert_date() in e_parse_shortcodeTest Prevents this flaky error: --------- 1) e_parse_shortcodeTest: Forum shortcodes Test tests/unit/e_parse_shortcodeTest.php:testForumShortcodes {INFO} != sc_info() Failed asserting that two strings are equal. - Expected | + Actual @@ @@ 'Welcome e107-cli
There are no new posts since your last visit.
You last visited at
- It is now Tuesday 28 September 2021 - 16:25:39' + It is now Tuesday 28 September 2021 - 16:25:38' #1 /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:1656 #2 /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:1147 #3 e_parse_shortcodeTest->testForumShortcodes #4 {closure} --- e107_tests/tests/unit/e_parse_shortcodeTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e107_tests/tests/unit/e_parse_shortcodeTest.php b/e107_tests/tests/unit/e_parse_shortcodeTest.php index 866f36034..b19373b8c 100644 --- a/e107_tests/tests/unit/e_parse_shortcodeTest.php +++ b/e107_tests/tests/unit/e_parse_shortcodeTest.php @@ -43,7 +43,11 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit $this->original_e_date = e107::getDate(); $mock_e_date = $this->make('e_date', [ - 'computeLapse' => 'E107_TEST_STUBBED_OUT' + 'computeLapse' => 'E107_TEST_STUBBED_OUT', + 'convert_date' => function($datestamp, $mask = '') + { + return $this->original_e_date->convert_date(0, $mask); + }, ]); e107::setRegistry('core/e107/singleton/e_date', $mock_e_date); }