| @@ 30-38 (lines=9) @@ | ||
| 27 | DMSDocumentCart::create(new DMSDocument); |
|
| 28 | } |
|
| 29 | ||
| 30 | public function testAddItem() |
|
| 31 | { |
|
| 32 | $doc = $this->objFromFixture('DMSDocument', 'doc1'); |
|
| 33 | ||
| 34 | $item = DMSRequestItem::create(); |
|
| 35 | $item->setDocument($doc)->setQuantity(2); |
|
| 36 | $this->cart->addItem($item); |
|
| 37 | $this->assertFalse($this->cart->isCartEmpty()); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testEmptyCart() |
|
| 41 | { |
|
| @@ 65-74 (lines=10) @@ | ||
| 62 | $this->assertEquals($url, $this->cart->getBackUrl()); |
|
| 63 | } |
|
| 64 | ||
| 65 | public function testGetItem() |
|
| 66 | { |
|
| 67 | $doc = $this->objFromFixture('DMSDocument', 'doc1'); |
|
| 68 | ||
| 69 | $item = DMSRequestItem::create(); |
|
| 70 | $item->setDocument($doc)->setQuantity(2); |
|
| 71 | $this->cart->addItem($item); |
|
| 72 | ||
| 73 | $this->assertEquals($doc, $this->cart->getItem($doc->ID)->getDocument()); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function testGetItems() |
|
| 77 | { |
|