add() public method

Add a category to the DB.
public add ( array $name, $text ) : static
$name array
$text
return static
 /** @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);
 }
示例#2
0
 /**
  * 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);
 }