From d9136461e3bfdc590e33e0be1c7d9b4057bd08c2 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Wed, 19 Mar 2014 19:32:13 +0530 Subject: [PATCH] CRM Test Fixes --- tests/phpunit/CRM/Contact/BAO/ContactTest.php | 4 ++-- tests/phpunit/CRM/Core/BAO/CustomFieldTest.php | 4 ++-- tests/phpunit/CRM/Core/PseudoConstantTest.php | 14 ++++---------- .../CRM/Utils/Migrate/fixtures/Activity-text.xml | 1 + .../Migrate/fixtures/ActivityMeeting-text.xml | 1 + .../CRM/Utils/Migrate/fixtures/Contact-select.xml | 1 + .../CRM/Utils/Migrate/fixtures/Contact-text.xml | 1 + .../CRM/Utils/Migrate/fixtures/Individual-text.xml | 1 + .../Migrate/fixtures/IndividualStudent-text.xml | 1 + 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/CRM/Contact/BAO/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactTest.php index d4aa8b917f..99f79ecbb0 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactTest.php @@ -546,7 +546,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { //take the common contact params $params = $this->contactParams(); $params['note'] = 'test note'; - $params['create_employer'] = 'Yahoo'; + $params['create_employer'] = 1; //create the contact with given params. $contact = CRM_Contact_BAO_Contact::create($params); @@ -615,7 +615,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { $this->assertEquals(1, $values['relationship']['totalCount'], 'Check for total relationship count'); foreach ($values['relationship']['data'] as $key => $val) { //Now check values of Relationship organization. - $this->assertEquals($params['create_employer'], $val['name'], 'Check for organization'); + $this->assertEquals($params['create_employer'], $val['id'], 'Check for organization'); //Now check values of Relationship type. $this->assertEquals('Employee of', $val['relation'], 'Check for relationship type'); //delete the organization. diff --git a/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php b/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php index 40519893f1..d375fb1838 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php @@ -155,8 +155,8 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { $fields = array( 'groupId' => $customGroup->id, 'label' => 'Throwaway Field', - 'data_type' => 'Memo', - 'html_type' => 'TextArea', + 'dataType' => 'Memo', + 'htmlType' => 'TextArea', ); $customField = Custom::createField(array(), $fields); diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index 28c2014bf5..52506ee3da 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -277,6 +277,10 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'sample' => array('USD' => 'US Dollar'), 'max' => 200, ), + array( + 'fieldName' => 'soft_credit_type_id', + 'sample' => 'In Honor of', + ), ), 'CRM_Contribute_DAO_Product' => array( array( @@ -348,12 +352,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'max' => 15, ), ), - 'CRM_Pledge_DAO_Pledge' => array( - array( - 'fieldName' => 'honor_type_id', - 'sample' => 'In Honor of', - ), - ), 'CRM_Core_DAO_Phone' => array( array( 'fieldName' => 'phone_type_id', @@ -529,10 +527,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'fieldName' => 'contribution_status_id', 'sample' => 'Completed', ), - array( - 'fieldName' => 'honor_type_id', - 'sample' => 'In Honor of', - ), ), 'CRM_Contribute_DAO_ContributionPage' => array( array( diff --git a/tests/phpunit/CRM/Utils/Migrate/fixtures/Activity-text.xml b/tests/phpunit/CRM/Utils/Migrate/fixtures/Activity-text.xml index d5efc4e231..3ba60791f7 100644 --- a/tests/phpunit/CRM/Utils/Migrate/fixtures/Activity-text.xml +++ b/tests/phpunit/CRM/Utils/Migrate/fixtures/Activity-text.xml @@ -32,6 +32,7 @@ 1 0 name1_1 + 0 example diff --git a/tests/phpunit/CRM/Utils/Migrate/fixtures/ActivityMeeting-text.xml b/tests/phpunit/CRM/Utils/Migrate/fixtures/ActivityMeeting-text.xml index f32c3c117f..506cc451dc 100644 --- a/tests/phpunit/CRM/Utils/Migrate/fixtures/ActivityMeeting-text.xml +++ b/tests/phpunit/CRM/Utils/Migrate/fixtures/ActivityMeeting-text.xml @@ -34,6 +34,7 @@ 1 0 name1_1 + 0 example diff --git a/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-select.xml b/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-select.xml index 621e338d88..ba6a2165a6 100644 --- a/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-select.xml +++ b/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-select.xml @@ -31,6 +31,7 @@ 1 0 our_select_field_1 + 0 our_select_field_20130818044104 example diff --git a/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-text.xml b/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-text.xml index f78472ff52..cedc6e16e6 100644 --- a/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-text.xml +++ b/tests/phpunit/CRM/Utils/Migrate/fixtures/Contact-text.xml @@ -32,6 +32,7 @@ 1 0 name1_1 + 0 example diff --git a/tests/phpunit/CRM/Utils/Migrate/fixtures/Individual-text.xml b/tests/phpunit/CRM/Utils/Migrate/fixtures/Individual-text.xml index e656f28c47..7903a78575 100644 --- a/tests/phpunit/CRM/Utils/Migrate/fixtures/Individual-text.xml +++ b/tests/phpunit/CRM/Utils/Migrate/fixtures/Individual-text.xml @@ -32,6 +32,7 @@ 1 0 name1_1 + 0 example diff --git a/tests/phpunit/CRM/Utils/Migrate/fixtures/IndividualStudent-text.xml b/tests/phpunit/CRM/Utils/Migrate/fixtures/IndividualStudent-text.xml index 0a4c15807c..64b60b799c 100644 --- a/tests/phpunit/CRM/Utils/Migrate/fixtures/IndividualStudent-text.xml +++ b/tests/phpunit/CRM/Utils/Migrate/fixtures/IndividualStudent-text.xml @@ -34,6 +34,7 @@ 1 0 name1_1 + 0 example -- 2.25.1