From 686d4ec921ffc22664e0d1d869a7bea843286f5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20S=CC=8Ckoda?= Date: Sun, 11 Aug 2013 13:34:29 +0200 Subject: [PATCH] MDL-41022 cleanup core_grade_scale_testcase --- lib/grade/tests/grade_scale_test.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/grade/tests/grade_scale_test.php b/lib/grade/tests/grade_scale_test.php index 2cb1c977acf..67b6da43289 100644 --- a/lib/grade/tests/grade_scale_test.php +++ b/lib/grade/tests/grade_scale_test.php @@ -70,8 +70,8 @@ class core_grade_scale_testcase extends grade_base_testcase { $last_grade_scale = end($this->scale); $this->assertEquals($grade_scale->id, $last_grade_scale->id + 1); - $this->assertTrue(!empty($grade_scale->timecreated)); - $this->assertTrue(!empty($grade_scale->timemodified)); + $this->assertNotEmpty($grade_scale->timecreated); + $this->assertNotEmpty($grade_scale->timemodified); } protected function sub_test_grade_scale_update() { @@ -87,13 +87,13 @@ class core_grade_scale_testcase extends grade_base_testcase { protected function sub_test_grade_scale_delete() { global $DB; - $grade_scale = new grade_scale($this->scale[4], false);//choose one we're not using elsewhere + $grade_scale = new grade_scale($this->scale[4], false); // Choose one we're not using elsewhere. $this->assertTrue(method_exists($grade_scale, 'delete')); $this->assertTrue($grade_scale->delete()); $this->assertFalse($DB->get_record('scale', array('id' => $grade_scale->id))); - //keep the reference collection the same as what is in the database + // Keep the reference collection the same as what is in the database. unset($this->scale[4]); } @@ -111,7 +111,7 @@ class core_grade_scale_testcase extends grade_base_testcase { $this->assertTrue(method_exists($scale, 'load_items')); $scale->load_items(); - $this->assertEquals(7, count($scale->scale_items)); + $this->assertCount(7, $scale->scale_items); $this->assertEquals('Fairly neutral', $scale->scale_items[2]); } @@ -124,7 +124,7 @@ class core_grade_scale_testcase extends grade_base_testcase { $scale->scale = null; $scale->compact_items(); - // The original string and the new string may have differences in whitespace around the delimiter, and that's OK + // The original string and the new string may have differences in whitespace around the delimiter, and that's OK. $this->assertEquals(preg_replace('/\s*,\s*/', ',', $this->scale[0]->scale), $scale->scale); } } -- 2.43.0