@@ 21-29 (lines=9) @@ | ||
18 | $this->cart = singleton('DMSDocumentCart'); |
|
19 | } |
|
20 | ||
21 | public function testAddItem() |
|
22 | { |
|
23 | $doc = $this->objFromFixture('DMSDocument', 'doc1'); |
|
24 | /** @var DMSRequestItem $item */ |
|
25 | $item = DMSRequestItem::create(); |
|
26 | $item->setDocument($doc)->setQuantity(2); |
|
27 | $this->cart->addItem($item); |
|
28 | $this->assertFalse($this->cart->isCartEmpty()); |
|
29 | } |
|
30 | ||
31 | public function testEmptyCart() |
|
32 | { |
|
@@ 57-66 (lines=10) @@ | ||
54 | $this->assertEquals($url, $this->cart->getBackUrl()); |
|
55 | } |
|
56 | ||
57 | public function testGetItem() |
|
58 | { |
|
59 | $doc = $this->objFromFixture('DMSDocument', 'doc1'); |
|
60 | /** @var DMSRequestItem $item */ |
|
61 | $item = DMSRequestItem::create(); |
|
62 | $item->setDocument($doc)->setQuantity(2); |
|
63 | $this->cart->addItem($item); |
|
64 | ||
65 | $this->assertEquals($doc, $this->cart->getItem($doc->ID)->getDocument()); |
|
66 | } |
|
67 | ||
68 | public function testGetItems() |
|
69 | { |
|
@@ 68-77 (lines=10) @@ | ||
65 | $this->assertEquals($doc, $this->cart->getItem($doc->ID)->getDocument()); |
|
66 | } |
|
67 | ||
68 | public function testGetItems() |
|
69 | { |
|
70 | $doc = $this->objFromFixture('DMSDocument', 'doc1'); |
|
71 | /** @var DMSRequestItem $item */ |
|
72 | $item = DMSRequestItem::create(); |
|
73 | $item->setDocument($doc)->setQuantity(2); |
|
74 | $this->cart->addItem($item); |
|
75 | ||
76 | $this->assertCount(1, $this->cart->getItems()); |
|
77 | } |
|
78 | ||
79 | public function testGetReceiverInfo() |
|
80 | { |