Пример #1
0
 public function testFromArray()
 {
     $list = array('supplier.address.id' => 1, 'supplier.address.refid' => 2, 'supplier.address.salutation' => 'mr', 'supplier.address.company' => 'mw', 'supplier.address.vatid' => 'vatnumber', 'supplier.address.title' => 'dr', 'supplier.address.firstname' => 'first', 'supplier.address.lastname' => 'last', 'supplier.address.address1' => 'street', 'supplier.address.address2' => 'no', 'supplier.address.address3' => 'flat', 'supplier.address.postal' => '12345', 'supplier.address.city' => 'city', 'supplier.address.state' => 'state', 'supplier.address.countryid' => 'DE', 'supplier.address.languageid' => 'de', 'supplier.address.telephone' => '01234', 'supplier.address.telefax' => '02345', 'supplier.address.email' => 'a@b', 'supplier.address.website' => 'example.com', 'supplier.address.flag' => 3, 'supplier.address.position' => 4);
     $object = new \Aimeos\MShop\Common\Item\Address\Standard('supplier.address.');
     $unknown = $object->fromArray($list);
     $this->assertEquals(array(), $unknown);
     $this->assertEquals($list['supplier.address.id'], $object->getId());
     $this->assertEquals($list['supplier.address.refid'], $object->getRefId());
     $this->assertEquals($list['supplier.address.salutation'], $object->getSalutation());
     $this->assertEquals($list['supplier.address.company'], $object->getCompany());
     $this->assertEquals($list['supplier.address.vatid'], $object->getVatID());
     $this->assertEquals($list['supplier.address.title'], $object->getTitle());
     $this->assertEquals($list['supplier.address.firstname'], $object->getFirstname());
     $this->assertEquals($list['supplier.address.lastname'], $object->getLastname());
     $this->assertEquals($list['supplier.address.address1'], $object->getAddress1());
     $this->assertEquals($list['supplier.address.address2'], $object->getAddress2());
     $this->assertEquals($list['supplier.address.address3'], $object->getAddress3());
     $this->assertEquals($list['supplier.address.postal'], $object->getPostal());
     $this->assertEquals($list['supplier.address.city'], $object->getCity());
     $this->assertEquals($list['supplier.address.state'], $object->getState());
     $this->assertEquals($list['supplier.address.countryid'], $object->getCountryId());
     $this->assertEquals($list['supplier.address.languageid'], $object->getLanguageId());
     $this->assertEquals($list['supplier.address.telephone'], $object->getTelephone());
     $this->assertEquals($list['supplier.address.telefax'], $object->getTelefax());
     $this->assertEquals($list['supplier.address.email'], $object->getEmail());
     $this->assertEquals($list['supplier.address.website'], $object->getWebsite());
     $this->assertEquals($list['supplier.address.flag'], $object->getFlag());
     $this->assertEquals($list['supplier.address.position'], $object->getPosition());
 }