ignore system_log in update single test as updating logs doesn't make sense
[civicrm-core.git] / tests / phpunit / api / v3 / SystemTest.php
index 4071bd38c337f642b8464f43a76bf04c70dfd6b2..3e04fc5bf70093ffe2f80a5c3567df6a9b9b65a1 100644 (file)
@@ -88,7 +88,9 @@ class api_v3_SystemTest extends CiviUnitTestCase {
    *
    * @access protected
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+    $this->quickCleanup(array('civicrm_system_log'));
+  }
 
   ///////////////// civicrm_domain_get methods
 
@@ -122,4 +124,15 @@ class api_v3_SystemTest extends CiviUnitTestCase {
     $this->assertEquals($result['message'], 'We wish you a merry Christmas');
     $this->assertEquals($result['level'], 'info');
   }
+
+  /**
+   * Test system log function
+   */
+  function testSystemLogNoLevel() {
+    $this->callAPISuccess('system', 'log', array( 'message' => 'We wish you a merry Christmas'));
+    $result = $this->callAPISuccess('SystemLog', 'getsingle', array('sequential' => 1, 'message' => array('LIKE' => '%Chris%')));
+    $this->assertEquals($result['message'], 'We wish you a merry Christmas');
+    $this->assertEquals($result['level'], 'info');
+    $this->callAPISuccess('system_log', 'create', array('message' => 'msg'));
+  }
 }