You are here

public function FrxRendererTestCase::render in Forena Reports 8

Parameters

string $class: Renderer to test

$report: Report text to test with.

Return value

string Outuput of rendered control.

9 calls to FrxRendererTestCase::render()
FrxAjaxTest::testAjaxRender in tests/src/Unit/Renderer/FrxAjaxTest.php
Test for new ajax renderer.
FrxCrosstabTest::testFrxCrosstab in tests/src/Unit/Renderer/FrxCrosstabTest.php
Test Crosstab Renderer
FrxIncludeTest::testRender in tests/src/Unit/Renderer/FrxIncludeTest.php
Test the rendering of the control.
FrxMenuTest::testFrxMenu in tests/src/Unit/Renderer/FrxMenuTest.php
Test FrxXML Renderer
FrxSourceTest::testFrxSource in tests/src/Unit/Renderer/FrxSourceTest.php
Test FrxSource Renderer

... See full list

File

tests/src/Unit/Renderer/FrxRendererTestCase.php, line 31

Class

FrxRendererTestCase
Base test class for renderer tests.

Namespace

Drupal\Tests\forena\Unit\Renderer

Code

public function render($class, $report, $tag = 'div') {
  $this->report = $r = new Report($report);

  /** @var \Drupal\forena\FrxPlugin\Renderer\RendererBase $object */
  $object = new $class($r);
  $dom = $r->dom;
  $div = $dom
    ->getElementsByTagName($tag)
    ->item(0);

  // Render the rport.
  $object
    ->initReportNode($div);
  $this->renderer = $object;
  return $object
    ->render();
}