Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tests/system/Models/ReplaceModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ public function testReplaceProtectsFieldsWhenReturningSQL(): void

$this->assertIsString($sql);
$this->assertStringNotContainsString('description', $sql);
$this->seeInDatabase('job', ['id' => 1, 'name' => 'Developer']);

if ($this->db->DBDriver !== 'SQLSRV') {
$this->seeInDatabase('job', ['id' => 1, 'name' => 'Developer']);
}
}

public function testReplaceWithProtectionDisabled(): void
Expand Down Expand Up @@ -125,6 +128,10 @@ public function testReplaceWithoutAllowedFields(): void

public function testReplacePreservesCustomPrimaryKey(): void
{
if ($this->db->DBDriver === 'SQLSRV') {
$this->markTestSkipped('SQLSRV replace() requires an identity column.');
}

$model = $this->createModel(WithoutAutoIncrementModel::class);

$this->assertNotFalse($model->replace([
Expand Down Expand Up @@ -246,6 +253,10 @@ public static function provideReplaceWithEmptyDataUsesBuilderData(): iterable

public function testReplaceWithEmptyDataCanGenerateTimestamps(): void
{
if ($this->db->DBDriver === 'SQLSRV') {
$this->markTestSkipped('SQLSRV replace() deletes by key fields and rejects data without them.');
}

$model = $this->createModel(JobModel::class);
$this->setPrivateProperty($model, 'useTimestamps', true);

Expand Down
Loading