Example #1
0
 /**
  * @covers ::join
  */
 public function testJoinSoftDelete()
 {
     $repo = Tag::getRepo();
     $repo->getConfig()->setSoftDelete(true);
     $rel = new HasManyThrough('tags', Post::getRepo()->getConfig(), 'Harp\\Harp\\Test\\TestModel\\Tag', 'postTags');
     $select = new Select(Post::getRepo());
     $rel->join($select, 'Address');
     $this->assertEquals('SELECT `Post`.* FROM `Post` JOIN `PostTag` AS `postTags` ON `postTags`.`postId` = `Address`.`id` JOIN `Tag` AS `tags` ON `tags`.`id` = `postTags`.`tagId` AND `tags`.`deletedAt` IS NULL', $select->humanize());
 }