Skip to content

Commit 8da9500

Browse files
committed
Fix unit tests
1 parent 1c68060 commit 8da9500

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/PrestaShopWebserviceExtraTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ public function testGetBlankSchemaAction()
5050
$this->assertEquals($webservice->getQueryOptions(), ['url' => 'https://shop.com/api/products?schema=blank']);
5151
}
5252

53+
public function testGetSynopsisSchemaAction()
54+
{
55+
$webservice = $this->getWebserviceInstance();
56+
$webservice->getSynopsisSchema('products');
57+
58+
$this->assertEquals($webservice->getQueryAction(), 'get');
59+
$this->assertEquals($webservice->getQueryOptions(), ['url' => 'https://shop.com/api/products?schema=synopsis']);
60+
}
61+
5362
public function testAddAction()
5463
{
5564
$webservice = $this->getWebserviceInstance();
@@ -452,12 +461,12 @@ public function testSendXmlOptionWithAddAction()
452461
$webservice = $this->getWebserviceInstance();
453462
$webservice
454463
->add('products')
455-
->sendXml('xml data');
464+
->sendXml(new \SimpleXMLElement('<settings/>'));
456465

457466
$this->assertEquals($webservice->getQueryAction(), 'add');
458467
$this->assertEquals($webservice->getQueryOptions(), [
459468
'resource' => 'products',
460-
'postXml' => 'xml data'
469+
'postXml' => new \SimpleXMLElement('<settings/>')
461470
]);
462471
}
463472

@@ -467,13 +476,13 @@ public function testSendXmlOptionWithEditAction()
467476
$webservice
468477
->edit('products')
469478
->id(3)
470-
->sendXml('xml data');
479+
->sendXml(new \SimpleXMLElement('<settings/>'));
471480

472481
$this->assertEquals($webservice->getQueryAction(), 'edit');
473482
$this->assertEquals($webservice->getQueryOptions(), [
474483
'resource' => 'products',
475484
'id' => 3,
476-
'putXml' => 'xml data'
485+
'putXml' => new \SimpleXMLElement('<settings/>')
477486
]);
478487
}
479488

0 commit comments

Comments
 (0)