Skip to content

Commit e822834

Browse files
author
Andrei Kondratiev
committed
BIG-21201 fix Sku options
1 parent e9af38a commit e822834

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/Bigcommerce/Api/Resources/Sku.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,6 @@ class Sku extends Resource
1919
'product_id',
2020
);
2121

22-
public function options()
23-
{
24-
$options = Client::getCollection($this->fields->options->resource, 'SkuOption');
25-
26-
foreach ($options as $option) {
27-
$option->product_id = $this->product_id;
28-
}
29-
30-
return $options;
31-
}
32-
3322
public function create()
3423
{
3524
return Client::createResource('/products/' . $this->product_id . '/skus', $this->getCreateFields());

test/Unit/Api/Resources/SkuTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,4 @@ public function testUpdatePassesThroughToConnection()
2525

2626
$sku->update();
2727
}
28-
29-
public function testOptionsPassesThroughToConnection()
30-
{
31-
$sku = new Sku((object)array(
32-
'product_id' => 1,
33-
'options' => (object)array(
34-
'resource' => '/products/1/skus/1/options'
35-
)
36-
));
37-
$this->connection->expects($this->once())
38-
->method('get')
39-
->with($this->basePath . '/products/1/skus/1/options')
40-
->will($this->returnValue(array(array(), array())));
41-
42-
$collection = $sku->options;
43-
$this->assertInternalType('array', $collection);
44-
foreach ($collection as $condition) {
45-
$this->assertInstanceOf('Bigcommerce\\Api\\Resources\\SkuOption', $condition);
46-
}
47-
}
4828
}

0 commit comments

Comments
 (0)