blob: 3f63a60f5d814971691c6375b1680f5a375ce574 [file] [log] [blame]
Taufan Aditya85859b22012-05-05 01:26:51 +07001<?php
2
3class Empty_test extends CI_TestCase {
4
5 /**
6 * @var object Database/Query Builder holder
7 */
8 protected $db;
9
10 public function set_up()
11 {
12 $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
13
14 Mock_Database_Schema_Skeleton::create_tables();
15 Mock_Database_Schema_Skeleton::create_data();
16 }
17
18 // ------------------------------------------------------------------------
19
20 /**
21 * @see ./mocks/schema/skeleton.php
22 */
23 public function test_empty_table()
24 {
25 // Check initial record
26 $jobs = $this->db->get('job')->result_array();
27
Andrey Andreev20d9b0a2017-12-20 19:57:39 +020028 $this->assertCount(4, $jobs);
Taufan Aditya85859b22012-05-05 01:26:51 +070029
30 // Do the empty
31 $this->db->empty_table('job');
32
33 // Check the record
34 $jobs = $this->db->get('job');
35
36 $this->assertEmpty($jobs->result_array());
37 }
38
Andrey Andreev20d9b0a2017-12-20 19:57:39 +020039}