You are here

public function FileValidatorTest::testMaxSizeNotExceeded in Plug 7

@dataProvider provideMaxSizeNotExceededTests

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php, line 214

Class

FileValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testMaxSizeNotExceeded($bytesWritten, $limit) {
  fseek($this->file, $bytesWritten - 1, SEEK_SET);
  fwrite($this->file, '0');
  fclose($this->file);
  $constraint = new File(array(
    'maxSize' => $limit,
    'maxSizeMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($this
    ->getFile($this->path), $constraint);
  $this
    ->assertNoViolation();
}