/** * @covers ::joinRels * @covers ::joinNestedRels */ public function testJoinRels() { $repo = User::getRepo(); $select = new Select($repo); $select->joinRels(['address', 'posts' => 'tags']); $this->assertEquals('SELECT `User`.* FROM `User` JOIN `Address` AS `address` ON `address`.`id` = `User`.`addressId` JOIN `Post` AS `posts` ON `posts`.`userId` = `User`.`id` JOIN `PostTag` AS `postTags` ON `postTags`.`postId` = `posts`.`id` JOIN `Tag` AS `tags` ON `tags`.`id` = `postTags`.`tagId`', $select->humanize()); }
/** * @return string $this */ public function humanize() { return $this->select->humanize(); }