コード例 #1
0
ファイル: BelongsToManyTest.php プロジェクト: rashmi/newrepo
 /**
  * Tests that BelongsToMany can't use the join strategy
  *
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Invalid strategy "join" was provided
  * @return void
  */
 public function testStrategyFailure()
 {
     $assoc = new BelongsToMany('Test');
     $assoc->strategy(BelongsToMany::STRATEGY_JOIN);
 }
コード例 #2
0
 /**
  * Tests requiresKeys() method
  *
  * @return void
  */
 public function testRequiresKeys()
 {
     $assoc = new BelongsToMany('Test');
     $this->assertTrue($assoc->requiresKeys());
     $assoc->strategy(BelongsToMany::STRATEGY_SUBQUERY);
     $this->assertFalse($assoc->requiresKeys());
     $assoc->strategy(BelongsToMany::STRATEGY_SELECT);
     $this->assertTrue($assoc->requiresKeys());
 }