| @@ 44-56 (lines=13) @@ | ||
| 41 | return $shelf; |
|
| 42 | } |
|
| 43 | ||
| 44 | public function testAdd() |
|
| 45 | { |
|
| 46 | ||
| 47 | $shelfData = $this->shelf(); |
|
| 48 | ||
| 49 | $shelf = new Shelf($this->http); |
|
| 50 | $response = $shelf->add(function(ShelfData $shelf) use ($shelfData) { |
|
| 51 | return $shelfData; |
|
| 52 | },$this->url,'test'); |
|
| 53 | $this->assertTrue(is_array($response)); |
|
| 54 | ||
| 55 | return $response['shelf_id']; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @depends testAdd |
|
| @@ 61-72 (lines=12) @@ | ||
| 58 | /** |
|
| 59 | * @depends testAdd |
|
| 60 | */ |
|
| 61 | public function testUpdate($shelfId) |
|
| 62 | { |
|
| 63 | ||
| 64 | $shelfData = $this->shelf(); |
|
| 65 | ||
| 66 | $shelf = new Shelf($this->http); |
|
| 67 | $response = $shelf->update(function(ShelfData $shelf) use ($shelfData) { |
|
| 68 | return $shelfData; |
|
| 69 | }, $shelfId, $this->url,'测试'); |
|
| 70 | ||
| 71 | $this->assertTrue($response); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function testLists() |
|
| 75 | { |
|