Skip to content

Commit

Permalink
Update tests/Driver/Oracle/ActiveRecordTest.php
Browse files Browse the repository at this point in the history
Co-authored-by: Sergei Tigrov <[email protected]>
  • Loading branch information
niqingyang and Tigrov authored Dec 11, 2023
1 parent 2b82b2b commit 32cc7b4
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions tests/Driver/Oracle/ActiveRecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]),
);
}
}

0 comments on commit 32cc7b4

Please sign in to comment.