Skip to content

Commit

Permalink
Test serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jul 7, 2024
1 parent c8d7a5e commit 4bd6087
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/ActiveRecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1089,4 +1089,24 @@ public function testWithFactoryNonInitiated(): void

$customer = $order->getCustomerWithFactory();
}

public function testSerialization(): void
{
$this->checkFixture($this->db(), 'customer');

$customer = new Customer();

$this->assertStringStartsWith(
'O:54:"Yiisoft\\ActiveRecord\\Tests\\Stubs\\ActiveRecord\\Customer"',
serialize($customer)
);

$customerQuery = new ActiveQuery(Customer::class);
$customer = $customerQuery->findOne(1);

$this->assertStringStartsWith(
'O:54:"Yiisoft\\ActiveRecord\\Tests\\Stubs\\ActiveRecord\\Customer"',
serialize($customer)
);
}
}

0 comments on commit 4bd6087

Please sign in to comment.