function UploadedFileValidatorTest::testValidateSuccess

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

@covers ::validate

File

core/modules/file/tests/src/Kernel/Validation/UploadedFileValidatorTest.php, line 72

Class

UploadedFileValidatorTest
Tests the uploaded file validator.

Namespace

Drupal\Tests\file\Kernel\Validation

Code

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

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