Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-39020 phpunit: Rename incorrect filename

Rename externallib_tests.php to externallib_test.php
Fix failing unit tests
  • Loading branch information...
commit 770710e1cdf68ef9550078f0bd6a8e4a3bdb7a5a 1 parent 32e550a
@ankitagarwal ankitagarwal authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 calendar/tests/{externallib_tests.php → externallib_test.php}
View
7 calendar/tests/externallib_tests.php → calendar/tests/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);
Please sign in to comment.
Something went wrong with that request. Please try again.