public function testAcceptingAProductDeactivation() { $notification = new GammaNotification(['product_id' => 1, 'account_id' => 1, 'brand_id' => 1, 'category_id' => 1, 'type' => 'deactivate']); $notification->save(); $this->expectsJobs([DeactivateProduct::class, CleanupDetail::class]); $job = new AcceptGammaNotification($notification); $this->handleJob($job); }
public function startData() { $account1 = factory(Account::class)->create(); $digiredo = Account::find(1); $account2 = factory(Account::class)->create(); $category = factory(Category::class)->create(); $brand = factory(Brand::class)->create(); //create 3 products, but all a different account factory(Product::class)->create(['brand_id' => $brand->id, 'account_id' => $account1->id]); $notSee = factory(Product::class)->create(['brand_id' => $brand->id, 'account_id' => $account2->id]); factory(Product::class)->create(['brand_id' => $brand->id, 'account_id' => $digiredo->id]); //create notification $notification = new GammaNotification(['account_id' => $account1->id, 'brand_id' => $brand->id, 'category_id' => $category->id, 'type' => 'activate']); $notification->save(); return [$category->id, $account1->id, $brand->id, $notification, $notSee]; }