Skip to content

Commit 4d420b2

Browse files
authored
Fix endpoint path (#4)
1 parent 9acfb34 commit 4d420b2

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

src/Event/DocEvent.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Yoanm\SymfonyJsonRpcHttpServerDoc\Event;
44

55
use Symfony\Component\EventDispatcher\Event;
6-
use Yoanm\SymfonyJsonRpcHttpServerDoc\Model\DocumentationContext;
76

87
/**
98
* Class DocEvent

src/Resources/config/services.public.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
class: Yoanm\SymfonyJsonRpcHttpServerDoc\Creator\HttpServerDocCreator
1212
arguments:
1313
- '@event_dispatcher'
14-
- '%json_rpc_http_server_doc.http_endpoint_path%'
14+
- '%json_rpc_http_server.http_endpoint_path%'
1515
tags:
1616
- 'json_rpc_http_server.method_aware' # From yoanm/symfony-jsonrpc-http-server
1717

tests/Common/DependencyInjection/AbstractTestClass.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
use Symfony\Component\EventDispatcher\EventDispatcher;
77
use Tests\Common\Mock\ConcreteResolver;
88
use Yoanm\JsonRpcServer\Domain\JsonRpcMethodResolverInterface;
9+
use Yoanm\SymfonyJsonRpcHttpServer\DependencyInjection\JsonRpcHttpServerExtension;
910
use Yoanm\SymfonyJsonRpcHttpServerDoc\DependencyInjection\JsonRpcHttpServerDocExtension;
1011

1112
abstract class AbstractTestClass extends AbstractExtensionTestCase
1213
{
1314
const EXPECTED_DOC_PROVIDER_TAG = 'json_rpc_server_doc.doc_provider';
1415
const EXPECTED_EXTENSION_IDENTIFIER = 'json_rpc_http_server_doc';
15-
const EXPECTED_CHAIN_PROVIDER_SERVICE_ID = 'json_rpc_http_server_doc.finder.normalized_doc';
16+
const EXPECTED_NORMALIZED_DOC_FINDER_SERVICE_ID = 'json_rpc_http_server_doc.finder.normalized_doc';
1617

1718
// Public services
1819
const EXPECTED_ENDPOINT_SERVICE_ID = 'json_rpc_http_server_doc.endpoint';
@@ -35,6 +36,12 @@ protected function load(array $configurationValues = [], $mockResolver = true, $
3536
// Inject event dispatcher
3637
$this->setDefinition('event_dispatcher', new Definition(EventDispatcher::class));
3738

39+
// Mock json-rpc endpoint path
40+
$this->container->setParameter(
41+
JsonRpcHttpServerExtension::ENDPOINT_PATH_CONTAINER_PARAM_ID,
42+
'/fake-endpoint'
43+
);
44+
3845
if (true == $mockResolver) {
3946
$this->mockResolver();
4047
}

tests/Functional/Creator/HttpServerDocCreatorTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<?php
22
namespace Tests\Functional\Creator;
33

4-
use Grpc\Server;
54
use PHPUnit\Framework\TestCase;
65
use Prophecy\Argument;
76
use Prophecy\Prophecy\ObjectProphecy;
87
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
98
use Yoanm\JsonRpcServer\Domain\JsonRpcMethodInterface;
109
use Yoanm\JsonRpcServerDoc\Domain\Model\MethodDoc;
11-
use Yoanm\JsonRpcServerDoc\Domain\Model\ServerDoc;
1210
use Yoanm\SymfonyJsonRpcHttpServerDoc\Creator\HttpServerDocCreator;
1311
use Yoanm\SymfonyJsonRpcHttpServerDoc\Event\MethodDocCreatedEvent;
1412
use Yoanm\SymfonyJsonRpcHttpServerDoc\Event\ServerDocCreatedEvent;

tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
namespace Tests\Functional\DependencyInjection;
33

44
use Symfony\Component\DependencyInjection\Definition;
5-
use Symfony\Component\DependencyInjection\Exception\LogicException;
65
use Symfony\Component\DependencyInjection\Reference;
76
use Tests\Common\DependencyInjection\AbstractTestClass;
87
use Tests\Common\DependencyInjection\ConcreteDocProvider;
9-
use Tests\Common\DependencyInjection\ConcreteJsonRpcServerDispatcherAware;
10-
use Tests\Common\Mock\ConcreteParamsValidator;
11-
use Yoanm\JsonRpcServer\App\Dispatcher\JsonRpcServerDispatcherAwareTrait;
128
use Yoanm\SymfonyJsonRpcHttpServerDoc\DependencyInjection\JsonRpcHttpServerDocExtension;
139

1410
/**
@@ -50,7 +46,7 @@ public function testShouldReturnAnXsdValidationBasePath()
5046
$this->assertNotNull((new JsonRpcHttpServerDocExtension())->getXsdValidationBasePath());
5147
}
5248

53-
public function testShouldBindServerDispatcherToDispatcherAwareService()
49+
public function testShouldBindDocProviderToNormalizedDocFinder()
5450
{
5551
$docProviderServiceId = 'my-doc-provider';
5652
$docProviderServiceDefinition = new Definition(ConcreteDocProvider::class);
@@ -62,7 +58,7 @@ public function testShouldBindServerDispatcherToDispatcherAwareService()
6258

6359
// Assert custom resolver is an alias of the stub
6460
$this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
65-
self::EXPECTED_CHAIN_PROVIDER_SERVICE_ID,
61+
self::EXPECTED_NORMALIZED_DOC_FINDER_SERVICE_ID,
6662
'addProvider',
6763
[new Reference($docProviderServiceId)],
6864
0

tests/Functional/Endpoint/DocumentationEndpointTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
namespace Tests\Functional\Endpoint;
33

44
use PHPUnit\Framework\TestCase;
5-
use Prophecy\Argument;
65
use Prophecy\Prophecy\ObjectProphecy;
76
use Symfony\Component\HttpFoundation\Request;
87
use Symfony\Component\HttpFoundation\Response;
9-
use Yoanm\JsonRpcServer\Infra\Endpoint\JsonRpcEndpoint as SDKJsonRpcEndpoint;
108
use Yoanm\SymfonyJsonRpcHttpServerDoc\Endpoint\DocumentationEndpoint;
119
use Yoanm\SymfonyJsonRpcHttpServerDoc\Finder\NormalizedDocFinder;
1210
use Yoanm\SymfonyJsonRpcHttpServerDoc\Provider\RawDocProvider;

0 commit comments

Comments
 (0)