コード例 #1
0
 /**
  * @covers CSanquer\FakeryGenerator\Config\ConfigSerializer::__construct
  * @covers CSanquer\FakeryGenerator\Config\ConfigSerializer::load
  * @dataProvider providerLoad
  */
 public function testLoad($filename, $expected)
 {
     $configSerializer = new ConfigSerializer(self::$cacheDir . '/serializer', __DIR__ . '/../../../../../src/CSanquer/FakeryGenerator/Resources/Config', true);
     $config = $configSerializer->load(self::$fixtures . '/ConfigSerializer/valid/' . $filename);
     $this->assertInstanceOf('\\CSanquer\\FakeryGenerator\\Model\\Config', $config);
     $this->assertEquals($expected, $config);
     $this->assertEquals($expected->getCsvDialect(), $config->getCsvDialect());
     $this->assertEquals($expected->getColumns(), $config->getColumns());
     $this->assertEquals($expected->getVariables(), $config->getVariables());
 }
コード例 #2
0
 protected function dumpConfigFile(Config $config, $outputDir, $format = 'json')
 {
     return $this->configSerializer->dump($config, $outputDir, $format);
 }