| @@ 221-232 (lines=12) @@ | ||
| 218 | $this->assertEquals(130, $this->basket->total(false)); |
|
| 219 | } |
|
| 220 | ||
| 221 | public function testFind() |
|
| 222 | { |
|
| 223 | $this->basket->insert([ |
|
| 224 | 'id' => 'foo', |
|
| 225 | 'name' => 'bar', |
|
| 226 | 'price' => 100, |
|
| 227 | 'quantity' => 1, |
|
| 228 | 'weight' => 200, |
|
| 229 | ]); |
|
| 230 | ||
| 231 | $this->assertInstanceOf('\Lenius\Basket\Item', $this->basket->find('foo')); |
|
| 232 | } |
|
| 233 | ||
| 234 | public function testTotals() |
|
| 235 | { |
|
| @@ 345-359 (lines=15) @@ | ||
| 342 | } |
|
| 343 | } |
|
| 344 | ||
| 345 | public function testTax() |
|
| 346 | { |
|
| 347 | $this->basket->insert([ |
|
| 348 | 'id' => 'foo', |
|
| 349 | 'name' => 'bar', |
|
| 350 | 'price' => 100, |
|
| 351 | 'quantity' => 1, |
|
| 352 | 'tax' => 20, |
|
| 353 | 'weight' => 200, |
|
| 354 | ]); |
|
| 355 | ||
| 356 | // Test that the tax is being calculated successfully |
|
| 357 | $this->assertEquals(20, $this->basket->tax()); |
|
| 358 | } |
|
| 359 | ||
| 360 | public function testTaxOptions() |
|
| 361 | { |
|
| 362 | $this->basket->insert([ |
|