class YAMLExporterTest in Loft Data Grids 7.2
Hierarchy
- class \AKlump\LoftDataGrids\ExporterBase extends \AKlump\LoftDataGrids\PHPUnit_Framework_TestCase
- class \AKlump\LoftDataGrids\YAMLExporterTest
Expanded class hierarchy of YAMLExporterTest
File
- vendor/
aklump/ loft_data_grids/ tests/ phpunit/ YAMLExporterTest.php, line 11 - Tests for the YAMLExporter class
Namespace
AKlump\LoftDataGridsView source
class YAMLExporterTest extends ExporterBase {
public function testDateTimeObjectHandling() {
$this
->assertDateHandlerWorks(function ($date) {
return "-\n - { date: '{$date}' }\n";
});
}
public function testOutput0() {
$control = "-\n 'Order No.': 1181\n 'Customer Billing Country': US\n 'California Taxed Purchase Amount': 0\n";
$subject = $this->exporter
->export(0);
$this
->assertSame($control, $subject);
}
public function testOutput1() {
$control = "-\n 'Order No.': '1182'\n 'Transaction Date': 11/7/13\n 'Customer Name': 'Hope, Roberta'\n";
$subject = $this->exporter
->export(1);
$this
->assertSame($control, $subject);
}
public function testOutput() {
$control = "-\n - { 'Order No.': 1181, 'Customer Billing Country': US, 'California Taxed Purchase Amount': 0 }\n-\n - { 'Order No.': '1182', 'Transaction Date': 11/7/13, 'Customer Name': 'Hope, Roberta' }\n";
$subject = $this->exporter
->export();
$this
->assertSame($control, $subject);
$this
->assertMethodSaveFile();
$this
->assertSandboxFileContents($control);
}
public function testInfoValues() {
$info = $this->exporter
->getInfo();
$this
->assertSame('.yml', $info['extension']);
}
public function setUp() {
parent::setUp();
$this->exporter = new YAMLExporter($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 | |
YAMLExporterTest:: |
public | function |
Overrides ExporterBase:: |
|
YAMLExporterTest:: |
public | function | ||
YAMLExporterTest:: |
public | function | ||
YAMLExporterTest:: |
public | function | ||
YAMLExporterTest:: |
public | function | ||
YAMLExporterTest:: |
public | function |