Skip to content

Commit

Permalink
BIG-21201 fix Sku options
Browse files Browse the repository at this point in the history
  • Loading branch information
zvuki committed Aug 17, 2015
1 parent e9af38a commit e822834
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
11 changes: 0 additions & 11 deletions src/Bigcommerce/Api/Resources/Sku.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ class Sku extends Resource
'product_id',
);

public function options()
{
$options = Client::getCollection($this->fields->options->resource, 'SkuOption');

foreach ($options as $option) {
$option->product_id = $this->product_id;
}

return $options;
}

public function create()
{
return Client::createResource('/products/' . $this->product_id . '/skus', $this->getCreateFields());
Expand Down
20 changes: 0 additions & 20 deletions test/Unit/Api/Resources/SkuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,4 @@ public function testUpdatePassesThroughToConnection()

$sku->update();
}

public function testOptionsPassesThroughToConnection()
{
$sku = new Sku((object)array(
'product_id' => 1,
'options' => (object)array(
'resource' => '/products/1/skus/1/options'
)
));
$this->connection->expects($this->once())
->method('get')
->with($this->basePath . '/products/1/skus/1/options')
->will($this->returnValue(array(array(), array())));

$collection = $sku->options;
$this->assertInternalType('array', $collection);
foreach ($collection as $condition) {
$this->assertInstanceOf('Bigcommerce\\Api\\Resources\\SkuOption', $condition);
}
}
}

0 comments on commit e822834

Please sign in to comment.