ReportManagerTest.php in Forena Reports 8
File
tests/src/Unit/ReportManagerTest.php
View source
<?php
namespace Drupal\Tests\forena\Unit;
use Drupal\forena\ReportManager;
class ReportManagerTest extends FrxTestCase {
public function testReportName() {
$r = ReportManager::instance();
$report_name = 'test';
$ext = $r
->formatFromPath($report_name);
$this
->assertEquals('test', $report_name);
$this
->assertEquals('drupal', $ext);
$report_name = 'test.csv';
$ext = $r
->formatFromPath($report_name);
$this
->assertEquals('test', $report_name);
$this
->assertEquals('csv', $ext);
$report_name = 'test.unsupported';
$ext = $r
->formatFromPath($report_name);
$this
->assertEquals('test.unsupported', $report_name);
$this
->assertEquals('drupal', $ext);
}
public function testReportInclude() {
$doc = $this
->getDocument();
$doc
->clear();
ReportManager::instance()
->reportInclude('sample');
$content = $doc
->flush();
$output = $content['report']['#template'];
$this
->assertContains('col1', $output);
}
}