/** * @test * @group sqlite3 */ public function shouldThrowExceptionIfAliasInUpdateQuery() { //when CatchException::when(Category::alias('c')->where(array('c.name' => 'old')))->update(array('name' => "new")); //then CatchException::assertThat()->isInstanceOf('\\InvalidArgumentException'); }
/** * @test */ public function shouldFetchHasOneWithAlias() { //when $searchCategory = Category::alias('c')->innerJoin('product_named_billy', 'p')->fetch(); //then $product = self::getNoLazy($searchCategory, 'product_named_billy'); $this->assertEquals('billy', $product->name); }