From: Jon goldberg Date: Tue, 28 Apr 2015 03:05:32 +0000 (-0600) Subject: CRM-13283 - Initial work on date-sensitive time checks X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1da2f9e85a011691d0a332c1ac885619d5a7f60e;p=civicrm-core.git CRM-13283 - Initial work on date-sensitive time checks --- diff --git a/tests/phpunit/api/v3/SystemCheckTest.php b/tests/phpunit/api/v3/SystemCheckTest.php index 2dea601132..56234f2261 100644 --- a/tests/phpunit/api/v3/SystemCheckTest.php +++ b/tests/phpunit/api/v3/SystemCheckTest.php @@ -79,8 +79,27 @@ class api_v3_SystemCheckTest extends CiviUnitTestCase { break; } } - fwrite(STDERR, print_r($result, TRUE)); - fwrite(STDERR, print_r($testedCheck, TRUE)); + $this->assertArrayNotHasKey('name', $testedCheck, 'warning', ' in line ' . __LINE__); + } + + public function testSystemCheckHushFuture() { + $tomorrow = new DateTime('tomorrow'); + $this->_params = array( + 'name' => 'checkDefaultMailbox', + 'minimum_report_severity' => 4, + 'hush_until' => $tomorrow->format('Y-m-d'), + ); + $statusPreference = $this->callAPISuccess('StatusPreference', 'create', $this->_params); + $result = $this->callAPISuccess('System', 'check', array()); + foreach ($result['values'] as $check) { + if ($check['name'] == 'checkDefaultMailbox') { + $testedCheck = $check; + break; + } + } + fwrite(STDERR, print_r($statusPreference, TRUE)); + fwrite(STDERR, 'tomorrow?'); + fwrite(STDERR, print_r($tomorrow->format('Y-m-d'), TRUE)); $this->assertArrayNotHasKey('name', $testedCheck, 'warning', ' in line ' . __LINE__); }