You are here

public function DrupalTest::testWrite in Forena Reports 8

File

tests/src/Unit/Document/DrupalTest.php, line 25

Class

DrupalTest
Test Drupal Document Features @group Forena @require module forena @coversDefaultClass \Drupal\forena\FrxPlugin\Document\Drupal

Namespace

Drupal\Tests\forena\Unit\Document

Code

public function testWrite() {
  DocManager::instance()
    ->setDocument("drupal");
  $doc = DocManager::instance()
    ->getDocument();
  $foo = 'hello';
  $doc
    ->clear();
  $doc
    ->write('hello ');
  $doc
    ->write('world');
  $buffer1 = $doc
    ->flush();
  $this
    ->assertEquals('hello world', $buffer1['report']['#template']);
  $doc
    ->clear();
  $doc
    ->write('this ');
  $doc
    ->write('day');
  $buffer2 = $doc
    ->flush();
  $this
    ->assertEquals('this day', $buffer2['report']['#template']);
  $this
    ->assertFalse($buffer1['report']['#template'] == $buffer2['report']['#template']);
}