Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed May 22, 2024
1 parent 0ac29fd commit 7667adf
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 33 deletions.
4 changes: 0 additions & 4 deletions tests/ActiveRecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,11 +882,8 @@ public function testGetDirtyAttributesOnNewRecord(): void

$this->assertSame(
[
'name' => null,
'address' => null,
'status' => 0,
'bool_status' => false,
'profile_id' => null,
],
$customer->getDirtyAttributes()
);
Expand All @@ -904,7 +901,6 @@ public function testGetDirtyAttributesOnNewRecord(): void
'address' => null,
'status' => 0,
'bool_status' => false,
'profile_id' => null,
],
$customer->getDirtyAttributes()
);
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
final class Category extends ActiveRecord
{
protected int|null $id = null;
protected int|null $id;
protected string $name;

public function getTableName(): string
Expand Down
6 changes: 3 additions & 3 deletions tests/Stubs/ActiveRecord/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class Customer extends ActiveRecord

protected int $id;
protected string $email;
protected string|null $name = null;
protected string|null $address = null;
protected string|null $name;
protected string|null $address;
protected int|null $status = 0;
protected bool|string|null $bool_status = false;
protected int|null $profile_id = null;
protected int|null $profile_id;

/**
* @var int|string
Expand Down
6 changes: 3 additions & 3 deletions tests/Stubs/ActiveRecord/CustomerClosureField.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ final class CustomerClosureField extends ActiveRecord
{
protected int $id;
protected string $email;
protected string|null $name = null;
protected string|null $address = null;
protected string|null $name;
protected string|null $address;
protected int|null $status = 0;
protected bool|string|null $bool_status = false;
protected int|null $profile_id = null;
protected int|null $profile_id;

public function getTableName(): string
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Stubs/ActiveRecord/CustomerForArrayable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class CustomerForArrayable extends ActiveRecord

protected int $id;
protected string $email;
protected string|null $name = null;
protected string|null $address = null;
protected string|null $name;
protected string|null $address;
protected int|null $status = 0;
protected bool|string|null $bool_status = false;
protected int|null $profile_id = null;
protected int|null $profile_id;

public function getTableName(): string
{
Expand Down
10 changes: 5 additions & 5 deletions tests/Stubs/ActiveRecord/CustomerWithAlias.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ final class CustomerWithAlias extends ActiveRecord

public int $id;
public string $email;
public string|null $name = null;
public string|null $address = null;
public int|null $status = null;
public bool|string|null $bool_status = null;
public int|null $profile_id = null;
public string|null $name;
public string|null $address;
public int|null $status;
public bool|string|null $bool_status;
public int|null $profile_id;

public function getTableName(): string
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Stubs/ActiveRecord/CustomerWithConstructor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ final class CustomerWithConstructor extends ActiveRecord
{
protected int $id;
protected string $email;
protected string|null $name = null;
protected string|null $address = null;
protected string|null $name;
protected string|null $address;
protected int|null $status = 0;
protected bool|string|null $bool_status = false;
protected int|null $profile_id = null;
protected int|null $profile_id;

public function __construct(ConnectionInterface $db, private Aliases $aliases)
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Stubs/ActiveRecord/NullValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
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 int|null $var1;
public int|null $var2;
public int|null $var3;
public string|null $stringcol;

public function getTableName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Order extends ActiveRecord
{
public const TABLE_NAME = 'order';

protected int|null $id = null;
protected int|null $id;
protected int $customer_id;
protected int $created_at;
protected float $total;
Expand Down
4 changes: 2 additions & 2 deletions tests/Stubs/ActiveRecord/OrderItemWithNullFK.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
final class OrderItemWithNullFK extends ActiveRecord
{
protected int|null $order_id = null;
protected int|null $item_id = null;
protected int|null $order_id;
protected int|null $item_id;
protected int $quantity;
protected float $subtotal;

Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/OrderWithNullFK.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
final class OrderWithNullFK extends ActiveRecord
{
protected int $id;
protected int|null $customer_id = null;
protected int|null $customer_id;
protected int $created_at;
protected float $total;

Expand Down
4 changes: 2 additions & 2 deletions tests/Stubs/ActiveRecord/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Type extends ActiveRecord
public int|null $smallint_col = 1;
public string $char_col;
public string|null $char_col2 = 'something';
public string|null $char_col3 = null;
public string|null $char_col3;
public float $float_col;
public float|null $float_col2 = 1.23;
public mixed $blob_col;
Expand All @@ -43,7 +43,7 @@ class Type extends ActiveRecord
public bool|int|string|null $bool_col2 = true;
public string|Expression $ts_default;
public int|string $bit_col = 0b1000_0010;
public array|null $json_col = null;
public array|null $json_col;

public function getTableName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/UserAR.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class UserAR extends ActiveRecord
public string $username;
public string $auth_key;
public string $password_hash;
public string|null $password_reset_token = null;
public string|null $password_reset_token;
public string $email;
public int $role = 10;
public int $status = 10;
Expand Down

0 comments on commit 7667adf

Please sign in to comment.