function testRealPerform()
  {
    $handle = dirname(__FILE__) . '/TestingCronJob';
    registerTestingIni(
      'cron.ini',
      "
      [cron-job1]
       handle = {$handle}
      "
    );

    $cron_manager = new CronManager();

    $this->response->expectArgumentsAt(1, 'write', array('I was performed'));

    $cron_manager->perform($this->response);

    $contents = $this->_readJobsLastTime();

    $this->assertWantedPattern("/^cron-job1 = \d+$/", $contents);
  }
Ejemplo n.º 2
0
/**********************************************************************************
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com
*
* Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
***********************************************************************************
*
* $Id$
*
***********************************************************************************/
$site_path = $argv[1];
require_once($site_path . '/setup.php');

require_once(LIMB_DIR . '/class/lib/error/Debug.class.php');
require_once(LIMB_DIR . '/class/core/request/NonbufferedResponse.class.php');
require_once(LIMB_DIR . '/class/lib/cron/CronManager.class.php');

$force = false;
if(isset($argv[2]) &&  $argv[2] == 'force')
  $force = true;

$response = new NonbufferedResponse();
$mgr = new CronManager();

$mgr->perform($response, $force);

$response->write(Debug::parseCliConsole());

$response->commit();

exit(0);
?>