setCurrency(self::$currency); $amount->setTotal(self::$total); return $amount; } public function setup() { $this->amounts['partial'] = self::createAmount(); $amount = self::createAmount(); $amount->setDetails(AmountDetailsTest::createAmountDetails()); $this->amounts['full'] = $amount; } public function testGetterSetter() { $this->assertEquals(self::$currency, $this->amounts['partial']->getCurrency()); $this->assertEquals(self::$total, $this->amounts['partial']->getTotal()); $this->assertEquals(AmountDetailsTest::$fee, $this->amounts['full']->getDetails()->getFee()); } public function testSerializeDeserialize() { $a1 = $this->amounts['partial']; $a2 = new Amount(); $a2->fromJson($a1->toJson()); $this->assertEquals($a1, $a2); } }