Merge pull request #17291 from mfb/tracking-default
[civicrm-core.git] / tests / phpunit / CRM / Core / JobManagerTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * Class CRM_Core_JobManagerTest
14 * @group headless
15 */
16 class CRM_Core_JobManagerTest extends CiviUnitTestCase {
17
18 public function setUp() {
19 parent::setUp();
20 }
21
22 public function testHookCron() {
23 $mockFunction = $this->mockMethod;
24 $hook = $this->getMockBuilder(stdClass::class)
25 ->setMethods(['civicrm_cron'])
26 ->getMock();
27 $hook->expects($this->once())
28 ->method('civicrm_cron')
29 ->with($this->isInstanceOf('CRM_Core_JobManager'));
30 CRM_Utils_Hook::singleton()->setMock($hook);
31
32 $jobManager = new CRM_Core_JobManager();
33 $jobManager->execute(FALSE);
34 }
35
36 }