Skip to content

Commit

Permalink
Allow empty bonus, salesFrequency, dateAdded, sort (#2)
Browse files Browse the repository at this point in the history
This is required by the schema, so the library must cover it as well.
  • Loading branch information
howard committed Jun 2, 2017
1 parent b6d40a7 commit a94b072
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: php
php:
- 5.6
- 7.0
- hhvm
- 7.1

install: composer install
script: phpunit --configuration phpunit.xml --coverage-text
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "findologic/libflexport",
"description": "FINDOLOGIC export toolkit for XML and CSV data export",
"version": "0.0.2",
"require-dev": {
"phpunit/phpunit": "~5.6",
"goetas-webservices/xsd2php":"^0.2"
Expand Down
4 changes: 4 additions & 0 deletions src/FINDOLOGIC/Export/Data/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public function __construct($id)

$this->keywords = new AllKeywords();
$this->ordernumbers = new AllOrdernumbers();
$this->bonus = new Bonus();
$this->salesFrequency = new SalesFrequency();
$this->dateAdded = new DateAdded();
$this->sort = new Sort();
}

public function setName(Name $name)
Expand Down
16 changes: 0 additions & 16 deletions tests/FINDOLOGIC/Tests/XmlSerializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,6 @@ private function getMinimalItem()
$url->setValue('http://example.org/my-awesome-product.html');
$item->setUrl($url);

$bonus = new Bonus();
$bonus->setValue(3);
$item->setBonus($bonus);

$salesFrequency = new SalesFrequency();
$salesFrequency->setValue(42);
$item->setSalesFrequency($salesFrequency);

$dateAdded = new DateAdded();
$dateAdded->setDateValue(new \DateTime());
$item->setDateAdded($dateAdded);

$sort = new Sort();
$sort->setValue(2);
$item->setSort($sort);

return $item;
}

Expand Down

0 comments on commit a94b072

Please sign in to comment.