You are here

public function LicenseFileManagerTest::testIsLicensable in Commerce File 8.2

@covers ::isLicensable

File

tests/src/Kernel/LicenseFileManagerTest.php, line 117

Class

LicenseFileManagerTest
Tests the license file manager.

Namespace

Drupal\Tests\commerce_file\Kernel

Code

public function testIsLicensable() {
  $this
    ->assertTrue($this->licenseFileManager
    ->isLicensable($this->file));
  $another_file = File::create([
    'uid' => 1,
    'filename' => $this
      ->randomMachineName(),
    'uri' => 'private://test2.txt',
    'filemime' => 'text/plain',
    'status' => FILE_STATUS_PERMANENT,
  ]);
  $another_file
    ->save();
  $this
    ->assertFalse($this->licenseFileManager
    ->isLicensable($another_file));
}