public function CountryConstraintValidatorTest::setUp in Address 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ Plugin/ Validation/ Constraint/ CountryConstraintValidatorTest.php, line 36
Class
- CountryConstraintValidatorTest
- @coversDefaultClass \Drupal\address\Plugin\Validation\Constraint\CountryConstraintValidator @group address
Namespace
Drupal\Tests\address\Unit\Plugin\Validation\ConstraintCode
public function setUp() : void {
$country_repository = $this
->prophesize(CountryRepositoryInterface::class);
$country_repository
->getList()
->willReturn([
'RS' => 'Serbia',
'FR' => 'France',
]);
$this->constraint = new CountryConstraint([
'availableCountries' => [
'FR',
],
]);
$this->validator = new CountryConstraintValidator($country_repository
->reveal());
}