Skip to content

Commit d690553

Browse files
committed
docs: add comments
1 parent f3fd116 commit d690553

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/system/Models/TimestampModelTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ public function testDoNotAllowDatesUpdateEntityUpdatesUpdatedAt(): void
163163
$this->assertSame('2023-11-25 12:00:00', (string) $user->updated_at);
164164
}
165165

166+
/**
167+
* We do not recommend to add timestamp fields to $allowedFields.
168+
* If you want to add old data to these fields, use Query Builder.
169+
*/
166170
public function testAllowDatesInsertArrayWithoutDatesSetsTimestamp(): void
167171
{
168172
Time::setTestNow('2023-11-25 12:00:00');
@@ -182,6 +186,10 @@ public function testAllowDatesInsertArrayWithoutDatesSetsTimestamp(): void
182186
$this->assertSame('2023-11-25 12:00:00', $user['updated_at']);
183187
}
184188

189+
/**
190+
* We do not recommend to add timestamp fields to $allowedFields.
191+
* If you want to add old data to these fields, use Query Builder.
192+
*/
185193
public function testAllowDatesInsertArrayWithDatesSetsTimestamp(): void
186194
{
187195
Time::setTestNow('2023-11-25 12:00:00');
@@ -201,6 +209,10 @@ public function testAllowDatesInsertArrayWithDatesSetsTimestamp(): void
201209
$this->assertSame('2000-01-01 12:00:00', $user['updated_at']);
202210
}
203211

212+
/**
213+
* We do not recommend to add timestamp fields to $allowedFields.
214+
* If you want to add old data to these fields, use Query Builder.
215+
*/
204216
public function testAllowDatesUpdateArrayUpdatesUpdatedAt(): void
205217
{
206218
Time::setTestNow('2023-11-25 12:00:00');
@@ -225,6 +237,10 @@ public function testAllowDatesUpdateArrayUpdatesUpdatedAt(): void
225237
$this->assertSame('2000-01-01 12:00:00', $user['updated_at']);
226238
}
227239

240+
/**
241+
* We do not recommend to add timestamp fields to $allowedFields.
242+
* If you want to add old data to these fields, use Query Builder.
243+
*/
228244
public function testAllowDatesUpdateEntityUpdatesUpdatedAt(): void
229245
{
230246
Time::setTestNow('2023-11-25 12:00:00');

0 commit comments

Comments
 (0)