Code Duplication    Length = 9-12 lines in 2 locations

tests/DMSDocumentCartTest.php 2 locations

@@ 40-51 (lines=12) @@
37
        $this->assertFalse($this->cart->isCartEmpty());
38
    }
39
40
    public function testEmptyCart()
41
    {
42
        $doc = $this->objFromFixture('DMSDocument', 'doc1');
43
44
        $item = DMSRequestItem::create();
45
        $item->setDocument($doc)->setQuantity(18);
46
        $this->cart->addItem($item);
47
        $this->assertFalse($this->cart->isCartEmpty());
48
49
        $this->cart->emptyCart();
50
        $this->assertTrue($this->cart->isCartEmpty());
51
    }
52
53
    public function testGetBackend()
54
    {
@@ 181-189 (lines=9) @@
178
    }
179
180
181
    public function testIsInCart()
182
    {
183
        $doc = $this->objFromFixture('DMSDocument', 'doc1');
184
        $item = DMSRequestItem::create()->setDocument($doc)->setQuantity(2);
185
        $this->assertFalse($this->cart->isInCart($item->getItemId()));
186
187
        $this->cart->addItem($item);
188
        $this->assertTrue($this->cart->isInCart($item->getItemId()));
189
    }
190
191
    /**
192
     * Ensure that the cart contents are hashed an used for the cart summary cache key