function UploadedFileConstraintValidatorTest::testValidateSuccess

Same name in other branches
  1. 10 core/modules/file/tests/src/Kernel/Validation/UploadedFileConstraintValidatorTest.php \Drupal\Tests\file\Kernel\Validation\UploadedFileConstraintValidatorTest::testValidateSuccess()

@covers ::validate

File

core/modules/file/tests/src/Kernel/Validation/UploadedFileConstraintValidatorTest.php, line 70

Class

UploadedFileConstraintValidatorTest
Tests the uploaded file validator.

Namespace

Drupal\Tests\file\Kernel\Validation

Code

public function testValidateSuccess() : void {
    $uploadedFile = new FormUploadedFile(new UploadedFile(path: $this->path, originalName: $this->filename, test: TRUE));
    $violations = $uploadedFile->validate($this->validator);
    $this->assertCount(0, $violations);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.