summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/query_builder/update_test.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-09 22:16:58 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-09 22:16:58 +0200
commitc186288755aba46a2b6f0c3f104d9a6ce6b11a7f (patch)
tree1858ae3cb82693e30e2682b2d6e24aecfd959ff7 /tests/codeigniter/database/query_builder/update_test.php
parent99b782d8a3d92c4703a059cbd62e2f1e6fea689c (diff)
Cleanup/optimize tests/codeigniter/
Diffstat (limited to 'tests/codeigniter/database/query_builder/update_test.php')
-rw-r--r--tests/codeigniter/database/query_builder/update_test.php26
1 files changed, 6 insertions, 20 deletions
diff --git a/tests/codeigniter/database/query_builder/update_test.php b/tests/codeigniter/database/query_builder/update_test.php
index f5bbffd4f..27a647c45 100644
--- a/tests/codeigniter/database/query_builder/update_test.php
+++ b/tests/codeigniter/database/query_builder/update_test.php
@@ -23,23 +23,14 @@ class Update_test extends CI_TestCase {
public function test_update()
{
// Check initial record
- $job1 = $this->db->where('id', 1)
- ->get('job')
- ->row();
-
+ $job1 = $this->db->where('id', 1)->get('job')->row();
$this->assertEquals('Developer', $job1->name);
// Do the update
- $job_data = array('name' => 'Programmer');
-
- $this->db->where('id', 1)
- ->update('job', $job_data);
+ $this->db->where('id', 1)->update('job', array('name' => 'Programmer'));
// Check updated record
- $job1 = $this->db->where('id', 1)
- ->get('job')
- ->row();
-
+ $job1 = $this->db->where('id', 1)->get('job')->row();
$this->assertEquals('Programmer', $job1->name);
}
@@ -51,10 +42,7 @@ class Update_test extends CI_TestCase {
public function test_update_with_set()
{
// Check initial record
- $job1 = $this->db->where('id', 4)
- ->get('job')
- ->row();
-
+ $job1 = $this->db->where('id', 4)->get('job')->row();
$this->assertEquals('Musician', $job1->name);
// Do the update
@@ -62,10 +50,8 @@ class Update_test extends CI_TestCase {
$this->db->update('job', NULL, 'id = 4');
// Check updated record
- $job1 = $this->db->where('id', 4)
- ->get('job')
- ->row();
-
+ $job1 = $this->db->where('id', 4)->get('job')->row();
$this->assertEquals('Vocalist', $job1->name);
}
+
} \ No newline at end of file