public function testDeleteDeletesProductAndRelationsAndProductRequestReturnsTrue()
 {
     $index_repo = Mockery::mock('Giftertipster\\Repository\\ProductsIndex\\Product\\ProductsIndexProductRepositoryInterface');
     $index_repo->shouldReceive('deleteProductAndAdds')->with(1, true)->once()->andReturn(true);
     $this->app->instance('Giftertipster\\Repository\\ProductsIndex\\Product\\ProductsIndexProductRepositoryInterface', $index_repo);
     $data_repo = $this->dataRepoSetup();
     $this->getDataRepoData();
     //connect product to product request
     Factory::create('Giftertipster\\Entity\\Eloquent\\User', ['permissions' => []]);
     $prod_request = $this->app->make('Giftertipster\\Entity\\Eloquent\\ProductRequest');
     $prod_request->fill(['vendor' => 'test', 'vendor_id' => 100, 'user_id' => 1, 'product_id' => null]);
     $this->product->productRequest()->save($prod_request);
     $prod_request_check = $prod_request->where('product_id', '=', 1)->get();
     assertThat($prod_request_check, not(nullValue()));
     //add "add" to product
     $add_type = Factory::create('Giftertipster\\Entity\\Eloquent\\AddType');
     $add = Factory::create('Giftertipster\\Entity\\Eloquent\\Add', ['product_id' => 1, 'add_type_id' => 1]);
     assertThat($add->exists, identicalTo(true));
     $add->occasionCategories()->attach($this->occasion);
     assertThat($add->occasionCategories()->get()->count(), atLeast(1));
     //ACTION
     $response = $data_repo->delete(1);
     assertThat($response, identicalTo(true));
     //get product check data
     $product = $this->app->make('Giftertipster\\Entity\\Eloquent\\Product');
     $product_check = $product->find(1);
     //get product request check data
     $prod_request_check = $prod_request->where('product_id', '=', 1)->get()->toArray();
     //get keyword profile check data
     $keyword_profile = $this->app->make('Giftertipster\\Entity\\Eloquent\\KeywordProfile');
     $keyword_profile_check = $keyword_profile->get()->toArray();
     $occasion_category = $this->app->make('Giftertipster\\Entity\\Eloquent\\Category\\OccasionCategory');
     $occasion_category_count = $occasion_category->get()->count();
     //get "add" check data
     $add_check = $add->newInstance()->get()->toArray();
     $add_category_pivot_check = \DB::table('add_categories')->get();
     assertThat($product_check, nullValue());
     assertThat($prod_request_check, emptyArray());
     assertThat($keyword_profile_check, emptyArray());
     assertThat($occasion_category_count, greaterThan(0));
     assertThat($add_check, emptyArray());
     assertThat($add_category_pivot_check, emptyArray());
     assertThat(Product::get()->toArray(), emptyArray());
     assertThat(Image::get()->toArray(), emptyArray());
     assertThat(Description::get()->toArray(), emptyArray());
     assertThat(Feature::get()->toArray(), emptyArray());
     assertThat(SubProduct::get()->toArray(), emptyArray());
     assertThat(Variation::get()->toArray(), emptyArray());
 }