Merge pull request #4909 from pratikshad/broken-webtest
[civicrm-core.git] / tests / phpunit / api / v3 / APITest.php
index f043e92c7dda837ad16039d901e53414894d83da..5682e91a8951e45a571b6f777992b716687c57a5 100644 (file)
@@ -31,12 +31,12 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for API functions
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 class api_v3_APITest extends CiviUnitTestCase {
   public $DBResetRequired = FALSE;
 
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
 
   public function testAPIReplaceVariables() {
     $result = array();
@@ -73,7 +73,6 @@ class api_v3_APITest extends CiviUnitTestCase {
     */
   public function testAPIWrapperIncludeNoFile() {
 
-
     $result = $this->callAPIFailure('RandomFile', 'get', array(), 'API (RandomFile,get) does not exist (join the API team and implement it!)');
   }
 
@@ -132,14 +131,15 @@ class api_v3_APITest extends CiviUnitTestCase {
       $this->assertEquals($expected, $actual, sprintf('input=%s expected=%s actual=%s', $input, $expected, $actual));
     }
   }
-/**
- * Test that calling via wrapper works
- */
+
+  /**
+   * Test that calling via wrapper works
+   */
   public function testv3Wrapper() {
-    try{
+    try {
       $result = civicrm_api3('contact', 'get', array());
     }
-    catch (CRM_Exception $e){
+    catch (CRM_Exception $e) {
       $this->fail("This should have been a success test");
     }
     $this->assertTrue(is_array($result));
@@ -149,11 +149,11 @@ class api_v3_APITest extends CiviUnitTestCase {
   /**
    * Test exception is thrown
    */
-  public function testv3WrapperException(){
-    try{
+  public function testv3WrapperException() {
+    try {
       $result = civicrm_api3('contact', 'create', array('debug' => 1));
     }
-    catch (CiviCRM_API3_Exception $e){
+    catch (CiviCRM_API3_Exception $e) {
       $this->assertEquals('mandatory_missing', $e->getErrorCode());
       $this->assertEquals('Mandatory key(s) missing from params array: contact_type', $e->getMessage());
       $extra = $e->getExtraParams();