From 9341189a529e28007c7ff566aa5db91488ea7439 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 14 Apr 2018 16:45:56 +0300 Subject: Merge pull request #5464 from ytetsuro/fix/#5462/like-before-bug Fixed issue #5462 Query Builder LIKE BEFORE doesnt work --- .../database/query_builder/like_test.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/codeigniter/database') diff --git a/tests/codeigniter/database/query_builder/like_test.php b/tests/codeigniter/database/query_builder/like_test.php index 3672afae3..4d8673d99 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 array( + array('Developer', 'none', 'Developer'), + array('tician', 'before', 'Politician'), + array('Accou', 'after', 'Accountant'), + array('usicia', 'both', 'Musician'), + ); + } } -- cgit v1.2.3-24-g4f1b