/** @test */ function it_store_a_category(CategoryDB $categoryRepository) { $categoryName = 'hello'; $categoryText = 'wow'; $categoryRepository->add($categoryName, $categoryText)->shouldBeCalled()->willReturn(new NotificationCategory()); $this->add($categoryName, $categoryText)->shouldReturnAnInstanceOf(NotificationCategory::class); }
/** * Add a category to the DB. * * @param array $name * @param $text * @return \Fenos\Notifynder\Models\NotificationCategory */ public function add($name, $text) { return $this->categoryRepo->add($name, $text); }