protected function FileValidatorTest::setUp

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php, line 25

Class

FileValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

protected function setUp() {
  if (!class_exists('Symfony\\Component\\HttpFoundation\\File\\UploadedFile')) {
    $this
      ->markTestSkipped('The "HttpFoundation" component is not available');
  }
  $this->context = $this
    ->getMock('Symfony\\Component\\Validator\\ExecutionContext', array(), array(), '', false);
  $this->validator = new FileValidator();
  $this->validator
    ->initialize($this->context);
  $this->path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'FileValidatorTest';
  $this->file = fopen($this->path, 'w');
}