예제 #1
0
 /**
  * @covers ::join
  */
 public function testJoinSoftDelete()
 {
     $rel = new BelongsTo('user', Address::getRepo()->getConfig(), 'Harp\\Harp\\Test\\TestModel\\User');
     $select = new Select(Address::getRepo());
     $rel->join($select, 'Address');
     $this->assertEquals('SELECT `Address`.* FROM `Address` JOIN `User` AS `user` ON `user`.`id` = `Address`.`userId` AND `user`.`deletedAt` IS NULL', $select->humanize());
 }
예제 #2
0
 /**
  * @covers ::getLink
  */
 public function testGetLink()
 {
     $user = User::find(1);
     $link = $user->getLink('address');
     $this->assertSame($user, $link->getModel());
     $this->assertSame(Address::getRepo(), $link->getRel()->getRepo());
 }