FileUserTest.php in Commerce File 8.2
File
tests/src/Functional/FileUserTest.php
View source
<?php
namespace Drupal\Tests\commerce_file\Functional;
class FileUserTest extends FileBrowserTestBase {
public function testFilesView() {
$this
->drupalGet('/user/' . $this->user
->id() . '/files');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('No files yet.');
$this
->createEntity('commerce_license', [
'type' => 'commerce_file',
'product_variation' => $this->variation,
'state' => 'active',
'uid' => $this->user
->id(),
'file_download_limit' => 2,
'expiration_type' => [
'target_plugin_id' => 'unlimited',
'target_plugin_configuration' => [],
],
]);
$this
->getSession()
->reload();
$this
->assertSession()
->pageTextContains($this->files[0]
->getFilename());
$this
->clickLink($this->files[0]
->getFilename());
}
}