Permalink
Browse files

MDL-39020 phpunit: Rename incorrect filename

Rename externallib_tests.php to externallib_test.php
Fix failing unit tests
  • Loading branch information...
ankitagarwal committed Jun 28, 2013
1 parent 32e550a commit 770710e1cdf68ef9550078f0bd6a8e4a3bdb7a5a
Showing with 5 additions and 2 deletions.
  1. +5 −2 calendar/tests/{externallib_tests.php → externallib_test.php}
@@ -113,13 +113,16 @@ public function test_create_calendar_events () {
// 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);

0 comments on commit 770710e

Please sign in to comment.