/** * Test get height. * * @dataProvider dataGetDimensions */ public function testGetDimensions(array $dimensions, $total) { $cartLines = new ArrayCollection([]); foreach ($dimensions as $dimension) { $cartLine = $this->getMock('Elcodi\\Component\\Cart\\Entity\\Interfaces\\CartLineInterface'); $cartLine->method('getHeight')->will($this->returnValue($dimension)); $cartLine->method('getWidth')->will($this->returnValue($dimension)); $cartLine->method('getDepth')->will($this->returnValue($dimension)); $cartLines->add($cartLine); } $cart = new Cart(); $cart->setCartLines($cartLines); $this->assertEquals($total, $cart->getHeight()); $this->assertEquals($total, $cart->getWidth()); $this->assertEquals($total, $cart->getDepth()); }