Skip to content

Commit

Permalink
e_parse_shortcodeTest: Replace e_render singleton with new instance
Browse files Browse the repository at this point in the history
Should eliminate intermittently failing test because
"{---BREADCRUMB---}" appears in the output only the first time the
shortcode is rendered ("styleCount")
  • Loading branch information
Deltik committed Mar 31, 2021
1 parent 8b8b072 commit 2dc8708
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions e107_tests/tests/unit/e_parse_shortcodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
{
/** @var e_parse_shortcode */
private $scParser;
/**
* @var e_render
*/
private $original_e_render;

public function _before()
{
Expand All @@ -28,6 +32,15 @@ public function _before()
}

$this->scParser->__construct();

$this->original_e_render = e107::getRender();
$mock_e_render = $this->make('e_render');
e107::setRegistry('core/e107/singleton/e_render', $mock_e_render);
}

public function _after()
{
e107::setRegistry('core/e107/singleton/e_render', $this->original_e_render);
}

// public function testShortcode_SITELINKS_ALT()
Expand Down

0 comments on commit 2dc8708

Please sign in to comment.