/** * Tests that HasMany can't use the join strategy * * @expectedException \InvalidArgumentException * @expectedExceptionMessage Invalid strategy "join" was provided * @return void */ public function testStrategyFailure() { $assoc = new HasMany('Test'); $assoc->strategy(HasMany::STRATEGY_JOIN); }
/** * Tests requiresKeys() method * * @return void */ public function testRequiresKeys() { $assoc = new HasMany('Test'); $this->assertTrue($assoc->requiresKeys()); $assoc->strategy(HasMany::STRATEGY_SUBQUERY); $this->assertFalse($assoc->requiresKeys()); $assoc->strategy(HasMany::STRATEGY_SELECT); $this->assertTrue($assoc->requiresKeys()); }