Merge branch 'phpunit-ob-fix' of https://github.com/giant-rabbit/civicrm-core into...
[civicrm-core.git] / tests / phpunit / api / v3 / DashboardTest.php
index baba27c2b1c24044a8c94f2abc48b0186cb6205c..245de3b46aa4fe967b372c7746985ed2de4348a4 100644 (file)
@@ -27,8 +27,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_action_schedule functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_ActionSchedule
+ * @package CiviCRM_APIv3
+ * @subpackage API_ActionSchedule
  */
 
 class api_v3_DashboardTest extends CiviUnitTestCase {
@@ -37,15 +37,14 @@ class api_v3_DashboardTest extends CiviUnitTestCase {
   protected $_entity = 'dashboard';
   protected $_apiversion = 3;
 
-  public $_eNoticeCompliant = TRUE;
   /**
    *  Test setup for every test
    *
    *  Connect to the database, truncate the tables that will be used
    *  and redirect stdin to a temporary file
-  */
+   */
   public function setUp() {
-   //  Connect to the database
+    //  Connect to the database
     parent::setUp();
   }
 
@@ -63,7 +62,7 @@ class api_v3_DashboardTest extends CiviUnitTestCase {
   }
 
   function testDashboardCreate() {
-       $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_dashboard');
+    $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_dashboard');
     $params = array(
       'version' => 3,
       'label' => 'New Dashlet element',
@@ -75,10 +74,14 @@ class api_v3_DashboardTest extends CiviUnitTestCase {
     $this->assertTrue(is_numeric($dashboard['id']), "In line " . __LINE__);
     $this->assertTrue($dashboard['id'] > 0, "In line " . __LINE__);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_dashboard');
-    $this->assertEquals($oldCount+1, $newCount);
-    $this->DashboardDelete($dashboard['id'],$oldCount);
+    $this->assertEquals($oldCount + 1, $newCount);
+    $this->DashboardDelete($dashboard['id'], $oldCount);
   }
 
+  /**
+   * @param int $id
+   * @param $oldCount
+   */
   function DashboardDelete($id, $oldCount) {
     $params = array(
       'version' => 3,
@@ -90,4 +93,4 @@ class api_v3_DashboardTest extends CiviUnitTestCase {
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_dashboard');
     $this->assertEquals($oldCount, $newCount);
   }
-}
\ No newline at end of file
+}