Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed May 24, 2024
1 parent c0503c1 commit 3e951d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tests/ActiveQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1981,10 +1981,10 @@ public function testInverseOfDynamic(): void

/** request the inverseOf relation as array */
$orders2 = $customer->getOrders2Query()->asArray()->all();
$this->assertEquals($customer['id'], $orders2[0]['customer2']['id']);
$this->assertEquals($customer->getId(), $orders2[0]['customer2']->getId());

$orders2 = $customer->getOrders2Query()->asArray()->onePopulate();
$this->assertEquals($customer['id'], $orders2['customer2']['id']);
$this->assertEquals($customer->getId(), $orders2['customer2']->getId());
}

public function testOptimisticLock(): void
Expand Down
24 changes: 12 additions & 12 deletions tests/BatchQueryResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public function testQuery(): void
}

$this->assertCount(3, $allRows);
$this->assertEquals('user1', $allRows[0]['name']);
$this->assertEquals('user2', $allRows[1]['name']);
$this->assertEquals('user3', $allRows[2]['name']);
$this->assertEquals('user1', $allRows[0]->getName());
$this->assertEquals('user2', $allRows[1]->getName());
$this->assertEquals('user3', $allRows[2]->getName());

/** rewind */
$allRows = [];
Expand Down Expand Up @@ -79,9 +79,9 @@ public function testQuery(): void
}

$this->assertCount(3, $allRows);
$this->assertEquals('address1', $allRows['user1']['address']);
$this->assertEquals('address2', $allRows['user2']['address']);
$this->assertEquals('address3', $allRows['user3']['address']);
$this->assertEquals('address1', $allRows['user1']->getAddress());
$this->assertEquals('address2', $allRows['user2']->getAddress());
$this->assertEquals('address3', $allRows['user3']->getAddress());

/** each */
$customerQuery = new ActiveQuery(Customer::class, $this->db);
Expand All @@ -94,9 +94,9 @@ public function testQuery(): void
$allRows[$index] = $row;
}
$this->assertCount(3, $allRows);
$this->assertEquals('user1', $allRows[0]['name']);
$this->assertEquals('user2', $allRows[1]['name']);
$this->assertEquals('user3', $allRows[2]['name']);
$this->assertEquals('user1', $allRows[0]->getName());
$this->assertEquals('user2', $allRows[1]->getName());
$this->assertEquals('user3', $allRows[2]->getName());

/** each with key */
$customerQuery = new ActiveQuery(Customer::class, $this->db);
Expand All @@ -110,9 +110,9 @@ public function testQuery(): void
}

$this->assertCount(3, $allRows);
$this->assertEquals('address1', $allRows['user1']['address']);
$this->assertEquals('address2', $allRows['user2']['address']);
$this->assertEquals('address3', $allRows['user3']['address']);
$this->assertEquals('address1', $allRows['user1']->getAddress());
$this->assertEquals('address2', $allRows['user2']->getAddress());
$this->assertEquals('address3', $allRows['user3']->getAddress());
}

public function testActiveQuery(): void
Expand Down

0 comments on commit 3e951d0

Please sign in to comment.