diff options
author | ytetsuro <phper.0o0@gmail.com> | 2018-04-03 12:42:16 +0200 |
---|---|---|
committer | ytetsuro <phper.0o0@gmail.com> | 2018-04-03 12:42:16 +0200 |
commit | 4ccc1fc93050d043b4483e5d72f92fafa32002e5 (patch) | |
tree | 18eff6f94a142ebf43fef002c280ac9451033275 /tests | |
parent | 5e36bdcd352c24e6312ad81cadf2ddbf041d11cb (diff) |
feat: add test code
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codeigniter/database/query_builder/like_test.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/codeigniter/database/query_builder/like_test.php b/tests/codeigniter/database/query_builder/like_test.php index 3672afae3..f8409092a 100644 --- a/tests/codeigniter/database/query_builder/like_test.php +++ b/tests/codeigniter/database/query_builder/like_test.php @@ -103,4 +103,27 @@ class Like_test extends CI_TestCase { $this->assertCount(1, $tabs); } + /** + * GitHub issue #5462 + * + * @see ./mocks/schema/skeleton.php + * + * @dataProvider like_set_side_provider + */ + public function test_like_set_side($str, $side, $expected_name) + { + $actual = $this->db->like('name', $str, $side)->get('job')->result_array(); + $this->assertCount(1, $actual); + $this->assertEquals($expected_name, $actual[0]['name']); + } + + public function like_set_side_provider() + { + return [ + ['Developer', 'none', 'Developer'], + ['tician', 'before', 'Politician'], + ['Accou', 'after', 'Accountant'], + ['usicia', 'both', 'Musician'], + ]; + } } |