Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jun 2, 2024
1 parent 7d9791c commit 4378dda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions tests/ActiveRecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ public function testStoreEmpty(): void

$record = new NullValues($this->db);

$record->var1 = null;
$record->var2 = null;
$record->var3 = null;
/** this is to simulate empty html form submission */
$record->var1 = '';
$record->var2 = '';
$record->var3 = '';
$record->stringcol = '';
$record->save();

Expand Down
13 changes: 7 additions & 6 deletions tests/Stubs/ActiveRecord/NullValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

/**
* Class NullValues.
*
* @property int $id
* @property int $var1
* @property int $var2
* @property int $var3
* @property string $stringcol
*/
#[\AllowDynamicProperties]
final class NullValues extends ActiveRecord
{
public int $id;
public int|null $var1 = null;
public int|null $var2 = null;
public int|null $var3 = null;
public string|null $stringcol = null;

public function getTableName(): string
{
return 'null_values';
Expand Down

0 comments on commit 4378dda

Please sign in to comment.