Skip to content

Commit 00d2b2a

Browse files
authored
Merge pull request #6692 from sclubricants/FixUpsertTest
Fix UpsertTest::testUpsertWithMultipleSet
2 parents af3b843 + 2598f51 commit 00d2b2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/system/Database/Live/UpsertTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,19 +624,19 @@ public function testUpsertWithMultipleSet()
624624
{
625625
$builder = $this->db->table('user');
626626

627-
$ts = 'DATE(CURRENT_TIMESTAMP)';
627+
$ts = "DATE('2022-10-01 12:00:00')";
628628
if ($this->db->DBDriver === 'OCI8') {
629-
$ts = "to_char(CURRENT_TIMESTAMP, 'yyyy-mm-dd')";
629+
$ts = "to_char(TO_DATE('2022-10-01 12:00:00','yyyy/mm/dd hh24:mi:ss'), 'yyyy-mm-dd')";
630630
} elseif ($this->db->DBDriver === 'SQLSRV') {
631-
$ts = 'CAST( GETDATE() AS date )';
631+
$ts = "CAST('2022-10-01 12:00:00' AS date)";
632632
}
633633

634634
$builder->set('email', '[email protected]');
635635
$builder->set('name', 'Jarvis');
636636
$builder->set('country', $ts, false);
637637
$builder->upsert();
638638

639-
$dt = date('Y-m-d');
639+
$dt = '2022-10-01';
640640

641641
$this->seeInDatabase('user', ['email' => '[email protected]', 'name' => 'Jarvis', 'country' => $dt]);
642642
}

0 commit comments

Comments
 (0)