/** * @test */ public function shouldCreateSql() { //given $restriction = Restrictions::isNotNull(); //when $sql = $restriction->toSql('category_id'); //then $this->assertEquals('category_id IS NOT NULL', $sql); }
/** * @test */ public function shouldReturnModelUsingIsNotNullRestriction() { //given $product = Product::create(array('name' => 'tech', 'description' => 'some desc')); Product::create(array('name' => 'tech')); //when $loadedProduct = Product::where(array('description' => Restrictions::isNotNull()))->fetch(); //then Assert::thatModel($loadedProduct)->isEqualTo($product); }