Esempio n. 1
0
 public function __construct(CrontabAdapter $crontabAdapter)
 {
     parent::__construct($crontabAdapter);
 }
 /**
  * Add an already in the repository job
  * @expectedException \LogicException
  */
 public function testAddAnAlreadyInTheRepositoryJob()
 {
     $fakeCrontabAdapter = $this->getMock('TiBeN\\CrontabManager\\CrontabAdapter');
     $fakeCrontabAdapter->expects($this->any())->method('readCrontab')->will($this->returnValue(file_get_contents($this->fixturesPath . 'simple_crontab.txt')));
     $crontabRepository = new CrontabRepository($fakeCrontabAdapter);
     /* Modify the existing job */
     $crontabJobs = $crontabRepository->findJobByRegex('/launch\\ -param\\ mycommand/');
     $crontabRepository->addJob($crontabJobs[0]);
 }