fixes for --filter=testContributeOfflineforSoftcreditwithApi WebTest_Contribute_AddPr...
authorkurund <kurund@civicrm.org>
Tue, 13 Aug 2013 12:02:19 +0000 (17:32 +0530)
committerkurund <kurund@civicrm.org>
Tue, 13 Aug 2013 12:02:19 +0000 (17:32 +0530)
tests/phpunit/WebTest/Contribute/AddPricesetTest.php

index 7153abc7bf8c496820eddfcc9e859649c443e411..28e8e5d8242f3639bdddbaf1551d8452b5d3c75d 100644 (file)
@@ -612,7 +612,6 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
       'Paid By' => 'Check',
       'Check Number' => '1041',
       'Contribution Status' => 'Completed',
-      'Soft Credit To' => "$firstNameSoft $lastNameSoft",
     );
     $this->webtestVerifyTabularData($expected);
 
@@ -628,6 +627,16 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
       );
     }
 
+    // verify if soft credit was created successfully
+    $softCreditValues = array(
+      'Soft Credit To' => "{$firstNameSoft} {$lastNameSoft}",
+      'Amount' => '65.00',
+    );
+
+    foreach ($softCreditValues as $value) {
+      $this->verifyText("css=table.crm-soft-credit-listing", preg_quote($value));
+    }
+
     // Check for Soft contact created
     $this->click("css=input#sort_name_navigation");
     $this->type("css=input#sort_name_navigation", "$lastNameSoft, $firstNameSoft");
@@ -668,9 +677,19 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
       'Contribution Status' => $fields['values'][$fields['id']]['contribution_status'],
       'Paid By' => $fields['values'][$fields['id']]['contribution_payment_instrument'],
       'Check Number' => $fields['values'][$fields['id']]['contribution_check_number'],
-      'Soft Credit To' => $softCreditContact->display_name,
     );
+
     $this->webtestVerifyTabularData($expected);
+
+    // verify if soft credit
+    $softCreditValues = array(
+      'Soft Credit To' => $softCreditContact->display_name,
+      'Amount' => '65.00',
+    );
+
+    foreach ($softCreditValues as $value) {
+      $this->verifyText("css=table.crm-soft-credit-listing", preg_quote($value));
+    }
   }
 }