Skip to content

Commit

Permalink
CURB-3054 Fix for data providers apparently run before set_up() in ne…
Browse files Browse the repository at this point in the history
…wer PHPUnit versions.
  • Loading branch information
Rekhyt committed Apr 19, 2023
1 parent 508d538 commit 3cc6056
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/integration/ShopgatePluginApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ShopgatePluginApiTest extends ShopgateTestCase
);

/** @var string */
private $tmpCategoriesXmlFilePath;
private static $tmpCategoriesXmlFilePath = '/tmp/shopgate_categories.xml';

/** @var ShopgatePluginApi $subjectUnderTest */
private $subjectUnderTest;
Expand All @@ -65,8 +65,6 @@ class ShopgatePluginApiTest extends ShopgateTestCase

public function set_up()
{
$this->tmpCategoriesXmlFilePath = '/tmp/shopgate_categories.xml';

$this->shopgateConfigMock =
$this->getMockBuilder('\ShopgateConfigInterface')->getMockForAbstractClass();
$this->shopgateConfigMock->method('getCronJobWhiteList')->willReturn(self::$cronJobWhiteList);
Expand Down Expand Up @@ -100,8 +98,8 @@ public function set_up()

public function tear_down()
{
if (file_exists($this->tmpCategoriesXmlFilePath)) {
unlink($this->tmpCategoriesXmlFilePath);
if (file_exists(self::$tmpCategoriesXmlFilePath)) {
unlink(self::$tmpCategoriesXmlFilePath);
}
}

Expand Down Expand Up @@ -172,15 +170,15 @@ public function provideExternalResponseHandlingSetups()
'customer_language' => 'en_US'
),
),
"get_categories to file {$this->tmpCategoriesXmlFilePath}" => array(
'get_categories to file ' . self::$tmpCategoriesXmlFilePath => array(
'expectedOutputBuffer' => '',
'expectedResponse' => new ShopgatePluginApiResponseAppXmlExport($traceId, $this->tmpCategoriesXmlFilePath),
'expectedResponse' => new ShopgatePluginApiResponseAppXmlExport($traceId, self::$tmpCategoriesXmlFilePath),
'action' => 'get_categories',
'parameters' => array(
'limit' => 100,
'offset' => 5,
),
'filePath' => $this->tmpCategoriesXmlFilePath
'filePath' => self::$tmpCategoriesXmlFilePath
),
'get_categories to file php://output' => array(
'expectedOutputBuffer' => '<categories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://files.shopgate.com/xml/xsd/catalog/categories.xsd"><category uid="10" is_active="1" is_anchor="0"><name><![CDATA[example]]></name><deeplink/></category></categories>',
Expand Down

0 comments on commit 3cc6056

Please sign in to comment.