diff --git a/README.md b/README.md index 1f9cf1c..1b2912d 100644 --- a/README.md +++ b/README.md @@ -27,35 +27,18 @@ Requires the FriendsOfBehat [SymfonyExtension](https://github.com/FriendsOfBehat extensions: Persata\SymfonyApiExtension: ~ FriendsOfBehat\SymfonyExtension: + bootstrap: config/bootstrap.php kernel: - bootstrap: vendor/autoload.php + class: App\Kernel + path: src/Kernel.php + environment: test + debug: true ``` ## Additional Custom Contexts This package provides a `ContextInitializer` that will set the shared `ApiClient` on any Behat Contexts that implement the `ApiClientAwareContext`. It is best to extend the `RawApiContext` as this already includes the getter & setter for the `ApiClient` instance. -## ContextServiceExtension Integration - -If using the FriendsOfBehat [ContextServiceExtension](https://github.com/FriendsOfBehat/ContextServiceExtension), declare the `ApiContext` service like so: - -```yaml -services: - # ... - Persata\SymfonyApiExtension\Context\ApiContext: - tags: - - { name: fob.context_service } -``` - -If you need additional context services with access to the same shared ApiClient instance, have them extend `RawApiContext` and then declare the service like so: - -```yaml -services: - # ... - TheClass\Of\Your\CustomContext: - tags: - - { name: fob.context_service } -``` ## FOSRest Form Validation diff --git a/composer.json b/composer.json index c24dc54..fc5523e 100644 --- a/composer.json +++ b/composer.json @@ -16,15 +16,11 @@ "webmozart/assert": "^1.0", "symfony/http-kernel": "^3.0|^4.0", "symfony/browser-kit": "^3.0|^4.0", - "friends-of-behat/symfony-extension": "^0.2.1|^1.0" + "friends-of-behat/symfony-extension": "^2.0" }, "require-dev": { "phpunit/phpunit": "^6" }, - "suggest": { - "friends-of-behat/cross-container-extension": "^1.0", - "friends-of-behat/context-service-extension": "^1.0" - }, "autoload": { "psr-4": { "Persata\\SymfonyApiExtension\\": "src/" diff --git a/src/ServiceContainer/SymfonyApiExtension.php b/src/ServiceContainer/SymfonyApiExtension.php index 2cd95eb..a9eee9e 100644 --- a/src/ServiceContainer/SymfonyApiExtension.php +++ b/src/ServiceContainer/SymfonyApiExtension.php @@ -89,7 +89,7 @@ public function configure(ArrayNodeDefinition $builder) public function load(ContainerBuilder $container, array $config) { $container->setDefinition(self::API_CLIENT_ID, new Definition(ApiClient::class, [ - new Reference(SymfonyExtension::DRIVER_KERNEL_ID), + new Reference(SymfonyExtension::KERNEL_ID), $config['base_url'] ]));