From 2c1b3d9694e570c45ac82fcefbb51c965c6ea8a8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 15 Jun 2017 14:22:49 +0300 Subject: Merge pull request #5155 from tianhe1986/develop_count_ignore_limit Fix CI_DB_query_builder::count_all_results() returning wrong count with LIMIT/OFFSET --- tests/codeigniter/database/query_builder/count_test.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/codeigniter') diff --git a/tests/codeigniter/database/query_builder/count_test.php b/tests/codeigniter/database/query_builder/count_test.php index 90ac5283e..da312d866 100644 --- a/tests/codeigniter/database/query_builder/count_test.php +++ b/tests/codeigniter/database/query_builder/count_test.php @@ -35,4 +35,14 @@ class Count_test extends CI_TestCase { $this->assertEquals(2, $this->db->like('name', 'ian')->count_all_results('job')); } + // ------------------------------------------------------------------------ + + /** + * @see ./mocks/schema/skeleton.php + */ + public function test_count_all_results_limit() + { + $this->assertEquals(1, $this->db->like('name', 'ian')->limit(1)->count_all_results('job')); + } + } \ No newline at end of file -- cgit v1.2.3-24-g4f1b From ed1a0453a9372e88058169f2028c9a2140318961 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Jun 2017 08:25:23 +0300 Subject: [ci skip] Fix a bug in FV valid_email() --- tests/codeigniter/libraries/Form_validation_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/codeigniter') diff --git a/tests/codeigniter/libraries/Form_validation_test.php b/tests/codeigniter/libraries/Form_validation_test.php index 0815300e6..c9c404b43 100644 --- a/tests/codeigniter/libraries/Form_validation_test.php +++ b/tests/codeigniter/libraries/Form_validation_test.php @@ -270,7 +270,7 @@ class Form_validation_test extends CI_TestCase { public function test_rule_valid_email() { $this->assertTrue($this->form_validation->valid_email('email@sample.com')); - + $this->assertFalse($this->form_validation->valid_email('email@sample.com foo bar')); $this->assertFalse($this->form_validation->valid_email('valid_email', '@sample.com')); } -- cgit v1.2.3-24-g4f1b