コード例 #1
0
ファイル: StandardTest.php プロジェクト: aimeos/aimeos-core
 public function testFromArray()
 {
     $item = new \Aimeos\MShop\Price\Item\Standard();
     $list = array('price.id' => 1, 'price.typeid' => 2, 'price.type' => 'test', 'price.typename' => 'Test', 'price.label' => 'test item', 'price.currencyid' => 'EUR', 'price.quantity' => 3, 'price.value' => '10.00', 'price.costs' => '5.00', 'price.rebate' => '2.00', 'price.taxvalue' => '3.00', 'price.taxrate' => '20.00', 'price.taxflag' => false, 'price.status' => 0);
     $unknown = $item->fromArray($list);
     $this->assertEquals(array(), $unknown);
     $this->assertEquals($list['price.id'], $item->getId());
     $this->assertEquals($list['price.typeid'], $item->getTypeId());
     $this->assertEquals($list['price.label'], $item->getLabel());
     $this->assertEquals($list['price.currencyid'], $item->getCurrencyId());
     $this->assertEquals($list['price.quantity'], $item->getQuantity());
     $this->assertEquals($list['price.value'], $item->getValue());
     $this->assertEquals($list['price.costs'], $item->getCosts());
     $this->assertEquals($list['price.rebate'], $item->getRebate());
     $this->assertEquals($list['price.taxvalue'], $item->getTaxValue());
     $this->assertEquals($list['price.taxrate'], $item->getTaxRate());
     $this->assertEquals($list['price.taxflag'], $item->getTaxFlag());
     $this->assertEquals($list['price.status'], $item->getStatus());
     $this->assertNull($item->getSiteId());
     $this->assertNull($item->getTypeName());
     $this->assertNull($item->getType());
 }