/** * 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); }
/** * 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()); }