|
@@ 163-177 (lines=15) @@
|
| 160 |
|
* @depends testCreateNotification |
| 161 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
| 162 |
|
*/ |
| 163 |
|
public function testCreateNotificationThrowsInvalidArgumentExceptionOnMissingOwner() |
| 164 |
|
{ |
| 165 |
|
$repository = $this->getRepository(); |
| 166 |
|
|
| 167 |
|
/* BEGIN: Use Case */ |
| 168 |
|
$notificationService = $repository->getNotificationService(); |
| 169 |
|
|
| 170 |
|
$createStruct = new CreateStruct([ |
| 171 |
|
'type' => 'TEST', |
| 172 |
|
]); |
| 173 |
|
|
| 174 |
|
// This call will fail because notification owner is not specified |
| 175 |
|
$notificationService->createNotification($createStruct); |
| 176 |
|
/* END: Use Case */ |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
/** |
| 180 |
|
* @covers \eZ\Publish\API\Repository\NotificationService::createNotification() |
|
@@ 184-198 (lines=15) @@
|
| 181 |
|
* @depends testCreateNotification |
| 182 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
| 183 |
|
*/ |
| 184 |
|
public function testCreateNotificationThrowsInvalidArgumentExceptionOnMissingType() |
| 185 |
|
{ |
| 186 |
|
$repository = $this->getRepository(); |
| 187 |
|
|
| 188 |
|
/* BEGIN: Use Case */ |
| 189 |
|
$notificationService = $repository->getNotificationService(); |
| 190 |
|
|
| 191 |
|
$createStruct = new CreateStruct([ |
| 192 |
|
'ownerId' => 14, |
| 193 |
|
]); |
| 194 |
|
|
| 195 |
|
// This call will fail because notification type is not specified |
| 196 |
|
$notificationService->createNotification($createStruct); |
| 197 |
|
/* END: Use Case */ |
| 198 |
|
} |
| 199 |
|
} |
| 200 |
|
|