Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Development
Core
Commits
d946b676
Commit
d946b676
authored
May 01, 2014
by
eileenmcnaughton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRM-14319 test that extra contacts get scheduled reminders
parent
8e7316a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
tests/phpunit/api/v3/JobTest.php
tests/phpunit/api/v3/JobTest.php
+34
-0
No files found.
tests/phpunit/api/v3/JobTest.php
View file @
d946b676
...
...
@@ -176,6 +176,40 @@ class api_v3_JobTest extends CiviUnitTestCase {
$result
=
$this
->
callAPISuccess
(
$this
->
_entity
,
'update_greeting'
,
array
(
'gt'
=>
$gt
,
'ct'
=>
$ct
));
}
/**
* test the call reminder success sends more than 25 reminders & is not incorrectly limited
* Note that this particular test sends the reminders to the additional recipients only
* as no real reminder person is configured
*
* Also note that this is testing a 'job' api so is in this class rather than scheduled_reminder - which
* seems a cleaner place to build up a collection of scheduled reminder testing functions. However, it seems
* that the api itself would need to be moved to the scheduled_reminder fn to do that with the job wrapper being respected for legacy functions
*/
public
function
testCallSendReminderSuccessMoreThanDefaultLimit
()
{
$membershipTypeID
=
$this
->
membershipTypeCreate
();
$createTotal
=
30
;
for
(
$i
=
1
;
$i
<=
$createTotal
;
$i
++
)
{
$contactID
=
$this
->
individualCreate
();
$groupID
=
$this
->
groupCreate
(
array
(
'name'
=>
$i
,
'title'
=>
$i
));
$result
=
$this
->
callAPISuccess
(
'action_schedule'
,
'create'
,
array
(
'title'
=>
" job
$i
"
,
'subject'
=>
"job
$i
"
,
'entity_value'
=>
$membershipTypeID
,
'mapping_id'
=>
4
,
'start_action_date'
=>
'membership_join_date'
,
'start_action_offset'
=>
0
,
'start_action_condition'
=>
'before'
,
'start_action_unit'
=>
'hour'
,
'group_id'
=>
$groupID
,
'limit_to'
=>
FALSE
,
));
$this
->
callAPISuccess
(
'group_contact'
,
'create'
,
array
(
'contact_id'
=>
$contactID
,
'status'
=>
'Added'
,
'group_id'
=>
$groupID
));
}
$result
=
$this
->
callAPISuccess
(
'job'
,
'send_reminder'
,
array
());
$successfulCronCount
=
CRM_Core_DAO
::
singleValueQuery
(
"SELECT count(*) FROM civicrm_action_log"
);
$this
->
assertEquals
(
$successfulCronCount
,
$createTotal
);
}
public
function
testCallDisableExpiredRelationships
()
{
$individualID
=
$this
->
individualCreate
();
$orgID
=
$this
->
organizationCreate
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment