From e09bb32c0dfad21669b5cbcc12bd1ad66a938e46 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Sat, 23 Apr 2016 20:56:31 +0200 Subject: [PATCH 1/6] add build status icon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 629700a..b7e04df 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Symfony CMF Resource REST API Bundle -[![Build Status](https://secure.travis-ci.org/symfony-cmf/ResourceRestBundle.png?branch=master)](http://travis-ci.org/symfony-cmf/ResourceRestBundle) +[![Build Status](https://travis-ci.org/symfony-cmf/resource-rest-bundle.svg?branch=master)](https://travis-ci.org/symfony-cmf/resource-rest-bundle) [![StyleCI](https://styleci.io/repos/29090266/shield)](https://styleci.io/repos/29090266) [![Latest Stable Version](https://poser.pugx.org/symfony-cmf/resource-rest-bundle/version.png)](https://packagist.org/packages/symfony-cmf/resource-rest-bundle) [![Total Downloads](https://poser.pugx.org/symfony-cmf/resource-rest-bundle/d/total.png)](https://packagist.org/packages/symfony-cmf/resource-rest-bundle) From 7231043316a462d000a595b4642c724f1e0a95ec Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Tue, 24 May 2016 00:29:11 +0200 Subject: [PATCH 2/6] basicially implement endpoints to move/rename and delete a editable resource. --- Controller/ResourceController.php | 65 ++++++++++++++++++++++++++- Resources/config/routing.yml | 23 +++++++++- Tests/Resources/app/config/config.php | 1 + 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/Controller/ResourceController.php b/Controller/ResourceController.php index 2226226..0f4e66b 100644 --- a/Controller/ResourceController.php +++ b/Controller/ResourceController.php @@ -11,10 +11,15 @@ namespace Symfony\Cmf\Bundle\ResourceRestBundle\Controller; +use PHPCR\Util\PathHelper; +use Puli\Repository\Api\EditableRepository; +use Puli\Repository\Api\ResourceRepository; use Symfony\Cmf\Component\Resource\RepositoryRegistryInterface; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use JMS\Serializer\SerializerInterface; use JMS\Serializer\SerializationContext; +use Symfony\Component\Routing\Exception\RouteNotFoundException; class ResourceController { @@ -29,7 +34,8 @@ class ResourceController private $serializer; /** - * @param RepositoryInterface + * @param SerializerInterface $serializer + * @param RepositoryRegistryInterface $registry */ public function __construct( SerializerInterface $serializer, @@ -39,7 +45,7 @@ public function __construct( $this->registry = $registry; } - public function resourceAction($repositoryName, $path) + public function getResourceAction($repositoryName, $path) { $repository = $this->registry->get($repositoryName); $resource = $repository->get('/'.$path); @@ -58,4 +64,59 @@ public function resourceAction($repositoryName, $path) return $response; } + + /** + * There are two different changes that can currently be done on a cmf resource: + * + * - move + * - rename + * + * changing payload properties isn't supported yet. + * + * @param string $repositoryName + * @param string $path + * @param Request $request + */ + public function patchResourceAction($repositoryName, $path, Request $request) + { + $repository = $this->registry->get($repositoryName); + $this->failOnNotEditable($repository, $repositoryName); + + $resourcePath = $request->get('path'); + $resourceName = $request->get('name'); + if ($path !== $resourcePath) { + $repository->move($path, $resourcePath); + } elseif ($resourceName !== PathHelper::getNodeName($path)) { + $targetPath = PathHelper::getParentPath($path).'/'.$resourceName; + $repository->move($path, $targetPath); + } + } + + /** + * Delete a resource of a repository. + * + * @param string $repositoryName + * @param string $path + * + * @return Response + */ + public function deleteResourceAction($repositoryName, $path) + { + $repository = $this->registry->get($repositoryName); + $this->failOnNotEditable($repository, $repositoryName); + + $deleted = $repository->remove($path); + if (0 === $deleted) { + return new Response('', Response::HTTP_BAD_REQUEST); + } + + return new Response('', Response::HTTP_NO_CONTENT); + } + + private function failOnNotEditable(ResourceRepository $repository, $repositoryName) + { + if (!$repository instanceof EditableRepository) { + throw new RouteNotFoundException(sprintf('Repository %s is not editable.', $repositoryName)); + } + } } diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index cd0619d..08f48f0 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -1,7 +1,26 @@ -_cmf_resource: +_delete_cmf_resource: path: /api/{repositoryName}/{path} + methods: ['delete'] requirements: path: .* defaults: - _controller: cmf_resource_rest.controller.resource:resourceAction + _controller: cmf_resource_rest.controller.resource:deleteResourceAction + _format: json + +_patch_cmf_resource: + path: /api/{repositoryName}/{path} + methods: ['patch'] + requirements: + path: .* + defaults: + _controller: cmf_resource_rest.controller.resource:patchResourceAction + _format: json + +_get_cmf_resource: + path: /api/{repositoryName}/{path} + methods: ['get'] + requirements: + path: .* + defaults: + _controller: cmf_resource_rest.controller.resource:getResourceAction _format: json diff --git a/Tests/Resources/app/config/config.php b/Tests/Resources/app/config/config.php index 1f3cd43..296dc46 100644 --- a/Tests/Resources/app/config/config.php +++ b/Tests/Resources/app/config/config.php @@ -10,6 +10,7 @@ */ $container->setParameter('cmf_testing.bundle_fqn', 'Symfony\Cmf\Bundle\ResourceRestBundle'); +$container->setParameter('kernel.environment', 'test'); $loader->import(CMF_TEST_CONFIG_DIR.'/dist/parameters.yml'); $loader->import(CMF_TEST_CONFIG_DIR.'/dist/framework.php'); $loader->import(CMF_TEST_CONFIG_DIR.'/dist/monolog.yml'); From e80602cfa5779324e2058cc949ad2aa31a7739c9 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Fri, 27 May 2016 23:34:33 +0200 Subject: [PATCH 3/6] add messages, refactore output --- Controller/ResourceController.php | 82 +++++++++++++++++++++++-------- composer.json | 13 ++++- 2 files changed, 73 insertions(+), 22 deletions(-) diff --git a/Controller/ResourceController.php b/Controller/ResourceController.php index 0f4e66b..ebe965e 100644 --- a/Controller/ResourceController.php +++ b/Controller/ResourceController.php @@ -50,19 +50,7 @@ public function getResourceAction($repositoryName, $path) $repository = $this->registry->get($repositoryName); $resource = $repository->get('/'.$path); - $context = SerializationContext::create(); - $context->enableMaxDepthChecks(); - $context->setSerializeNull(true); - $json = $this->serializer->serialize( - $resource, - 'json', - $context - ); - - $response = new Response($json); - $response->headers->set('Content-Type', 'application/json'); - - return $response; + return $this->createResponse($resource); } /** @@ -73,9 +61,11 @@ public function getResourceAction($repositoryName, $path) * * changing payload properties isn't supported yet. * - * @param string $repositoryName - * @param string $path + * @param string $repositoryName + * @param string $path * @param Request $request + * + * @return Response */ public function patchResourceAction($repositoryName, $path, Request $request) { @@ -84,12 +74,32 @@ public function patchResourceAction($repositoryName, $path, Request $request) $resourcePath = $request->get('path'); $resourceName = $request->get('name'); + + $targetPath = null; if ($path !== $resourcePath) { - $repository->move($path, $resourcePath); + $targetPath = $resourcePath; } elseif ($resourceName !== PathHelper::getNodeName($path)) { - $targetPath = PathHelper::getParentPath($path).'/'.$resourceName; - $repository->move($path, $targetPath); + $targetPath = $targetPath = PathHelper::absolutizePath($repositoryName, PathHelper::getParentPath($path)); + } + + if (null == $targetPath) { + return $this->badRequestRespons('Move and rename is supported only.'); } + + $moved = 0; + try { + $moved = $repository->move($path, $targetPath); + } catch (\InvalidArgumentException $e) { + return $this->badRequestResponse($e->getMessage()); + } + + if (0 === $moved) { + return $this->badRequestResponse('Nothing moved or renamed'); + } + + $resource = $repository->get($targetPath); + + return $this->createResponse($resource); } /** @@ -107,10 +117,10 @@ public function deleteResourceAction($repositoryName, $path) $deleted = $repository->remove($path); if (0 === $deleted) { - return new Response('', Response::HTTP_BAD_REQUEST); + return $this->badRequestResponse('Nothing was deleted'); } - return new Response('', Response::HTTP_NO_CONTENT); + return $this->createResponse('', Response::HTTP_NO_CONTENT); } private function failOnNotEditable(ResourceRepository $repository, $repositoryName) @@ -119,4 +129,36 @@ private function failOnNotEditable(ResourceRepository $repository, $repositoryNa throw new RouteNotFoundException(sprintf('Repository %s is not editable.', $repositoryName)); } } + + /** + * @param string $message + * + * @return Response + */ + private function badRequestResponse($message) + { + return $this->createResponse(['message' => $message], Response::HTTP_BAD_REQUEST); + } + + /** + * @param object|array $resource + * @param int $httpStatusCode + * @return Response + */ + private function createResponse($resource, $httpStatusCode = Response::HTTP_OK) + { + $context = SerializationContext::create(); + $context->enableMaxDepthChecks(); + $context->setSerializeNull(true); + $json = $this->serializer->serialize( + $resource, + 'json', + $context + ); + + $response = new Response($json, $httpStatusCode); + $response->headers->set('Content-Type', 'application/json'); + + return $response; + } } diff --git a/composer.json b/composer.json index 93c8f77..0f9b4be 100644 --- a/composer.json +++ b/composer.json @@ -9,11 +9,20 @@ "homepage": "https://github.com/symfony-cmf/symfony-cmf/contributors" } ], + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/ElectricMaxxx/resource-bundle.git" + }, + { + "type": "vcs", + "url": "https://github.com/ElectricMaxxx/resource.git" + } + ], "minimum-stability": "dev", - "prefer-stable": true, "require": { "php": "^5.5.6|^7.0", - "symfony-cmf/resource-bundle": "1.*", + "symfony-cmf/resource-bundle": "dev-test_move_add_remove", "jms/serializer-bundle": "1.*" }, "require-dev": { From e6de622af9ce848c571d31cba70138e3e0b9868e Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Sat, 28 May 2016 00:28:24 +0200 Subject: [PATCH 4/6] remove php 5.4 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 467be0e..d54afb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ php: - 5.6 - 7.0 - hhvm - + sudo: false cache: From 01f30df880cf817d2bdcad55fa315e5aeebc6f6c Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Mon, 30 May 2016 16:00:36 +0200 Subject: [PATCH 5/6] fix unit test issues due to change in puli interface namings --- Controller/ResourceController.php | 14 +++++--------- Enhancer/EnhancerInterface.php | 9 ++++----- Enhancer/PayloadEnhancer.php | 4 ++-- Enhancer/SonataAdminEnhancer.php | 4 ++-- Registry/EnhancerRegistry.php | 4 +++- Registry/PayloadAliasRegistry.php | 6 +++--- .../Jms/EventSubscriber/ResourceSubscriber.php | 7 +++---- Serializer/Jms/Handler/ResourceHandler.php | 8 ++++---- Tests/Unit/Registry/PayloadAliasRegistryTest.php | 4 +++- .../Serializer/Jms/Handler/ResourceHandlerTest.php | 2 +- 10 files changed, 30 insertions(+), 32 deletions(-) diff --git a/Controller/ResourceController.php b/Controller/ResourceController.php index ebe965e..a5b4ef3 100644 --- a/Controller/ResourceController.php +++ b/Controller/ResourceController.php @@ -86,17 +86,12 @@ public function patchResourceAction($repositoryName, $path, Request $request) return $this->badRequestRespons('Move and rename is supported only.'); } - $moved = 0; try { - $moved = $repository->move($path, $targetPath); + $repository->move($path, $targetPath); } catch (\InvalidArgumentException $e) { return $this->badRequestResponse($e->getMessage()); } - if (0 === $moved) { - return $this->badRequestResponse('Nothing moved or renamed'); - } - $resource = $repository->get($targetPath); return $this->createResponse($resource); @@ -115,9 +110,10 @@ public function deleteResourceAction($repositoryName, $path) $repository = $this->registry->get($repositoryName); $this->failOnNotEditable($repository, $repositoryName); - $deleted = $repository->remove($path); - if (0 === $deleted) { - return $this->badRequestResponse('Nothing was deleted'); + try { + $repository->remove($path); + } catch (\InvalidArgumentException $e) { + return $this->badRequestResponse($e->getMessage()); } return $this->createResponse('', Response::HTTP_NO_CONTENT); diff --git a/Enhancer/EnhancerInterface.php b/Enhancer/EnhancerInterface.php index 5c5a1a5..5ca0209 100644 --- a/Enhancer/EnhancerInterface.php +++ b/Enhancer/EnhancerInterface.php @@ -11,8 +11,7 @@ namespace Symfony\Cmf\Bundle\ResourceRestBundle\Enhancer; -use JMS\Serializer\Context; -use Puli\Repository\Api\Resource\PuliResource; +use Puli\Repository\Api\Resource\Resource; /** * Enhancer classes enhance the REST response for resources. @@ -28,8 +27,8 @@ interface EnhancerInterface * * $context->addData('foobar', 'Some value'); * - * @param Context Serialization context - * @param resource The resource being serialized + * @param [] $data Context Serialization context + * @param Resource $resource The resource being serialized */ - public function enhance(array $data, PuliResource $resource); + public function enhance(array $data, Resource $resource); } diff --git a/Enhancer/PayloadEnhancer.php b/Enhancer/PayloadEnhancer.php index ce2b027..10cc437 100644 --- a/Enhancer/PayloadEnhancer.php +++ b/Enhancer/PayloadEnhancer.php @@ -11,7 +11,7 @@ namespace Symfony\Cmf\Bundle\ResourceRestBundle\Enhancer; -use Puli\Repository\Api\Resource\PuliResource; +use Puli\Repository\Api\Resource\Resource; /** * Serialize the payload. @@ -23,7 +23,7 @@ class PayloadEnhancer implements EnhancerInterface /** * {@inheritdoc} */ - public function enhance(array $data, PuliResource $resource) + public function enhance(array $data, Resource $resource) { $payload = $resource->getPayload(); $data['payload'] = $payload; diff --git a/Enhancer/SonataAdminEnhancer.php b/Enhancer/SonataAdminEnhancer.php index 0db84f5..a49f44d 100644 --- a/Enhancer/SonataAdminEnhancer.php +++ b/Enhancer/SonataAdminEnhancer.php @@ -14,7 +14,7 @@ use Sonata\AdminBundle\Admin\Pool; use Doctrine\Common\Util\ClassUtils; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Puli\Repository\Api\Resource\PuliResource; +use Puli\Repository\Api\Resource\Resource; /** * Add links and meta-info from Sonata Admin. @@ -48,7 +48,7 @@ public function __construct(Pool $pool, UrlGeneratorInterface $urlGenerator) /** * {@inheritdoc} */ - public function enhance(array $data, PuliResource $resource) + public function enhance(array $data, Resource $resource) { $object = $resource->getPayload(); diff --git a/Registry/EnhancerRegistry.php b/Registry/EnhancerRegistry.php index 5283601..b57feaf 100644 --- a/Registry/EnhancerRegistry.php +++ b/Registry/EnhancerRegistry.php @@ -11,6 +11,7 @@ namespace Symfony\Cmf\Bundle\ResourceRestBundle\Registry; +use Symfony\Cmf\Bundle\ResourceRestBundle\Enhancer\EnhancerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -65,7 +66,8 @@ public function getEnhancers($repositoryAlias) } $aliases = $this->enhancerMap[$repositoryAlias]; - + $enhancers = []; + foreach ($aliases as $alias) { if (!isset($this->aliasMap[$alias])) { throw new \InvalidArgumentException(sprintf( diff --git a/Registry/PayloadAliasRegistry.php b/Registry/PayloadAliasRegistry.php index c8db6ab..e9c06cb 100644 --- a/Registry/PayloadAliasRegistry.php +++ b/Registry/PayloadAliasRegistry.php @@ -11,9 +11,9 @@ namespace Symfony\Cmf\Bundle\ResourceRestBundle\Registry; +use Puli\Repository\Api\Resource\Resource; use Symfony\Cmf\Component\Resource\RepositoryRegistryInterface; use Symfony\Cmf\Component\Resource\Repository\Resource\CmfResource; -use Puli\Repository\Api\Resource\PuliResource; /** * Registry for resource payload aliases. @@ -54,11 +54,11 @@ public function __construct( /** * Return the alias for the given PHPCR resource. * - * @param resource $resource + * @param Resource $resource * * @return string */ - public function getPayloadAlias(PuliResource $resource) + public function getPayloadAlias(Resource $resource) { $repositoryType = $this->repositoryRegistry->getRepositoryType( $resource->getRepository() diff --git a/Serializer/Jms/EventSubscriber/ResourceSubscriber.php b/Serializer/Jms/EventSubscriber/ResourceSubscriber.php index 17bbb94..f64d137 100644 --- a/Serializer/Jms/EventSubscriber/ResourceSubscriber.php +++ b/Serializer/Jms/EventSubscriber/ResourceSubscriber.php @@ -14,8 +14,7 @@ use JMS\Serializer\EventDispatcher\EventSubscriberInterface; use JMS\Serializer\EventDispatcher\Events; use JMS\Serializer\EventDispatcher\PreSerializeEvent; -use Puli\Repository\Api\ResourceCollection; -use Puli\Repository\Api\Resource\PuliResource; +use Puli\Repository\Api\Resource\Resource; /** * Force instaces of ResourceCollection to type "ResourceCollection". @@ -41,8 +40,8 @@ public function onPreSerialize(PreSerializeEvent $event) { $object = $event->getObject(); - if ($object instanceof PuliResource) { - $event->setType('Puli\Repository\Api\Resource\PuliResource'); + if ($object instanceof Resource) { + $event->setType('Puli\Repository\Api\Resource\Resource'); } } } diff --git a/Serializer/Jms/Handler/ResourceHandler.php b/Serializer/Jms/Handler/ResourceHandler.php index 65f064c..86a1664 100644 --- a/Serializer/Jms/Handler/ResourceHandler.php +++ b/Serializer/Jms/Handler/ResourceHandler.php @@ -22,7 +22,7 @@ use Symfony\Cmf\Bundle\ResourceRestBundle\Registry\PayloadAliasRegistry; use Symfony\Cmf\Bundle\ResourceRestBundle\Registry\EnhancerRegistry; use Symfony\Cmf\Component\Resource\Repository\Resource\CmfResource; -use Puli\Repository\Api\Resource\PuliResource; +use Puli\Repository\Api\Resource\Resource; /** * Handle PHPCR resource serialization. @@ -51,7 +51,7 @@ public static function getSubscribingMethods() array( 'event' => GraphNavigator::DIRECTION_SERIALIZATION, 'format' => 'json', - 'type' => 'Puli\Repository\Api\Resource\PuliResource', + 'type' => 'Puli\Repository\Api\Resource\Resource', 'method' => 'serializeResource', ), ); @@ -65,7 +65,7 @@ public static function getSubscribingMethods() */ public function serializeResource( JsonSerializationVisitor $visitor, - PuliResource $resource, + Resource $resource, array $type, Context $context ) { @@ -73,7 +73,7 @@ public function serializeResource( $context->accept($data); } - private function doSerializeResource(PuliResource $resource, $depth = 0) + private function doSerializeResource(Resource $resource, $depth = 0) { $data = array(); $repositoryAlias = $this->registry->getRepositoryAlias($resource->getRepository()); diff --git a/Tests/Unit/Registry/PayloadAliasRegistryTest.php b/Tests/Unit/Registry/PayloadAliasRegistryTest.php index ccb4f83..44d2f91 100644 --- a/Tests/Unit/Registry/PayloadAliasRegistryTest.php +++ b/Tests/Unit/Registry/PayloadAliasRegistryTest.php @@ -15,7 +15,9 @@ class PayloadAliasRegistryTest extends \PHPUnit_Framework_TestCase { - private $registry; + private $repositoryRegistry; + private $resource; + private $repository; public function setUp() { diff --git a/Tests/Unit/Serializer/Jms/Handler/ResourceHandlerTest.php b/Tests/Unit/Serializer/Jms/Handler/ResourceHandlerTest.php index 9f2d2a8..269977a 100644 --- a/Tests/Unit/Serializer/Jms/Handler/ResourceHandlerTest.php +++ b/Tests/Unit/Serializer/Jms/Handler/ResourceHandlerTest.php @@ -64,7 +64,7 @@ public function testHandler() $this->enhancerRegistry->getEnhancers('repo')->willReturn(array( $this->enhancer, )); - $this->enhancer->enhance(Argument::type('array'), Argument::type('Puli\Repository\Api\Resource\PuliResource')) + $this->enhancer->enhance(Argument::type('array'), Argument::type('Puli\Repository\Api\Resource\Resource')) ->will(function ($data, $resource) { return $data[0]; }); From fcd3f0aae763a6b30211a5e3c1e51fc71508a7c9 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Fri, 3 Jun 2016 11:48:41 +0200 Subject: [PATCH 6/6] start testing on patch --- Controller/ResourceController.php | 12 ++++----- Tests/Features/resource_api_phpcr_odm.feature | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/Controller/ResourceController.php b/Controller/ResourceController.php index a5b4ef3..b3c9ce6 100644 --- a/Controller/ResourceController.php +++ b/Controller/ResourceController.php @@ -11,6 +11,7 @@ namespace Symfony\Cmf\Bundle\ResourceRestBundle\Controller; +use PHPCR\PathNotFoundException; use PHPCR\Util\PathHelper; use Puli\Repository\Api\EditableRepository; use Puli\Repository\Api\ResourceRepository; @@ -72,14 +73,13 @@ public function patchResourceAction($repositoryName, $path, Request $request) $repository = $this->registry->get($repositoryName); $this->failOnNotEditable($repository, $repositoryName); - $resourcePath = $request->get('path'); - $resourceName = $request->get('name'); + $resourceName = $request->get('node_name'); $targetPath = null; - if ($path !== $resourcePath) { - $targetPath = $resourcePath; - } elseif ($resourceName !== PathHelper::getNodeName($path)) { - $targetPath = $targetPath = PathHelper::absolutizePath($repositoryName, PathHelper::getParentPath($path)); + if ($path !== $path) { + $targetPath = $path; + } elseif ($resourceName !== PathHelper::getLocalNodeName(PathHelper::absolutizePath($path))) { + $targetPath = PathHelper::absolutizePath($repositoryName, PathHelper::getParentPath($path)); } if (null == $targetPath) { diff --git a/Tests/Features/resource_api_phpcr_odm.feature b/Tests/Features/resource_api_phpcr_odm.feature index 2a01da5..0bac060 100644 --- a/Tests/Features/resource_api_phpcr_odm.feature +++ b/Tests/Features/resource_api_phpcr_odm.feature @@ -90,3 +90,30 @@ Feature: PHPCR-ODM resource repository } } """ + @doNow + Scenario: Rename a PHPCR-ODM resource + Given there exists a "Article" document at "/cmf/articles/foo": + | title | Article 1 | + | body | This is my article | + Then I set header "Content-Type" with value "application/json" + When I send a PATCH request to "/api/phpcrodm_repo/foo" with body: + """ + {"node_name": "foo-bar"} + """ + Then the response code should be 200 + When I send a GET request to "/api/phpcrodm_repo/foo-bar" + Then the response code should be 200 + And the response should contain json: + """ + { + "repository_alias": "phpcrodm_repo", + "repository_type": "doctrine_phpcr_odm", + "payload_alias": "article", + "payload_type": "Symfony\\Cmf\\Bundle\\ResourceRestBundle\\Tests\\Resources\\TestBundle\\Document\\Article", + "path": "\/foo-bar", + "node_name": "foo-bar", + "label": "foo-bar", + "repository_path": "\/foo-bar", + "children": [] + } + """