expectException(\InvalidArgumentException::class); $definition = [ 'country_code' => 'US', ]; $subdivision = new Subdivision($definition); } /** * @covers ::__construct * @covers ::getParent * @covers ::getCountryCode * @covers ::getLocale * @covers ::getCode * @covers ::getLocalCode * @covers ::getName * @covers ::getLocalName * @covers ::getIsoCode * @covers ::getPostalCodePattern * @covers ::getPostalCodePatternType * @covers ::getChildren * @covers ::hasChildren */ public function testValid() { $mockBuilder = $this->getMockBuilder('CommerceGuys\Addressing\Subdivision\Subdivision'); $mockBuilder = $mockBuilder->disableOriginalConstructor(); $parent = $mockBuilder->getMock(); $children = new ArrayCollection([$mockBuilder->getMock(), $mockBuilder->getMock()]); $definition = [ 'parent' => $parent, 'country_code' => 'US', 'locale' => 'en', 'code' => 'CA', 'local_code' => 'CA!', 'name' => 'California', 'local_name' => 'California!', 'iso_code' => 'US-CA', 'postal_code_pattern' => '9[0-5]|96[01]', 'postal_code_pattern_type' => PatternType::START, 'children' => $children, ]; $subdivision = new Subdivision($definition); $this->assertEquals($definition['parent'], $subdivision->getParent()); $this->assertEquals($definition['country_code'], $subdivision->getCountryCode()); $this->assertEquals($definition['locale'], $subdivision->getLocale()); $this->assertEquals($definition['code'], $subdivision->getCode()); $this->assertEquals($definition['local_code'], $subdivision->getLocalCode()); $this->assertEquals($definition['name'], $subdivision->getName()); $this->assertEquals($definition['local_name'], $subdivision->getLocalName()); $this->assertEquals($definition['iso_code'], $subdivision->getIsoCode()); $this->assertEquals($definition['postal_code_pattern'], $subdivision->getPostalCodePattern()); $this->assertEquals($definition['postal_code_pattern_type'], $subdivision->getPostalCodePatternType()); $this->assertEquals($definition['children'], $subdivision->getChildren()); $this->assertTrue($subdivision->hasChildren()); } } __halt_compiler();----SIGNATURE:----goRPGsfqzJL0G41AI/wFq1vgcXTeCs0M4L5SZ5Xak/M0yDdbOMERIf/TN9IVQJgE7xgZnT8t7qnSrx+jYWB5rB4n1oekGkuARNyXD1EIC3o/1gJOKvosYvwkydMIXABIel38xk2Zlh0A0+d9s67WabttKNg1B4PRotfMNngEmcucWOR5K/ERYknrqbbrbCWQr8N08Q7tqzCMQaOTfwobWiYMsksXdt1TMRF+OiU+bpCYuhcNoIn2Nsl+tOqqCpZoHhBN+JobMRqsvyvFjjGv5RkI2TFSIUMbGf9oxdpr9evhqO/ItvfwL3cVKHfNIytXC5eBlTyIQ3hUQegkbKU5f2gHKTSEbDFg6wHK0/TkAhV+HJYgVLvK3lXoM6T7kcsAo4IU8hwteae7sKkdEXnAilNKToQc1VdnwJKMuhpLpJSFEz0sAs01dgiqp9JT+JtFziNtv5M00dcbj/l+owXRsMEYwZVYTi53mY1F0gTRuVKZzUrZSHzAwAl5O3fyKhXx3RbBOe7bhAbjLXqiZLRGRwcEOnk3+refa/9ydIWQcS7kzvhdbuSqs2bUuauNMj2rdxz39NFEMe7O2gGDVg+RNjjekQvghKr7NAgJX51C7Rmn08+nI4wdG/M0Ygp2jbsTRPPdXK8uesGWfhcuogEnrN+xyN5L4Ex3s1ISJUu420A=----ATTACHMENT:----MzgzMTU3NTczMjg1MzAwOSA4Mjc2NDUwMjU4MTk0OTY3IDYzNzE4MjEwMjU5ODU0OTc=