summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/libraries/Table_test.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-12-20 18:57:39 +0100
committerAndrey Andreev <narf@devilix.net>2017-12-20 19:02:17 +0100
commit20d9b0a9c03955da0010a3df91adcd9b8e6e7d58 (patch)
tree40a405d18778612b0c124a26036af77ec558e4c9 /tests/codeigniter/libraries/Table_test.php
parent9e2dcd4a6a70a997d8d741e8f113660f16b9a609 (diff)
Merge pull request #5354 from carusogabriel/refactoring-tests
Refactoring tests Conflicts resolved: tests/codeigniter/core/Utf8_test.php tests/codeigniter/database/query_builder/group_test.php tests/codeigniter/libraries/Form_validation_test.php
Diffstat (limited to 'tests/codeigniter/libraries/Table_test.php')
-rw-r--r--tests/codeigniter/libraries/Table_test.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/codeigniter/libraries/Table_test.php b/tests/codeigniter/libraries/Table_test.php
index 8e7452474..f505a43fc 100644
--- a/tests/codeigniter/libraries/Table_test.php
+++ b/tests/codeigniter/libraries/Table_test.php
@@ -67,7 +67,7 @@ class Table_test extends CI_TestCase {
$this->table->add_row('your', 'pony', 'stinks');
$this->table->add_row('my pony', '>', 'your pony');
- $this->assertEquals(count($this->table->rows), 3);
+ $this->assertCount(3, $this->table->rows);
$this->assertEquals(
array(
@@ -188,8 +188,8 @@ class Table_test extends CI_TestCase {
}
$this->assertFalse($this->table->auto_heading);
- $this->assertEquals(count($this->table->heading), 3);
- $this->assertEquals(count($this->table->rows), 2);
+ $this->assertCount(3, $this->table->heading);
+ $this->assertCount(2, $this->table->rows);
$this->table->clear();
@@ -213,7 +213,7 @@ class Table_test extends CI_TestCase {
$this->table->clear();
$this->table->set_from_array($data);
- $this->assertEquals(count($this->table->rows), 2);
+ $this->assertCount(2, $this->table->rows);
$expected = array(
array('data' => 'name'),
@@ -270,14 +270,14 @@ class Table_test extends CI_TestCase {
$table = $this->table->generate($data);
// Test the table header
- $this->assertTrue(strpos($table, '<th>Name</th>') !== FALSE);
- $this->assertTrue(strpos($table, '<th>Color</th>') !== FALSE);
- $this->assertTrue(strpos($table, '<th>Size</th>') !== FALSE);
+ $this->assertContains('<th>Name</th>', $table);
+ $this->assertContains('<th>Color</th>', $table);
+ $this->assertContains('<th>Size</th>', $table);
// Test the first entry
- $this->assertTrue(strpos($table, '<td>Fred</td>') !== FALSE);
- $this->assertTrue(strpos($table, '<td>Blue</td>') !== FALSE);
- $this->assertTrue(strpos($table, '<td>Small</td>') !== FALSE);
+ $this->assertContains('<td>Fred</td>', $table);
+ $this->assertContains('<td>Blue</td>', $table);
+ $this->assertContains('<td>Small</td>', $table);
}
}
@@ -297,4 +297,4 @@ class DB_result_dummy extends CI_DB_result
array('name' => 'Foo Bar', 'email' => 'foo@bar.com')
);
}
-} \ No newline at end of file
+}