Exemple #1
0
 public function testGetMultipleConfigsSingle()
 {
     $configuration = new Configuration('./Tests/data/simple_basic', 'test', new Temp('test'));
     $configs = $configuration->getMultipleConfigs();
     $yml = Yaml::parse(file_get_contents('./Tests/data/simple_basic/config.yml'));
     self::assertContainsOnlyInstancesOf('\\Keboola\\Juicer\\Config\\Config', $configs);
     self::assertCount(1, $configs);
     self::assertEquals($configuration->getConfig(), $configs[0]);
 }
Exemple #2
0
 /**
  * I'm not too sure this is optimal!
  * If it looks stupid, but works, it ain't stupid!
  */
 public function getJob($dir = 'recursive')
 {
     $temp = new Temp('recursion');
     $configuration = new Configuration(__DIR__ . '/../data/' . $dir, 'test', $temp);
     $jobConfig = array_values($configuration->getConfig()->getJobs())[0];
     $parser = Json::create($configuration->getConfig(), $this->getLogger('test', true), $temp);
     $client = RestClient::create();
     $history = new History();
     $client->getClient()->getEmitter()->attach($history);
     $job = $this->getMockForAbstractClass('Keboola\\Juicer\\Extractor\\RecursiveJob', [$jobConfig, $client, $parser]);
     return [$job, $client, $parser, $history, $jobConfig];
 }