Skip to content

Commit f7ef247

Browse files
committed
Add Test
1 parent 9feaf2c commit f7ef247

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/system/Database/Live/UpsertTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,4 +640,18 @@ public function testUpsertWithMultipleSet()
640640

641641
$this->seeInDatabase('user', ['email' => '[email protected]', 'name' => 'Jarvis', 'country' => $dt]);
642642
}
643+
644+
public function testUpsertWithTestModeAndGetCompiledUpsert()
645+
{
646+
$userData = [
647+
'email' => '[email protected]',
648+
'name' => 'Upsert One',
649+
'country' => 'US',
650+
];
651+
$builder = $this->db->table('user');
652+
$builder->testMode()->upsert($userData);
653+
$sql = $builder->getCompiledUpsert();
654+
655+
$this->assertStringContainsString('[email protected]', $sql);
656+
}
643657
}

0 commit comments

Comments
 (0)