spec/Fenos/Notifynder/Categories/CategoryManagerSpec.php 1 location
|
@@ 47-56 (lines=10) @@
|
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
/** @test */ |
| 47 |
|
function it_store_a_category(CategoryDB $categoryRepository) |
| 48 |
|
{ |
| 49 |
|
$categoryName = 'hello'; |
| 50 |
|
$categoryText = 'wow'; |
| 51 |
|
|
| 52 |
|
$categoryRepository->add($categoryName,$categoryText)->shouldBeCalled() |
| 53 |
|
->willReturn(new NotificationCategory()); |
| 54 |
|
|
| 55 |
|
$this->add($categoryName,$categoryText)->shouldReturnAnInstanceOf(NotificationCategory::class); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
/** @test */ |
| 59 |
|
function it_delete_a_category_by_id(CategoryDB $categoryRepository) |
spec/Fenos/Notifynder/Builder/NotifynderBuilderSpec.php 1 location
|
@@ 121-132 (lines=12) @@
|
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
/** @test */ |
| 121 |
|
function it_add_a_category_id_to_the_builder_givin_the_name_of_it(CategoryManager $category, NotificationCategory $categoryModel) |
| 122 |
|
{ |
| 123 |
|
$name = 'category.name'; |
| 124 |
|
$category_id = 1; |
| 125 |
|
|
| 126 |
|
$category->findByName($name)->shouldBeCalled() |
| 127 |
|
->willReturn($categoryModel); |
| 128 |
|
|
| 129 |
|
$categoryModel->getAttribute('id')->willReturn($category_id); |
| 130 |
|
|
| 131 |
|
$this->category($name)->shouldReturnAnInstanceOf(NotifynderBuilder::class); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
/** @test */ |
| 135 |
|
function it_add_the_extra_parameter_to_the_builder() |