CRM-20570 Add unit test for disabling of PCP
authorSean Madsen <sean@seanmadsen.com>
Sat, 13 May 2017 18:42:57 +0000 (13:42 -0500)
committerSean Madsen <sean@seanmadsen.com>
Sat, 13 May 2017 18:42:57 +0000 (13:42 -0500)
tests/phpunit/api/v3/PcpTest.php

index 73d0da3d51ef037394198a89f225abf26d47abe5..fe6d3e5f6905be85d5e3f1c1f66c1f8becba4f4d 100644 (file)
@@ -68,6 +68,15 @@ class api_v3_PcpTest extends CiviUnitTestCase {
     $this->getAndCheck($this->params, $result['id'], $this->entity);
   }
 
+  /**
+   * Test disable a PCP succeeds.
+   */
+  public function testDisablePcp() {
+    $result = civicrm_api3('Pcp', 'create', $this->params);
+    civicrm_api3('Pcp', 'create', array('id' => $result['id'], 'is_active' => 0));
+    $this->getAndCheck($this->params + array('is_active' => 0), $result['id'], $this->entity);
+  }
+
   /**
    * Test get function succeeds.
    *