diff options
author | Andrey Andreev <narf@devilix.net> | 2018-01-13 12:57:11 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2018-01-13 12:57:11 +0100 |
commit | 02a0518e1c56ba3506f370362ac5ebdb8a138312 (patch) | |
tree | 8b4684192b403dcae17d298eb4fc9e7ab001acad /tests/codeigniter/database/query_builder/insert_test.php | |
parent | f0b9735d5857e6c07c8f5824b13cff4828db3cfe (diff) |
[ci skip] 3.1.7 release
Diffstat (limited to 'tests/codeigniter/database/query_builder/insert_test.php')
-rw-r--r-- | tests/codeigniter/database/query_builder/insert_test.php | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/tests/codeigniter/database/query_builder/insert_test.php b/tests/codeigniter/database/query_builder/insert_test.php deleted file mode 100644 index 30c055680..000000000 --- a/tests/codeigniter/database/query_builder/insert_test.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -class Insert_test extends CI_TestCase { - - /** - * @var object Database/Query Builder holder - * @see ./mocks/schema/skeleton.php - */ - protected $db; - - public function set_up() - { - $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER); - - Mock_Database_Schema_Skeleton::create_tables(); - - // Truncate the current datas - $this->db->truncate('job'); - } - - // ------------------------------------------------------------------------ - - /** - * @see ./mocks/schema/skeleton.php - */ - public function test_insert() - { - $job_data = array('id' => 1, 'name' => 'Grocery Sales', 'description' => 'Discount!'); - - // Do normal insert - $this->assertTrue($this->db->insert('job', $job_data)); - - $job1 = $this->db->get('job')->row(); - - // Check the result - $this->assertEquals('Grocery Sales', $job1->name); - - } - - // ------------------------------------------------------------------------ - - /** - * @see ./mocks/schema/skeleton.php - */ - public function test_insert_batch() - { - $job_datas = array( - array('id' => 2, 'name' => 'Commedian', 'description' => 'Theres something in your teeth'), - array('id' => 3, 'name' => 'Cab Driver', 'description' => 'Iam yellow'), - ); - - // Do insert batch except for sqlite driver - if (strpos(DB_DRIVER, 'sqlite') === FALSE) - { - $this->assertEquals(2, $this->db->insert_batch('job', $job_datas)); - - $job_2 = $this->db->where('id', 2)->get('job')->row(); - $job_3 = $this->db->where('id', 3)->get('job')->row(); - - // Check the result - $this->assertEquals('Commedian', $job_2->name); - $this->assertEquals('Cab Driver', $job_3->name); - } - } - -}
\ No newline at end of file |