Exemplo n.º 1
0
 /**
  * Testing 'run' container
  */
 public function testConvertRunConfig()
 {
     $runFullJob = ['run' => ['model' => 'Model1::method1']];
     $runNoMethodJob = ['run' => ['model' => 'Model2']];
     $runEmptyMethodJob = ['run' => ['model' => 'Model3::']];
     $runNoModelJob = ['run' => ['model' => '::method1']];
     $source = ['crontab' => ['default' => ['jobs' => ['job_name_1' => $runFullJob, 'job_name_2' => $runNoMethodJob, 'job_name_3' => $runEmptyMethodJob, 'job_name_4' => $runNoModelJob]]]];
     $expected = ['default' => ['job_name_1' => ['instance' => 'Model1', 'method' => 'method1'], 'job_name_2' => [], 'job_name_3' => [], 'job_name_4' => []]];
     $result = $this->_converter->convert($source);
     $this->assertEquals($expected['default']['job_name_1']['instance'], $result['default']['job_name_1']['instance']);
     $this->assertEquals($expected['default']['job_name_1']['method'], $result['default']['job_name_1']['method']);
     $this->assertEmpty($result['default']['job_name_2']);
     $this->assertEmpty($result['default']['job_name_3']);
     $this->assertEmpty($result['default']['job_name_4']);
 }
Exemplo n.º 2
0
 /**
  * Return converted data
  *
  * @return array
  */
 public function get()
 {
     return $this->_converter->convert($this->_reader->read());
 }