Пример #1
0
 public function test_delete_variation()
 {
     Phake::when($this->client)->request('post', '/1/items/delete_variation', ['item_id' => 100, 'variation_id' => 1])->thenReturn(['item' => ['test' => 'test']]);
     Phake::when($this->em)->getEntity('Item', ['test' => 'test'])->thenReturn('entity');
     $itemsApi = new Items($this->client, $this->em);
     $this->assertEquals('entity', $itemsApi->delete_variation(100, 1));
 }
Пример #2
0
$user = $usersApi->me();
var_dump($user);
// object(Quartet\BaseApi\Entity\User)[30]
//   public 'shop_id' => string 'sample_shop' (length=11)
//   public 'shop_name' => string 'sample shop name' (length=16)
//   public 'shop_introduction' => string '' (length=0)
//   public 'shop_url' => string 'http://sample_shop.thebase.in' (length=29)
//   public 'twitter_id' => string '' (length=0)
//   public 'facebook_id' => string '' (length=0)
//   public 'ameba_id' => string '' (length=0)
//   public 'instagram_id' => string '' (length=0)
//   public 'background' => null
//   public 'logo' => null
//   public 'mail_address' => null
// Items api.
$itemsApi = new Items($client);
$items = $itemsApi->get();
var_dump($items[0]);
// object(Quartet\BaseApi\Entity\Item)[49]
//   public 'item_id' => int 842194
//   public 'title' => string 'Tシャツ' (length=10)
//   public 'detail' => string '' (length=0)
//   public 'price' => int 2000
//   public 'stock' => int 8
//   public 'visible' => int 1
//   public 'list_order' => int 1
//   public 'identifier' => null
//   public 'img1_origin' => null
//   public 'img1_76' => null
//   public 'img1_146' => null
//   public 'img1_300' => null