protected function assertCategoryContents(Category $obj, array $data) { $this->assertEquals($data['id'], $obj->getId()); $this->assertEquals($data['is_brand_eligible'], $obj->isBrandEligible()); $whilteListCountries = isset($data['whitelist']['countries']) ? $data['whitelist']['countries'] : array(); $whilteListCountriesAndBrands = isset($data['whitelist']['countries_and_brands']) ? $data['whitelist']['countries_and_brands'] : array(); $whilteListRegionsAndBrands = isset($data['whitelist']['regions_and_brands']) ? $data['whitelist']['regions_and_brands'] : array(); $this->assertCount(count($this->getArray($whilteListCountries)), $obj->getCountries()); $this->assertCount(count($this->getArray($whilteListCountriesAndBrands)), $obj->getCountriesBrands()); $this->assertEquals(new \DateTime($data['last_modified']), $obj->getLastModified()); $this->assertEquals($data['name'], $obj->getName()); $this->assertCount(count($this->getArray($whilteListRegionsAndBrands)), $obj->getRegionsBrands()); $this->assertEquals($data['requires_whitelist'], $obj->requiresWhitelist()); $this->assertEquals($data['requires_whitelist_on_external'], $obj->requiresWhitelistOnExternal()); $this->assertEquals($data['requires_whitelist_on_managed'], $obj->requiresWhitelistOnManaged()); $this->assertEquals($data['is_sensitive'], $obj->isSensitive()); $this->assertInternalType('int', $obj->getId()); $this->assertInternalType('bool', $obj->isBrandEligible()); $this->assertInternalType('array', $obj->getCountries()); $this->assertInternalType('array', $obj->getCountriesBrands()); $this->assertInstanceOf('\\DateTime', $obj->getLastModified()); $this->assertInternalType('string', $obj->getName()); $this->assertInternalType('array', $obj->getRegionsBrands()); $this->assertInternalType('bool', $obj->requiresWhitelist()); $this->assertInternalType('bool', $obj->requiresWhitelistOnExternal()); $this->assertInternalType('bool', $obj->requiresWhitelistOnManaged()); $this->assertInternalType('bool', $obj->isSensitive()); }