Skip to content

Commit 6054ce8

Browse files
committed
Fixed
1 parent a0c4364 commit 6054ce8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/system/Database/Live/UpsertTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,21 +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 )';
632-
} elseif ($this->db->DBDriver === 'SQLite3') {
633-
$ts = "DATE(datetime(CURRENT_TIMESTAMP, 'localtime'))";
631+
$ts = "CAST('2022-10-01 12:00:00' AS date )";
634632
}
635633

636634
$builder->set('email', '[email protected]');
637635
$builder->set('name', 'Jarvis');
638636
$builder->set('country', $ts, false);
639637
$builder->upsert();
640638

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

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

0 commit comments

Comments
 (0)