class YAMLFrontMatterExporterTest in Loft Data Grids 7.2
Hierarchy
- class \AKlump\LoftDataGrids\ExporterBase extends \AKlump\LoftDataGrids\PHPUnit_Framework_TestCase
- class \AKlump\LoftDataGrids\YAMLFrontMatterExporterTest
Expanded class hierarchy of YAMLFrontMatterExporterTest
File
- vendor/
aklump/ loft_data_grids/ tests/ phpunit/ YAMLFrontMatterExporterTest.php, line 11 - Tests for the YAMLFrontMatterExporter class
Namespace
AKlump\LoftDataGridsView source
class YAMLFrontMatterExporterTest extends ExporterBase {
public function testExportNoFrontMatter() {
$html = new ExportData();
$html
->add('body', '<h1> {{ title }} </h1>
<p> {{ description }} </p>
Page content here...');
$exporter = new YAMLFrontMatterExporter($html);
$control = '<h1> {{ title }} </h1>
<p> {{ description }} </p>
Page content here...';
$this
->assertSame($control, $exporter
->export());
}
public function testExportNoBody() {
$html = new ExportData();
$html
->add('title', 'YAML Front Matter')
->add('description', 'A very simple way to add structured data to a page.');
$exporter = new YAMLFrontMatterExporter($html);
$control = '---
title: \'YAML Front Matter\'
description: \'A very simple way to add structured data to a page.\'
---
';
$this
->assertSame($control, $exporter
->export());
}
public function testExport() {
$html = new ExportData();
$html
->add('title', 'YAML Front Matter')
->add('description', 'A very simple way to add structured data to a page.')
->add('body', '<h1> {{ title }} </h1>
<p> {{ description }} </p>
Page content here...');
$exporter = new YAMLFrontMatterExporter($html);
$control = '---
title: \'YAML Front Matter\'
description: \'A very simple way to add structured data to a page.\'
---
<h1> {{ title }} </h1>
<p> {{ description }} </p>
Page content here...';
$this
->assertSame($control, $exporter
->export());
}
public function testGetInfo() {
$info = $this->exporter
->getInfo();
$this
->assertSame('.html', $info['extension']);
$this
->assertSame('AKlump\\LoftDataGrids\\YAMLFrontMatterExporter', $info['class']);
}
public function setUp() {
parent::setUp();
$this->exporter = new YAMLFrontMatterExporter($this->data);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExporterBase:: |
public | function | ||
ExporterBase:: |
public | function | Make sure that saveFile creates a file and returns the path. | |
ExporterBase:: |
public | function | ||
ExporterBase:: |
public | function | Compare the sandbox file against it's control file. | |
ExporterBase:: |
public | function | ||
ExporterBase:: |
public | function | ||
ExporterBase:: |
public | function | ||
ExporterBase:: |
public | function | @expectedException RuntimeException | |
YAMLFrontMatterExporterTest:: |
public | function |
Overrides ExporterBase:: |
|
YAMLFrontMatterExporterTest:: |
public | function | ||
YAMLFrontMatterExporterTest:: |
public | function | ||
YAMLFrontMatterExporterTest:: |
public | function | ||
YAMLFrontMatterExporterTest:: |
public | function |