Skip to content

Bug: testMode() does not work with upsert() #6687

@kenjis

Description

@kenjis

Related: #6600

The following code does not work.

        $userData = [
            'email'   => '[email protected]',
            'name'    => 'Upsert One',
            'country' => 'US',
        ];
        $builder = $this->db->table('user');
        $builder->testMode()->upsert($userData);
        $sql = $builder->getCompiledUpsert();
CodeIgniter\Database\Exceptions\DatabaseException : setData() has no data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix themdatabaseIssues or pull requests that affect the database layer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions