You are here

public function XMLExporterTest::testCData in Loft Data Grids 7.2

File

vendor/aklump/loft_data_grids/tests/phpunit/XMLExporterTest.php, line 22
Tests for the XMLExporter class

Class

XMLExporterTest

Namespace

AKlump\LoftDataGrids

Code

public function testCData() {
  $data = new ExportData();
  $data
    ->add('title', '<h1>Some</h1>');
  $this->exporter
    ->setData($data);
  $control = '<?xml version="1.0"?>
<data><page id="0"><record id="0"><title><![CDATA[&lt;h1&gt;Some&lt;/h1&gt;]]></title></record></page></data>
';
  $this
    ->assertSame($control, $this->exporter
    ->export());
}