Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-12-10-27-52
[civicrm-core.git] / tests / phpunit / WebTest / Member / StandaloneAddTest.php
index 0e16c2b4519a90dc22500929d62878e662c21998..8123794d5e08dbeafb0998e994c1210782755f11 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 */
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Member_StandaloneAddTest
+ */
 class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
 
   protected function setUp() {
@@ -67,7 +71,8 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
 
     // fill in Status Override?
     // fill in Record Membership Payment?
-
+    $this->click("send_receipt");
+    $this->assertTrue($this->isChecked("send_receipt"), 'Send Confirmation and Receipt checkbox should be checked.');
     $this->click("_qf_Membership_upload");
 
     //View Membership
@@ -161,5 +166,24 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
     );
     $this->webtestVerifyTabularData($expected);
   }
-}
 
+  function testAjaxCustomGroupLoad() {
+    $this->webtestLogin();
+    $triggerElement = array('name' => 'membership_type_id_1', 'type' => 'select');
+    $customSets = array(
+      array('entity' => 'Membership', 'subEntity' => 'General', 'triggerElement' => $triggerElement),
+      array('entity' => 'Membership', 'subEntity' => 'Student', 'triggerElement' => $triggerElement)
+    );
+
+    $pageUrl = array('url' => 'member/add', 'args' => 'reset=1&action=add&context=standalone');
+
+    //case where we should fire certain
+    //ui actions which helps triggering possible
+    $test = $this;
+    $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl,
+      function() use ($test) {
+        $test->select('membership_type_id_0', 'value=1');
+      }
+    );
+  }
+}