mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'MDL-39020-master' of git://github.com/ankitagarwal/moodle
This commit is contained in:
commit
f64998fab3
@ -113,13 +113,16 @@ class core_calendar_external_testcase extends externallib_advanced_testcase {
|
||||
|
||||
// Create a few events and do asserts.
|
||||
$this->create_calendar_event('test', $USER->id);
|
||||
$count = count($DB->get_records("event", array('name' => 'test')));
|
||||
$where = $DB->sql_compare_text('name') ." = ?";
|
||||
$count = count($DB->get_records_select("event", $where, array('test')));
|
||||
$this->assertEquals(1, $count);
|
||||
$aftercount = count($DB->get_records("event"));
|
||||
$this->assertEquals($prevcount + 1, $aftercount);
|
||||
|
||||
$this->create_calendar_event('user', $USER->id, 'user', 3);
|
||||
$count = count($DB->get_records("event", array('name' => 'user')));
|
||||
$where = $DB->sql_compare_text('name') ." = ?";
|
||||
$count = count($DB->get_records_select("event", $where, array('user')));
|
||||
|
||||
$this->assertEquals(3, $count);
|
||||
$aftercount = count($DB->get_records("event"));
|
||||
$this->assertEquals($prevcount + 4, $aftercount);
|
Loading…
x
Reference in New Issue
Block a user