CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • Civictrunk unit testing api_v2_CustomValueContact failure
Pages: [1]

Author Topic: Civictrunk unit testing api_v2_CustomValueContact failure  (Read 2692 times)

stantale

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
Civictrunk unit testing api_v2_CustomValueContact failure
November 21, 2009, 09:52:50 am
Hi,

running unit testing with a latest checkout of svn trunk.

I am trying to run AllTests. Everything runs fine until the api_v2_CustomValueContactTypeTest yields the following stack trace.


tools/scripts/phpunit --verbose -uroot api_v2_CustomValueContactTypeTest

-----------stack trace----------------------

PHPUnit 3.3.16 by Sebastian Bergmann.

api_v2_CustomValueContactTypeTest

Installing civicrm_tests_dev database
<p>backTrace</p><p><pre>/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 256
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Utils/Type.php, fatal, 256
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Core/DAO.php, validate, 918
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Core/DAO.php, composeQuery, 857
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, executeQuery, 1707
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Core/BAO/UFMatch.php, getPrimaryOpenId, 291
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, updateUFName, 348
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, create, 1490
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tests/phpunit/CiviTest/Contact.php, createProfileContact, 14
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tests/phpunit/api/v2/CustomValueContactTypeTest.php, create, 83
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/packages/PHPUnit/Framework/TestCase.php, setUp, 394
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/packages/PHPUnit/Framework/TestResult.php, runBare, 607
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/packages/PHPUnit/Framework/TestCase.php, run, 375
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/packages/PHPUnit/Framework/TestSuite.php, run, 677
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/packages/PHPUnit/Framework/TestSuite.php, runTest, 658
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/packages/PHPUnit/TextUI/TestRunner.php, run, 324
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/packages/PHPUnit/TextUI/Command.php, doRun, 132
/data/sites/civitrunk.rayogram.com/sites/all/modules/civicrm/tools/scripts/phpunit, main, 69</pre></p><p></p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <base href="%%baseURL%%/" />
  <style type="text/css" media="screen">@import url(%%baseURL%%/css/civicrm.css);</style>
  <style type="text/css" media="screen">@import url(%%baseURL%%/css/extras.css);</style>
</head>

<body>

<div id="crm-container" lang="en" xml:lang="en">

<div class="messages status">
  <dl>
  <dt><img src="%%baseURL%%/i/Error.gif" alt="unrecoverable error" /></dt>
  <dd>
      Sorry. A non-recoverable error has occurred.      <p>One of parameters  (value: ) is not of the type Integer</p>
      <p><a href="%%baseURL%%/" title="Main Menu">Return to home page.</a></p>
  </dd>
  </dl>
</div>

</div>
</body>
</html>

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Civictrunk unit testing api_v2_CustomValueContact failure
November 23, 2009, 02:56:04 am
Hey,

I was unavailable on Thursday and Friday, back to work today and will try to eliminate all problems with running tests asap.

As for the error you're experiencing above, it's still the same one that you experienced during the sprint - I'll do my best to eliminate it today/tomorrow.

Temporary fix (only on your local sandbox) is to comment out a few lines as below:

Index: ../CRM/Contact/BAO/Contact.php
===================================================================
--- ../CRM/Contact/BAO/Contact.php   (revision 25214)
+++ ../CRM/Contact/BAO/Contact.php   (working copy)
@@ -107,11 +107,11 @@
             return;
         }
 
-        //fix for validate contact sub type CRM-5143
-        $subType = CRM_Utils_Array::value('contact_sub_type', $params );
-        if ( $subType && !(CRM_Contact_BAO_ContactType::isExtendsContactType($subType, $params['contact_type'], true)) ) {
-            return;     
-        }
+//        //fix for validate contact sub type CRM-5143
+//        $subType = CRM_Utils_Array::value('contact_sub_type', $params );
+//        if ( $subType && !(CRM_Contact_BAO_ContactType::isExtendsContactType($subType, $params['contact_type'], true)) ) {
+//            return;     
+//        }


Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

stantale

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
Re: Civictrunk unit testing api_v2_CustomValueContact failure
November 23, 2009, 05:36:21 am
thank you - short term I just deleted the test to get tests working, but found a few others with issues too.

let me know if you want a full list.

-Sacha

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Civictrunk unit testing api_v2_CustomValueContact failure
November 23, 2009, 05:49:29 am
Yup, quite a few are failing with fatals. I've got the reason - tests depend on having contact subtypes defined in the database, but those are added in civicrm_sample.mysql (that we don't load), not civicrm_data.mysql (that we do). Working on fixing this problem.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Civictrunk unit testing api_v2_CustomValueContact failure
November 23, 2009, 07:47:23 am
Suite should be running fine now, just checked in a few fixes.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • Civictrunk unit testing api_v2_CustomValueContact failure

This forum was archived on 2017-11-26.