From 4ccc1fc93050d043b4483e5d72f92fafa32002e5 Mon Sep 17 00:00:00 2001 From: ytetsuro Date: Tue, 3 Apr 2018 19:42:16 +0900 Subject: feat: add test code --- .../database/query_builder/like_test.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/codeigniter/database/query_builder/like_test.php') 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'], + ]; + } } -- cgit v1.2.3-24-g4f1b