Exemple #1
0
 /**
  * @return array
  */
 public function sourceDataProvider()
 {
     $address1 = new Address();
     $address2 = new Address();
     $badSource = null;
     $region1 = new BAPRegion(self::TEST_REGION_COMBINED_CODE);
     $region1->setName(self::TEST_REGION_NAME);
     $address1->setRegion($region1);
     $address2->setRegionText(self::TEST_REGION_NAME);
     return ['take region from address, found in magento DB, use region ID' => [$address1, true, ['region' => null, 'region_id' => self::TEST_MAGENTO_REGION_ID]], 'take region from address, not found in magento DB, use region name' => [$address1, false, ['region' => self::TEST_REGION_NAME, 'region_id' => null]], 'region not set, use region text' => [$address2, null, ['region' => self::TEST_REGION_NAME, 'region_id' => null]], 'bad type given' => [$badSource, null, null, '\\InvalidArgumentException']];
 }
Exemple #2
0
 public function testToString()
 {
     $obj = new Region('combinedCode');
     $obj->setName('name');
     $this->assertEquals('name', $obj->__toString());
 }