Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
acd6c6ab
Commit
acd6c6ab
authored
5 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
Add unit test to check generation of fields data
parent
c3f693f2
Branches
master-doctrine
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Core/BAO/CustomQuery.php
+7
-0
7 additions, 0 deletions
CRM/Core/BAO/CustomQuery.php
tests/phpunit/CRM/Core/BAO/CustomQueryTest.php
+12
-0
12 additions, 0 deletions
tests/phpunit/CRM/Core/BAO/CustomQueryTest.php
with
19 additions
and
0 deletions
CRM/Core/BAO/CustomQuery.php
+
7
−
0
View file @
acd6c6ab
...
...
@@ -93,6 +93,13 @@ class CRM_Core_BAO_CustomQuery {
*/
public
$_fields
;
/**
* @return array
*/
public
function
getFields
()
{
return
$this
->
_fields
;
}
/**
* Searching for contacts?
*
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/CRM/Core/BAO/CustomQueryTest.php
+
12
−
0
View file @
acd6c6ab
...
...
@@ -50,6 +50,18 @@ class CRM_Core_BAO_CustomQueryTest extends CiviUnitTestCase {
$queryObj
->
_where
[
0
][
0
]
);
$this
->
assertEquals
(
$queryObj
->
_qill
[
0
][
0
],
"date field BETWEEN 'January 1st, "
.
date
(
'Y'
)
.
" 12:00 AM AND December 31st, "
.
date
(
'Y'
)
.
" 11:59 PM'"
);
$this
->
assertEquals
([
'id'
=>
$dateCustomField
[
'id'
],
'label'
=>
'date field'
,
'extends'
=>
'civicrm_contact'
,
'data_type'
=>
'Date'
,
'html_type'
=>
'Select Date'
,
'is_search_range'
=>
'0'
,
'column_name'
=>
'date_field_'
.
$dateCustomField
[
'id'
],
'table_name'
=>
'civicrm_value_testsearchcus_'
.
$ids
[
'custom_group_id'
],
'option_group_id'
=>
NULL
,
],
$queryObj
->
getFields
()[
$dateCustomField
[
'id'
]]);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment