You are here

public function ReportFileSystemTest::testDirectoryScan in Forena Reports 8

Determine if the object scanning work.

File

tests/src/Unit/File/ReportFileSystemTest.php, line 32
Implements ReportFileSystemTest

Class

ReportFileSystemTest
@require module forena @group Forena @coversDefaultClass \Drupal\forena\File\ReportFileSystem

Namespace

Drupal\Tests\forena\Unit\File

Code

public function testDirectoryScan() {
  $this
    ->reportFileSystem()
    ->scan();

  // Retrieve cache entry
  $o = $this
    ->reportFileSystem()
    ->getMetaData('sample.frx');
  $this
    ->assertContains('sample.frx', $o->file);

  // Check for metadata
  $this
    ->assertObjectHasAttribute('metaData', $o);

  // Retrieve the README from the reports directory
  $o = $this
    ->reportFileSystem()
    ->getMetaData('README.txt');
  $this
    ->assertNotNull($o);
  $this
    ->assertContains('README', $o->file);
}