/** * @test */ public function shouldReturnNullForEmptyArray() { //given $restriction = Restrictions::isNotIn(array()); //when $sql = $restriction->toSql('category_id'); //then $this->assertNull($sql); }
/** * @test */ public function shouldReturnModelUsingIsNotInRestrictionWithEmptyArrayAndMultipleItemsInWhereClauseWithSeveralWhere() { //given $product = Product::create(array('name' => 'name1', 'description' => 'desc')); //when $loadedProduct = Product::where(array('description' => 'desc'))->where(array('name' => Restrictions::isNotIn(array())))->fetch(); //then Assert::thatModel($loadedProduct)->isEqualTo($product); }