-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests/Driver/Oracle/ActiveRecordTest.php
Co-authored-by: Sergei Tigrov <[email protected]>
- Loading branch information
1 parent
2b82b2b
commit 32cc7b4
Showing
1 changed file
with
0 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,58 +167,4 @@ public function testToArrayWithClosure(): void | |
$customer->toArray(), | ||
); | ||
} | ||
|
||
public function testToArrayForArrayable(): void | ||
{ | ||
$this->checkFixture($this->db, 'customer', true); | ||
|
||
$customerQuery = new ActiveQuery(CustomerForArrayable::class, $this->db); | ||
|
||
/** @var CustomerForArrayable $customer */ | ||
$customer = $customerQuery->findOne(1); | ||
/** @var CustomerForArrayable $customer2 */ | ||
$customer2 = $customerQuery->findOne(2); | ||
/** @var CustomerForArrayable $customer3 */ | ||
$customer3 = $customerQuery->findOne(3); | ||
|
||
$customer->setItem($customer2); | ||
$customer->setItems($customer3); | ||
|
||
$this->assertSame( | ||
[ | ||
'id' => 1, | ||
'email' => '[email protected]', | ||
'name' => 'user1', | ||
'address' => 'address1', | ||
'status' => 'active', | ||
'item' => [ | ||
'id' => 2, | ||
'email' => '[email protected]', | ||
'name' => 'user2', | ||
'status' => 'active', | ||
], | ||
'items' => [ | ||
[ | ||
'id' => 3, | ||
'email' => '[email protected]', | ||
'name' => 'user3', | ||
'status' => 'inactive', | ||
], | ||
], | ||
], | ||
$customer->toArray([ | ||
'id', | ||
'name', | ||
'email', | ||
'address', | ||
'status', | ||
'item.id', | ||
'item.name', | ||
'item.email', | ||
'items.0.id', | ||
'items.0.name', | ||
'items.0.email', | ||
]), | ||
); | ||
} | ||
} |