|
@@ 488-496 (lines=9) @@
|
| 485 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
| 486 |
|
* @covers \eZ\Publish\API\Repository\LocationService::createLocation |
| 487 |
|
*/ |
| 488 |
|
public function testCreateLocationThrowsInvalidArgumentExceptionLocationExistsBelowParent() |
| 489 |
|
{ |
| 490 |
|
$locationService = $this->repository->getLocationService(); |
| 491 |
|
$contentService = $this->repository->getContentService(); |
| 492 |
|
|
| 493 |
|
$locationCreateStruct = $locationService->newLocationCreateStruct(5); |
| 494 |
|
$contentInfo = $contentService->loadContentInfo(12); |
| 495 |
|
$locationService->createLocation($contentInfo, $locationCreateStruct); |
| 496 |
|
} |
| 497 |
|
|
| 498 |
|
/** |
| 499 |
|
* Test creating a location throwing InvalidArgumentException. |
|
@@ 504-513 (lines=10) @@
|
| 501 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
| 502 |
|
* @covers \eZ\Publish\API\Repository\LocationService::createLocation |
| 503 |
|
*/ |
| 504 |
|
public function testCreateLocationThrowsInvalidArgumentExceptionExistingRemoteId() |
| 505 |
|
{ |
| 506 |
|
$locationService = $this->repository->getLocationService(); |
| 507 |
|
$contentService = $this->repository->getContentService(); |
| 508 |
|
|
| 509 |
|
$locationCreateStruct = $locationService->newLocationCreateStruct(2); |
| 510 |
|
$locationCreateStruct->remoteId = '769380b7aa94541679167eab817ca893'; |
| 511 |
|
$contentInfo = $contentService->loadContentInfo(4); |
| 512 |
|
$locationService->createLocation($contentInfo, $locationCreateStruct); |
| 513 |
|
} |
| 514 |
|
|
| 515 |
|
/** |
| 516 |
|
* Test creating a location throwing InvalidArgumentException. |
|
@@ 521-529 (lines=9) @@
|
| 518 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
| 519 |
|
* @covers \eZ\Publish\API\Repository\LocationService::createLocation |
| 520 |
|
*/ |
| 521 |
|
public function testCreateLocationThrowsInvalidArgumentExceptionParentIsASubLocation() |
| 522 |
|
{ |
| 523 |
|
$locationService = $this->repository->getLocationService(); |
| 524 |
|
$contentService = $this->repository->getContentService(); |
| 525 |
|
|
| 526 |
|
$locationCreateStruct = $locationService->newLocationCreateStruct(44); |
| 527 |
|
$contentInfo = $contentService->loadContentInfo(4); |
| 528 |
|
$locationService->createLocation($contentInfo, $locationCreateStruct); |
| 529 |
|
} |
| 530 |
|
|
| 531 |
|
/** |
| 532 |
|
* Test updating location. |