From d58b453e2fb1b53f2b1921d6bf5cf4b04f2b329b Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 17 Jun 2014 10:47:36 +1200 Subject: [PATCH] test fix - set globals in main setup function rather than ad hoc --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 1 + tests/phpunit/api/v3/ContributionPageTest.php | 3 ++ tests/phpunit/api/v3/ReportTemplateTest.php | 1 - tests/phpunit/api/v3/UFFieldTest.php | 1 - tests/phpunit/api/v3/UFJoinTest.php | 47 ------------------- 5 files changed, 4 insertions(+), 49 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 3fc0dcc553..32b1fa631d 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -377,6 +377,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { else { error_reporting(E_ALL & ~E_NOTICE); } + $this->_sethtmlGlobals(); } /** diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index ae5041d3ba..be86e403ac 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -109,6 +109,9 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { } + /** + * Test form submission with basic price set + */ public function testSubmit() { $contributionPageResult = $this->callAPISuccess($this->_entity, 'create', $this->params); $priceSetParams = array( diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index 2178aa95d3..355080c602 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -40,7 +40,6 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { function setUp() { parent::setUp(); - $this->_sethtmlGlobals(); } function tearDown() {} diff --git a/tests/phpunit/api/v3/UFFieldTest.php b/tests/phpunit/api/v3/UFFieldTest.php index 61b6274946..60d37a7146 100644 --- a/tests/phpunit/api/v3/UFFieldTest.php +++ b/tests/phpunit/api/v3/UFFieldTest.php @@ -62,7 +62,6 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { $this->_dbconn, new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml') ); - $this->_sethtmlGlobals(); $this->callAPISuccess('uf_field', 'getfields', array('cache_clear' => 1)); diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index 0d951391c6..0efbd0407a 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -61,53 +61,6 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { $this->_dbconn, new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml') ); - - // FIXME: something NULLs $GLOBALS['_HTML_QuickForm_registered_rules'] when the tests are ran all together - $GLOBALS['_HTML_QuickForm_registered_rules'] = array( - 'required' => array('html_quickform_rule_required', 'HTML/QuickForm/Rule/Required.php'), - 'maxlength' => array('html_quickform_rule_range', 'HTML/QuickForm/Rule/Range.php'), - 'minlength' => array('html_quickform_rule_range', 'HTML/QuickForm/Rule/Range.php'), - 'rangelength' => array('html_quickform_rule_range', 'HTML/QuickForm/Rule/Range.php'), - 'email' => array('html_quickform_rule_email', 'HTML/QuickForm/Rule/Email.php'), - 'regex' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'), - 'lettersonly' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'), - 'alphanumeric' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'), - 'numeric' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'), - 'nopunctuation' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'), - 'nonzero' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'), - 'callback' => array('html_quickform_rule_callback', 'HTML/QuickForm/Rule/Callback.php'), - 'compare' => array('html_quickform_rule_compare', 'HTML/QuickForm/Rule/Compare.php'), - ); - // FIXME: …ditto for $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'] - $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'] = array( - 'group' => array('HTML/QuickForm/group.php', 'HTML_QuickForm_group'), - 'hidden' => array('HTML/QuickForm/hidden.php', 'HTML_QuickForm_hidden'), - 'reset' => array('HTML/QuickForm/reset.php', 'HTML_QuickForm_reset'), - 'checkbox' => array('HTML/QuickForm/checkbox.php', 'HTML_QuickForm_checkbox'), - 'file' => array('HTML/QuickForm/file.php', 'HTML_QuickForm_file'), - 'image' => array('HTML/QuickForm/image.php', 'HTML_QuickForm_image'), - 'password' => array('HTML/QuickForm/password.php', 'HTML_QuickForm_password'), - 'radio' => array('HTML/QuickForm/radio.php', 'HTML_QuickForm_radio'), - 'button' => array('HTML/QuickForm/button.php', 'HTML_QuickForm_button'), - 'submit' => array('HTML/QuickForm/submit.php', 'HTML_QuickForm_submit'), - 'select' => array('HTML/QuickForm/select.php', 'HTML_QuickForm_select'), - 'hiddenselect' => array('HTML/QuickForm/hiddenselect.php', 'HTML_QuickForm_hiddenselect'), - 'text' => array('HTML/QuickForm/text.php', 'HTML_QuickForm_text'), - 'textarea' => array('HTML/QuickForm/textarea.php', 'HTML_QuickForm_textarea'), - 'fckeditor' => array('HTML/QuickForm/fckeditor.php', 'HTML_QuickForm_FCKEditor'), - 'tinymce' => array('HTML/QuickForm/tinymce.php', 'HTML_QuickForm_TinyMCE'), - 'dojoeditor' => array('HTML/QuickForm/dojoeditor.php', 'HTML_QuickForm_dojoeditor'), - 'link' => array('HTML/QuickForm/link.php', 'HTML_QuickForm_link'), - 'advcheckbox' => array('HTML/QuickForm/advcheckbox.php', 'HTML_QuickForm_advcheckbox'), - 'date' => array('HTML/QuickForm/date.php', 'HTML_QuickForm_date'), - 'static' => array('HTML/QuickForm/static.php', 'HTML_QuickForm_static'), - 'header' => array('HTML/QuickForm/header.php', 'HTML_QuickForm_header'), - 'html' => array('HTML/QuickForm/html.php', 'HTML_QuickForm_html'), - 'hierselect' => array('HTML/QuickForm/hierselect.php', 'HTML_QuickForm_hierselect'), - 'autocomplete' => array('HTML/QuickForm/autocomplete.php', 'HTML_QuickForm_autocomplete'), - 'xbutton' => array('HTML/QuickForm/xbutton.php', 'HTML_QuickForm_xbutton'), - 'advmultiselect' => array('HTML/QuickForm/advmultiselect.php', 'HTML_QuickForm_advmultiselect'), - ); } function tearDown() { -- 2.25.1