XMLTest.php in Forena Reports 8
File
tests/src/Unit/Document/XMLTest.php
View source
<?php
namespace Drupal\Tests\forena\Unit\Document;
use Drupal\forena\DocManager;
use Drupal\Tests\forena\Unit\FrxTestCase;
class XMLTest extends FrxTestCase {
private $html = '<p>Run boy Run!</p>';
public function testCSV() {
$doc = DocManager::instance()
->setDocument('xml');
$doc
->header();
$doc
->write($this->html);
$doc
->footer();
$report = $doc
->flush();
$this
->assertContains("<p>Run boy Run!</p>", $report, 'Data Present');
$this
->assertContains("<div>", $report, "Open Tag Present");
$this
->assertContains('</div>', $report, "Close Tag Present");
$headers = $doc->headers;
$this
->assertArrayHasKey('Content-Type', $headers);
$this
->assertContains('application/xml', $headers['Content-Type']);
}
}