/** * @return array */ public function toArray() { $cartArray = ['net' => $this->net, 'gross' => $this->gross, 'count' => $this->count, 'taxes' => $this->taxes, 'maxServiceAttribute1' => $this->maxServiceAttr1, 'maxServiceAttribute2' => $this->maxServiceAttr2, 'maxServiceAttribute3' => $this->maxServiceAttr3, 'sumServiceAttribute1' => $this->sumServiceAttr1, 'sumServiceAttribute2' => $this->sumServiceAttr2, 'sumServiceAttribute3' => $this->sumServiceAttr3, 'additional' => $this->additional]; if ($this->payment) { $cartArray['payment'] = $this->payment->getName(); } if ($this->shipping) { $cartArray['payment'] = $this->shipping->getName(); } if ($this->specials) { $specials = []; foreach ($this->specials as $special) { $specials[] = $special->getName(); } $cartArray['specials'] = $specials; } return $cartArray; }
/** * @test */ public function getCartProductIdReturnsProductIdSetByConstructor() { $this->assertSame($this->id, $this->shipping->getId()); }