| Total Complexity | 61 | 
| Total Lines | 605 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
Complex classes like StandardTest often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use StandardTest, and based on these observations, apply Extract Interface, too.
| 1 | <?php | ||
| 12 | class StandardTest extends \PHPUnit\Framework\TestCase | ||
| 13 | { | ||
| 14 | private $object; | ||
| 15 | private $values; | ||
| 16 | |||
| 17 | |||
| 18 | protected function setUp() : void | ||
| 19 | 	{ | ||
| 20 | $this->values = array( | ||
| 21 | 'supplier.address.id' => 23, | ||
| 22 | 'supplier.address.siteid' => 12, | ||
| 23 | 'supplier.address.parentid' => 'referenceid', | ||
| 24 | 'supplier.address.type' => 'test', | ||
| 25 | 'supplier.address.company' => 'unitCompany', | ||
| 26 | 'supplier.address.vatid' => 'DE999999999', | ||
| 27 | 'supplier.address.salutation' => 'mr', | ||
| 28 | 'supplier.address.title' => 'Herr', | ||
| 29 | 'supplier.address.firstname' => 'firstunit', | ||
| 30 | 'supplier.address.lastname' => 'lastunit', | ||
| 31 | 'supplier.address.address1' => 'unit str.', | ||
| 32 | 'supplier.address.address2' => '166', | ||
| 33 | 'supplier.address.address3' => '4.OG', | ||
| 34 | 'supplier.address.postal' => '22769', | ||
| 35 | 'supplier.address.city' => 'Hamburg', | ||
| 36 | 'supplier.address.state' => 'Hamburg', | ||
| 37 | 'supplier.address.countryid' => 'DE', | ||
| 38 | 'supplier.address.languageid' => 'de', | ||
| 39 | 'supplier.address.telephone' => '05554433221', | ||
| 40 | 'supplier.address.telefax' => '05554433222', | ||
| 41 | 'supplier.address.mobile' => '05554433223', | ||
| 42 | 'supplier.address.email' => '[email protected]', | ||
| 43 | 'supplier.address.website' => 'www.example.com', | ||
| 44 | 'supplier.address.longitude' => '10.0', | ||
| 45 | 'supplier.address.latitude' => '50.0', | ||
| 46 | 'supplier.address.position' => 1, | ||
| 47 | 'supplier.address.birthday' => '2001-01-01', | ||
| 48 | 'supplier.address.mtime' => '2011-01-01 00:00:02', | ||
| 49 | 'supplier.address.ctime' => '2011-01-01 00:00:01', | ||
| 50 | 'supplier.address.editor' => 'unitTestUser', | ||
| 51 | ); | ||
| 52 | |||
| 53 | $this->object = new \Aimeos\MShop\Supplier\Item\Address\Standard( 'supplier.address.', $this->values ); | ||
| 54 | } | ||
| 55 | |||
| 56 | |||
| 57 | protected function tearDown() : void | ||
| 58 | 	{ | ||
| 59 | $this->object = null; | ||
| 60 | } | ||
| 61 | |||
| 62 | |||
| 63 | public function testGetId() | ||
| 64 | 	{ | ||
| 65 | $this->assertEquals( 23, $this->object->getId() ); | ||
| 66 | } | ||
| 67 | |||
| 68 | |||
| 69 | public function testSetId() | ||
| 70 | 	{ | ||
| 71 | $return = $this->object->setId( null ); | ||
| 72 | |||
| 73 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 74 | $this->assertNull( $this->object->getId() ); | ||
| 75 | $this->assertTrue( $this->object->isModified() ); | ||
| 76 | } | ||
| 77 | |||
| 78 | |||
| 79 | public function testGetParentId() | ||
| 80 | 	{ | ||
| 81 | $this->assertEquals( 'referenceid', $this->object->getParentId() ); | ||
| 82 | } | ||
| 83 | |||
| 84 | |||
| 85 | public function testSetParentId() | ||
| 86 | 	{ | ||
| 87 | $return = $this->object->setParentId( 'unitreference' ); | ||
| 88 | |||
| 89 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 90 | $this->assertEquals( 'unitreference', $this->object->getParentId() ); | ||
| 91 | $this->assertTrue( $this->object->isModified() ); | ||
| 92 | } | ||
| 93 | |||
| 94 | |||
| 95 | public function testGetType() | ||
| 96 | 	{ | ||
| 97 | $this->assertEquals( 'test', $this->object->getType() ); | ||
| 98 | } | ||
| 99 | |||
| 100 | |||
| 101 | public function testSetType() | ||
| 102 | 	{ | ||
| 103 | $return = $this->object->setType( 'delivery' ); | ||
| 104 | |||
| 105 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 106 | $this->assertEquals( 'delivery', $this->object->getType() ); | ||
| 107 | $this->assertTrue( $this->object->isModified() ); | ||
| 108 | } | ||
| 109 | |||
| 110 | |||
| 111 | public function testGetCompany() | ||
| 112 | 	{ | ||
| 113 | $this->assertEquals( 'unitCompany', $this->object->getCompany() ); | ||
| 114 | } | ||
| 115 | |||
| 116 | |||
| 117 | public function testSetCompany() | ||
| 118 | 	{ | ||
| 119 | $return = $this->object->setCompany( 'company' ); | ||
| 120 | |||
| 121 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 122 | $this->assertEquals( 'company', $this->object->getCompany() ); | ||
| 123 | $this->assertTrue( $this->object->isModified() ); | ||
| 124 | } | ||
| 125 | |||
| 126 | |||
| 127 | public function testGetVatID() | ||
| 128 | 	{ | ||
| 129 | $this->assertEquals( 'DE999999999', $this->object->getVatID() ); | ||
| 130 | } | ||
| 131 | |||
| 132 | |||
| 133 | public function testSetVatID() | ||
| 134 | 	{ | ||
| 135 | $return = $this->object->setVatID( 'vatid' ); | ||
| 136 | |||
| 137 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 138 | $this->assertEquals( 'vatid', $this->object->getVatID() ); | ||
| 139 | $this->assertTrue( $this->object->isModified() ); | ||
| 140 | } | ||
| 141 | |||
| 142 | |||
| 143 | public function testGetSalutation() | ||
| 144 | 	{ | ||
| 145 | $this->assertEquals( 'mr', $this->object->getSalutation() ); | ||
| 146 | } | ||
| 147 | |||
| 148 | |||
| 149 | public function testSetSalutation() | ||
| 150 | 	{ | ||
| 151 | $return = $this->object->setSalutation( 'company' ); | ||
| 152 | |||
| 153 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 154 | $this->assertEquals( 'company', $this->object->getSalutation() ); | ||
| 155 | $this->assertTrue( $this->object->isModified() ); | ||
| 156 | } | ||
| 157 | |||
| 158 | |||
| 159 | public function testGetTitle() | ||
| 160 | 	{ | ||
| 161 | $this->assertEquals( 'Herr', $this->object->getTitle() ); | ||
| 162 | } | ||
| 163 | |||
| 164 | |||
| 165 | public function testSetTitle() | ||
| 166 | 	{ | ||
| 167 | $return = $this->object->setTitle( 'Dr.' ); | ||
| 168 | |||
| 169 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 170 | $this->assertEquals( 'Dr.', $this->object->getTitle() ); | ||
| 171 | $this->assertTrue( $this->object->isModified() ); | ||
| 172 | } | ||
| 173 | |||
| 174 | |||
| 175 | public function testGetFirstname() | ||
| 176 | 	{ | ||
| 177 | $this->assertEquals( 'firstunit', $this->object->getFirstname() ); | ||
| 178 | } | ||
| 179 | |||
| 180 | |||
| 181 | public function testSetFirstname() | ||
| 182 | 	{ | ||
| 183 | $return = $this->object->setFirstname( 'hans' ); | ||
| 184 | |||
| 185 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 186 | $this->assertEquals( 'hans', $this->object->getFirstname() ); | ||
| 187 | $this->assertTrue( $this->object->isModified() ); | ||
| 188 | } | ||
| 189 | |||
| 190 | |||
| 191 | public function testGetLastname() | ||
| 192 | 	{ | ||
| 193 | $this->assertEquals( 'lastunit', $this->object->getLastname() ); | ||
| 194 | } | ||
| 195 | |||
| 196 | |||
| 197 | public function testSetLastname() | ||
| 198 | 	{ | ||
| 199 | $return = $this->object->setLastname( 'im Glueck' ); | ||
| 200 | |||
| 201 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 202 | $this->assertEquals( 'im Glueck', $this->object->getLastname() ); | ||
| 203 | $this->assertTrue( $this->object->isModified() ); | ||
| 204 | } | ||
| 205 | |||
| 206 | |||
| 207 | public function testGetAddress1() | ||
| 208 | 	{ | ||
| 209 | $this->assertEquals( 'unit str.', $this->object->getAddress1() ); | ||
| 210 | } | ||
| 211 | |||
| 212 | |||
| 213 | public function testSetAddress1() | ||
| 214 | 	{ | ||
| 215 | $return = $this->object->setAddress1( 'unitallee' ); | ||
| 216 | |||
| 217 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 218 | $this->assertEquals( 'unitallee', $this->object->getAddress1() ); | ||
| 219 | $this->assertTrue( $this->object->isModified() ); | ||
| 220 | } | ||
| 221 | |||
| 222 | |||
| 223 | public function testGetAddress2() | ||
| 224 | 	{ | ||
| 225 | $this->assertEquals( '166', $this->object->getAddress2() ); | ||
| 226 | } | ||
| 227 | |||
| 228 | |||
| 229 | public function testSetAddress2() | ||
| 230 | 	{ | ||
| 231 | $return = $this->object->setAddress2( '12' ); | ||
| 232 | |||
| 233 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 234 | $this->assertEquals( '12', $this->object->getAddress2() ); | ||
| 235 | $this->assertTrue( $this->object->isModified() ); | ||
| 236 | } | ||
| 237 | |||
| 238 | |||
| 239 | public function testGetAddress3() | ||
| 240 | 	{ | ||
| 241 | $this->assertEquals( '4.OG', $this->object->getAddress3() ); | ||
| 242 | } | ||
| 243 | |||
| 244 | |||
| 245 | public function testSetAddress3() | ||
| 246 | 	{ | ||
| 247 | $return = $this->object->setAddress3( 'EG' ); | ||
| 248 | |||
| 249 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 250 | $this->assertEquals( 'EG', $this->object->getAddress3() ); | ||
| 251 | $this->assertTrue( $this->object->isModified() ); | ||
| 252 | } | ||
| 253 | |||
| 254 | |||
| 255 | public function testGetPostal() | ||
| 256 | 	{ | ||
| 257 | $this->assertEquals( '22769', $this->object->getPostal() ); | ||
| 258 | } | ||
| 259 | |||
| 260 | |||
| 261 | public function testSetPostal() | ||
| 262 | 	{ | ||
| 263 | $return = $this->object->setPostal( '11111' ); | ||
| 264 | |||
| 265 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 266 | $this->assertEquals( '11111', $this->object->getPostal() ); | ||
| 267 | $this->assertTrue( $this->object->isModified() ); | ||
| 268 | } | ||
| 269 | |||
| 270 | |||
| 271 | public function testGetCity() | ||
| 272 | 	{ | ||
| 273 | $this->assertEquals( 'Hamburg', $this->object->getCity() ); | ||
| 274 | } | ||
| 275 | |||
| 276 | |||
| 277 | public function testSetCity() | ||
| 278 | 	{ | ||
| 279 | $return = $this->object->setCity( 'unitCity' ); | ||
| 280 | |||
| 281 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 282 | $this->assertEquals( 'unitCity', $this->object->getCity() ); | ||
| 283 | $this->assertTrue( $this->object->isModified() ); | ||
| 284 | } | ||
| 285 | |||
| 286 | |||
| 287 | public function testGetState() | ||
| 290 | } | ||
| 291 | |||
| 292 | |||
| 293 | public function testSetState() | ||
| 294 | 	{ | ||
| 295 | $return = $this->object->setState( 'unitState' ); | ||
| 296 | |||
| 297 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 298 | $this->assertEquals( 'unitState', $this->object->getState() ); | ||
| 299 | $this->assertTrue( $this->object->isModified() ); | ||
| 300 | } | ||
| 301 | |||
| 302 | |||
| 303 | public function testGetCountryId() | ||
| 304 | 	{ | ||
| 305 | $this->assertEquals( 'DE', $this->object->getCountryId() ); | ||
| 306 | } | ||
| 307 | |||
| 308 | |||
| 309 | public function testSetCountryId() | ||
| 316 | } | ||
| 317 | |||
| 318 | |||
| 319 | public function testGetLanguageId() | ||
| 320 | 	{ | ||
| 321 | $this->assertEquals( 'de', $this->object->getLanguageId() ); | ||
| 322 | } | ||
| 323 | |||
| 324 | |||
| 325 | public function testSetLanguageId() | ||
| 326 | 	{ | ||
| 327 | $return = $this->object->setLanguageId( 'en' ); | ||
| 328 | |||
| 329 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 330 | $this->assertEquals( 'en', $this->object->getLanguageId() ); | ||
| 331 | $this->assertTrue( $this->object->isModified() ); | ||
| 332 | } | ||
| 333 | |||
| 334 | |||
| 335 | public function testGetTelephone() | ||
| 336 | 	{ | ||
| 337 | $this->assertEquals( '05554433221', $this->object->getTelephone() ); | ||
| 338 | } | ||
| 339 | |||
| 340 | |||
| 341 | public function testSetTelephone() | ||
| 342 | 	{ | ||
| 343 | $return = $this->object->setTelephone( '55512345' ); | ||
| 344 | |||
| 345 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 346 | $this->assertEquals( '55512345', $this->object->getTelephone() ); | ||
| 347 | $this->assertTrue( $this->object->isModified() ); | ||
| 348 | } | ||
| 349 | |||
| 350 | |||
| 351 | public function testGetTelefax() | ||
| 352 | 	{ | ||
| 353 | $this->assertEquals( '05554433222', $this->object->getTelefax() ); | ||
| 354 | } | ||
| 355 | |||
| 356 | |||
| 357 | public function testSetTelefax() | ||
| 358 | 	{ | ||
| 359 | $return = $this->object->setTelefax( '55512345' ); | ||
| 360 | |||
| 361 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 362 | $this->assertEquals( '55512345', $this->object->getTelefax() ); | ||
| 363 | $this->assertTrue( $this->object->isModified() ); | ||
| 364 | } | ||
| 365 | |||
| 366 | |||
| 367 | public function testGetMobile() | ||
| 368 | 	{ | ||
| 369 | $this->assertEquals( '05554433223', $this->object->getMobile() ); | ||
| 370 | } | ||
| 371 | |||
| 372 | |||
| 373 | public function testSetMobile() | ||
| 374 | 	{ | ||
| 375 | $return = $this->object->setMobile( '555123456' ); | ||
| 376 | |||
| 377 | $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Address\Iface::class, $return ); | ||
| 378 | $this->assertEquals( '555123456', $this->object->getMobile() ); | ||
| 379 | $this->assertTrue( $this->object->isModified() ); | ||
| 380 | } | ||
| 381 | |||
| 382 | |||
| 383 | public function testGetEmail() | ||
| 384 | 	{ | ||
| 385 | $this->assertEquals( '[email protected]', $this->object->getEmail() ); | ||
| 386 | } | ||
| 387 | |||
| 388 | |||
| 389 | public function testSetEmail() | ||
| 390 | 	{ | ||
| 391 | $return = $this->object->setEmail( '[email protected]' ); | ||
| 392 | |||
| 393 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 394 | $this->assertEquals( '[email protected]', $this->object->getEmail() ); | ||
| 395 | $this->assertTrue( $this->object->isModified() ); | ||
| 396 | |||
| 397 | $this->expectException( \Aimeos\MShop\Exception::class ); | ||
| 398 | $this->object->setEmail( 'unittest.de' ); | ||
| 399 | } | ||
| 400 | |||
| 401 | |||
| 402 | public function testGetWebsite() | ||
| 403 | 	{ | ||
| 404 | $this->assertEquals( 'www.example.com', $this->object->getWebsite() ); | ||
| 405 | } | ||
| 406 | |||
| 407 | |||
| 408 | public function testSetWebsite() | ||
| 409 | 	{ | ||
| 410 | $return = $this->object->setWebsite( 'www.test.de' ); | ||
| 411 | |||
| 412 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 413 | $this->assertEquals( 'www.test.de', $this->object->getWebsite() ); | ||
| 414 | $this->assertTrue( $this->object->isModified() ); | ||
| 415 | |||
| 416 | $this->object->setWebsite( 'http://xn--ses-5ka8l.de' ); | ||
| 417 | $this->object->setWebsite( 'http://www.test.de:443' ); | ||
| 418 | $this->object->setWebsite( 'https://www.test.de:8080/abc?123' ); | ||
| 419 | |||
| 420 | $this->expectException( \Aimeos\MShop\Exception::class ); | ||
| 421 | $this->object->setWebsite( '_test:de' ); | ||
| 422 | } | ||
| 423 | |||
| 424 | |||
| 425 | public function testSetWebsiteHostException() | ||
| 426 | 	{ | ||
| 427 | $this->expectException( \Aimeos\MShop\Exception::class ); | ||
| 428 | $this->object->setWebsite( 'localhost' ); | ||
| 429 | } | ||
| 430 | |||
| 431 | |||
| 432 | public function testGetLongitude() | ||
| 433 | 	{ | ||
| 434 | $this->assertEquals( '10.0', $this->object->getLongitude() ); | ||
| 435 | } | ||
| 436 | |||
| 437 | |||
| 438 | public function testSetLongitude() | ||
| 439 | 	{ | ||
| 440 | $return = $this->object->setLongitude( '10.5' ); | ||
| 441 | |||
| 442 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 443 | $this->assertEquals( '10.5', $this->object->getLongitude() ); | ||
| 444 | $this->assertTrue( $this->object->isModified() ); | ||
| 445 | } | ||
| 446 | |||
| 447 | |||
| 448 | public function testGetLatitude() | ||
| 449 | 	{ | ||
| 450 | $this->assertEquals( '50.0', $this->object->getLatitude() ); | ||
| 451 | } | ||
| 452 | |||
| 453 | |||
| 454 | public function testSetLatitude() | ||
| 455 | 	{ | ||
| 456 | $return = $this->object->setLatitude( '53.5' ); | ||
| 457 | |||
| 458 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 459 | $this->assertEquals( '53.5', $this->object->getLatitude() ); | ||
| 460 | $this->assertTrue( $this->object->isModified() ); | ||
| 461 | } | ||
| 462 | |||
| 463 | |||
| 464 | public function testGetPosition() | ||
| 465 | 	{ | ||
| 466 | $this->assertEquals( 1, $this->object->getPosition() ); | ||
| 467 | } | ||
| 468 | |||
| 469 | |||
| 470 | public function testSetPosition() | ||
| 477 | } | ||
| 478 | |||
| 479 | |||
| 480 | public function testGetTimeModified() | ||
| 481 | 	{ | ||
| 482 | $this->assertEquals( '2011-01-01 00:00:02', $this->object->getTimeModified() ); | ||
| 483 | } | ||
| 484 | |||
| 485 | |||
| 486 | public function testGetTimeCreated() | ||
| 489 | } | ||
| 490 | |||
| 491 | |||
| 492 | public function testGetEditor() | ||
| 493 | 	{ | ||
| 494 | $this->assertEquals( 'unitTestUser', $this->object->editor() ); | ||
| 495 | } | ||
| 496 | |||
| 497 | |||
| 498 | public function testGetResourceType() | ||
| 499 | 	{ | ||
| 500 | $this->assertEquals( 'supplier/address', $this->object->getResourceType() ); | ||
| 501 | } | ||
| 502 | |||
| 503 | |||
| 504 | public function testCopyFrom() | ||
| 505 | 	{ | ||
| 506 | $address = new \Aimeos\MShop\Order\Item\Address\Standard( 'order.address.', [] ); | ||
| 507 | $return = $this->object->copyFrom( $address ); | ||
| 508 | |||
| 509 | $this->assertInstanceOf( \Aimeos\MShop\Supplier\Item\Address\Iface::class, $return ); | ||
| 510 | } | ||
| 511 | |||
| 512 | public function testFromArray() | ||
| 513 | 	{ | ||
| 514 | $list = $entries = array( | ||
| 515 | 'supplier.address.id' => 1, | ||
| 516 | 'supplier.address.parentid' => 2, | ||
| 517 | 'supplier.address.type' => 'delivery', | ||
| 518 | 'supplier.address.salutation' => 'mr', | ||
| 519 | 'supplier.address.company' => 'mw', | ||
| 520 | 'supplier.address.vatid' => 'vatnumber', | ||
| 521 | 'supplier.address.title' => 'dr', | ||
| 522 | 'supplier.address.firstname' => 'first', | ||
| 523 | 'supplier.address.lastname' => 'last', | ||
| 524 | 'supplier.address.address1' => 'street', | ||
| 525 | 'supplier.address.address2' => 'no', | ||
| 526 | 'supplier.address.address3' => 'flat', | ||
| 527 | 'supplier.address.postal' => '12345', | ||
| 528 | 'supplier.address.city' => 'city', | ||
| 529 | 'supplier.address.state' => 'state', | ||
| 530 | 'supplier.address.countryid' => 'DE', | ||
| 531 | 'supplier.address.languageid' => 'de', | ||
| 532 | 'supplier.address.telephone' => '01234', | ||
| 533 | 'supplier.address.telefax' => '02345', | ||
| 534 | 'supplier.address.mobile' => '03456', | ||
| 535 | 'supplier.address.email' => '[email protected]', | ||
| 536 | 'supplier.address.website' => 'example.com', | ||
| 537 | 'supplier.address.longitude' => '10.0', | ||
| 538 | 'supplier.address.latitude' => '53.5', | ||
| 539 | 'supplier.address.birthday' => '2000-01-01', | ||
| 540 | 'supplier.address.position' => 4, | ||
| 541 | ); | ||
| 542 | |||
| 543 | $object = new \Aimeos\MShop\Common\Item\Address\Standard( 'supplier.address.' ); | ||
| 544 | $object = $object->fromArray( $entries, true ); | ||
| 545 | |||
| 546 | $this->assertEquals( [], $entries ); | ||
| 547 | $this->assertEquals( '', $object->getSiteId() ); | ||
| 548 | $this->assertEquals( $list['supplier.address.id'], $object->getId() ); | ||
| 549 | $this->assertEquals( $list['supplier.address.parentid'], $object->getParentId() ); | ||
| 550 | $this->assertEquals( $list['supplier.address.type'], $object->getType() ); | ||
| 551 | $this->assertEquals( $list['supplier.address.salutation'], $object->getSalutation() ); | ||
| 552 | $this->assertEquals( $list['supplier.address.company'], $object->getCompany() ); | ||
| 553 | $this->assertEquals( $list['supplier.address.vatid'], $object->getVatID() ); | ||
| 554 | $this->assertEquals( $list['supplier.address.title'], $object->getTitle() ); | ||
| 555 | $this->assertEquals( $list['supplier.address.firstname'], $object->getFirstname() ); | ||
| 556 | $this->assertEquals( $list['supplier.address.lastname'], $object->getLastname() ); | ||
| 557 | $this->assertEquals( $list['supplier.address.address1'], $object->getAddress1() ); | ||
| 558 | $this->assertEquals( $list['supplier.address.address2'], $object->getAddress2() ); | ||
| 559 | $this->assertEquals( $list['supplier.address.address3'], $object->getAddress3() ); | ||
| 560 | $this->assertEquals( $list['supplier.address.postal'], $object->getPostal() ); | ||
| 561 | $this->assertEquals( $list['supplier.address.city'], $object->getCity() ); | ||
| 562 | $this->assertEquals( $list['supplier.address.state'], $object->getState() ); | ||
| 563 | $this->assertEquals( $list['supplier.address.countryid'], $object->getCountryId() ); | ||
| 564 | $this->assertEquals( $list['supplier.address.languageid'], $object->getLanguageId() ); | ||
| 565 | $this->assertEquals( $list['supplier.address.telephone'], $object->getTelephone() ); | ||
| 566 | $this->assertEquals( $list['supplier.address.telefax'], $object->getTelefax() ); | ||
| 567 | $this->assertEquals( $list['supplier.address.mobile'], $object->getMobile() ); | ||
| 568 | $this->assertEquals( $list['supplier.address.email'], $object->getEmail() ); | ||
| 569 | $this->assertEquals( $list['supplier.address.website'], $object->getWebsite() ); | ||
| 570 | $this->assertEquals( $list['supplier.address.longitude'], $object->getLongitude() ); | ||
| 571 | $this->assertEquals( $list['supplier.address.latitude'], $object->getLatitude() ); | ||
| 572 | $this->assertEquals( $list['supplier.address.position'], $object->getPosition() ); | ||
| 573 | $this->assertEquals( $list['supplier.address.birthday'], $object->getBirthday() ); | ||
| 574 | } | ||
| 575 | |||
| 576 | public function testToArray() | ||
| 612 | } | ||
| 613 | |||
| 614 | public function testIsModified() | ||
| 617 | } | ||
| 618 | } | ||
| 619 |