Closed kenjis closed 2 years ago
8.1
4.3 (fee2620b2077d1957e2ed0f9d0a745ab39c2a3af)
Git
macOS
cli-server (PHP built-in webserver)
No response
ArgumentCountError : 4 arguments are required, 2 given /.../CodeIgniter4/system/Database/BaseBuilder.php:2330 /.../CodeIgniter4/system/Database/BaseBuilder.php:2229 /.../CodeIgniter4/tests/system/Database/Builder/UpdateTest.php:229
The following test fails.
public function testUpdateBatch() { $builder = new BaseBuilder('%start', $this->db); $updateData = [ [ 'id' => 2, 'name' => 'Comedian', 'description' => 'There\'s something in your teeth', ], [ 'id' => 3, 'name' => 'Cab Driver', 'description' => 'I am yellow', ], ]; $this->db->shouldReturn('execute', 1)->shouldReturn('affectedRows', 1); $builder->updateBatch($updateData, 'id'); $query = $this->db->getLastQuery(); $this->assertInstanceOf(MockQuery::class, $query); $expected = <<<'EOF' UPDATE "%start" SET "name" = _u."name", "description" = _u."description" FROM ( SELECT 2 "id", 'Comedian' "name", 'There''s something in your teeth' "description" UNION ALL SELECT 3 "id", 'Cab Driver' "name", 'I am yellow' "description" ) _u WHERE "%start"."id" = _u."id" EOF; $this->assertSame($expected, $query->getQuery()); }
No error.
See https://github.com/codeigniter4/CodeIgniter4/pull/6373#pullrequestreview-1113028610
https://github.com/codeigniter4/CodeIgniter4/pull/6536 now should fix this.
Fixed by #6536
PHP Version
8.1
CodeIgniter4 Version
4.3 (fee2620b2077d1957e2ed0f9d0a745ab39c2a3af)
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
macOS
Which server did you use?
cli-server (PHP built-in webserver)
Database
No response
What happened?
Steps to Reproduce
The following test fails.
Expected Output
No error.
Anything else?
See https://github.com/codeigniter4/CodeIgniter4/pull/6373#pullrequestreview-1113028610