/**
  * @covers ::setUsages
  * @covers ::getUsages
  */
 function testGetUsage()
 {
     $usage = new Usage();
     $usage->setStart('1813-01-01')->setEnd(date('o') + 1 . '-02-28');
     $this->assertSame($this->sut, $this->sut->setUsages([$usage]));
     $this->assertSame([$usage], $this->sut->getUsages());
 }
 /**
  * @covers ::setCountryCode
  * @covers ::getCountryCode
  */
 public function testGetCountryCode()
 {
     $country_code = 'foo' . mt_rand();
     $this->assertSame($this->sut, $this->sut->setCountryCode($country_code));
     $this->assertSame($country_code, $this->sut->getCountryCode());
 }
 /**
  * {@inheritdoc}
  */
 public function __construct(array $values, $entity_type)
 {
     if (isset($values['usages'])) {
         $usages_data = $values['usages'];
         $values['usages'] = [];
         foreach ($usages_data as $usage_data) {
             $usage = new Usage();
             $usage->setStart($usage_data['start'])->setEnd($usage_data['end'])->setCountryCode($usage_data['countryCode']);
             $values['usages'][] = $usage;
         }
     }
     parent::__construct($values, $entity_type);
 }