You are here

protected function AbstractConstraintValidatorTest::setUp in Plug 7

6 calls to AbstractConstraintValidatorTest::setUp()
CountryValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php
CurrencyValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php
FileValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
ImageValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php
LanguageValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php

... See full list

6 methods override AbstractConstraintValidatorTest::setUp()
CountryValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php
CurrencyValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php
FileValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
ImageValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php
LanguageValidatorTest::setUp in lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php

... See full list

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php, line 60

Class

AbstractConstraintValidatorTest
@since 2.5.3

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

protected function setUp() {
  if (Validation::API_VERSION_2_5 !== $this
    ->getApiVersion()) {
    $this
      ->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
  }
  $this->group = 'MyGroup';
  $this->metadata = null;
  $this->object = null;
  $this->value = 'InvalidValue';
  $this->root = 'root';
  $this->propertyPath = 'property.path';

  // Initialize the context with some constraint so that we can
  // successfully build a violation.
  // The 2.4 API does not keep a reference to the current
  // constraint yet. There the violation stores null.
  $this->constraint = Validation::API_VERSION_2_4 === $this
    ->getApiVersion() ? null : new NotNull();
  $this->context = $this
    ->createContext();
  $this->validator = $this
    ->createValidator();
  $this->validator
    ->initialize($this->context);
  \Locale::setDefault('en');
  $this
    ->setDefaultTimezone('UTC');
}