Skip to content

Commit

Permalink
Add required URL to tests and documentation (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
howard authored Feb 19, 2020
1 parent e112c28 commit 395d0ea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,16 @@ $exporter = Exporter::create(Exporter::TYPE_XML);

$item = $exporter->createItem('123');

$item->addName('Test');
$item->addUrl('http://example.org/test.html');
$item->addPrice(13.37);
// Alternative long form:
// $name = new Name();
// $name->setValue('Test');
// $item->setName($name);
// $url = new Url();
// $url->setValue('http://example.org/test.html');
// $item->setUrl($url);
// $price = new Price();
// $price->setValue(13.37);
// $item->setPrice($price);
Expand All @@ -91,7 +99,15 @@ $exporter = Exporter::create(Exporter::TYPE_CSV);
$item = $exporter->createItem('123');

$item->addPrice(13.37);
$item->addName('Test');
$item->addUrl('http://example.org/test.html');
// Alternative long form:
// $name = new Name();
// $name->setValue('Test');
// $item->setName($name);
// $url = new Url();
// $url->setValue('http://example.org/test.html');
// $item->setUrl($url);
// $price = new Price();
// $price->setValue(13.37);
// $item->setPrice($price);
Expand Down
2 changes: 2 additions & 0 deletions tests/FINDOLOGIC/Export/Tests/XmlSerializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private function getMinimalItem(): Item
$item = $this->exporter->createItem('123');

$item->addName('Alternative name');
$item->addUrl('http://example.org/item.html');

$price = new Price();
$price->setValue('13.37');
Expand Down Expand Up @@ -591,6 +592,7 @@ public function testAllPricesCanBeSet(): void
$item = $this->exporter->createItem('123');
$item->setAllPrices([$price, $anotherPrice]);
$item->addName('Best item ever');
$item->addUrl('http://example.org/item.html');

$page = new Page(0, 1, 1);
$page->addItem($item);
Expand Down

0 comments on commit 395d0ea

Please sign in to comment.