| @@ 75-88 (lines=14) @@ | ||
| 72 | $this->assertEquals($this->basket->total(), 300); |
|
| 73 | } |
|
| 74 | ||
| 75 | public function testUpdate() |
|
| 76 | { |
|
| 77 | $actualId = $this->basket->insert([ |
|
| 78 | 'id' => 'foo', |
|
| 79 | 'name' => 'bar', |
|
| 80 | 'price' => 100, |
|
| 81 | 'quantity' => 1, |
|
| 82 | 'weight' => 200, |
|
| 83 | ]); |
|
| 84 | ||
| 85 | $this->basket->update($actualId, 'name', 'baz'); |
|
| 86 | ||
| 87 | $this->assertEquals($this->basket->item($actualId)->name, 'baz'); |
|
| 88 | } |
|
| 89 | ||
| 90 | public function testMagicUpdate() |
|
| 91 | { |
|
| @@ 90-105 (lines=16) @@ | ||
| 87 | $this->assertEquals($this->basket->item($actualId)->name, 'baz'); |
|
| 88 | } |
|
| 89 | ||
| 90 | public function testMagicUpdate() |
|
| 91 | { |
|
| 92 | $actualId = $this->basket->insert([ |
|
| 93 | 'id' => 'foo', |
|
| 94 | 'name' => 'bar', |
|
| 95 | 'price' => 100, |
|
| 96 | 'quantity' => 1, |
|
| 97 | 'weight' => 200, |
|
| 98 | ]); |
|
| 99 | ||
| 100 | foreach ($this->basket->contents() as $item) { |
|
| 101 | $item->name = 'bim'; |
|
| 102 | } |
|
| 103 | ||
| 104 | $this->assertEquals($this->basket->item($actualId)->name, 'bim'); |
|
| 105 | } |
|
| 106 | ||
| 107 | public function testOptions() |
|
| 108 | { |
|