Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIG-21201 fix Sku options #150

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
31 changes: 0 additions & 31 deletions src/Bigcommerce/Api/Resources/SkuOption.php

This file was deleted.

28 changes: 0 additions & 28 deletions test/Unit/Api/Resources/SkuOptionTest.php

This file was deleted.

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);
}
}
}