You are here

public function LicenseFileManagerTest::testShouldLogDownload in Commerce File 8.2

@covers ::shouldLogDownload

File

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

Class

LicenseFileManagerTest
Tests the license file manager.

Namespace

Drupal\Tests\commerce_file\Kernel

Code

public function testShouldLogDownload() {
  $account = $this
    ->createUser([], [
    'bypass license control',
  ]);
  $this
    ->assertFalse($this->licenseFileManager
    ->shouldLogDownload($this->license, $account));
  $account = $this
    ->createUser([], [
    'administer commerce_license',
  ]);
  $this
    ->assertFalse($this->licenseFileManager
    ->shouldLogDownload($this->license, $account));
  $this
    ->assertTrue($this->licenseFileManager
    ->shouldLogDownload($this->license, $this->license
    ->getOwner()));
}