From 0694254c3f8c0d5e829663c6479eaaa870933aca Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 20 Aug 2021 00:28:00 -0700 Subject: [PATCH] Add PHP config example (#19) * Add PHP config example * Syntax --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8700a7a..65279dd 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,30 @@ return [ You need to tell the bundle what services you want to mock. That could be done with the "`happyr_service_mock`" service tag or by defining a list of service ids: +
+PHP config +
+ +```php +services([ + \App\AcmeApiClient::class + \App\Some\OtherService::class + ]); +}; + +``` + +
+
+Yaml config +
+ ```yaml # config/packages/test/happyr_service_mocking.yaml @@ -47,6 +71,8 @@ happyr_service_mocking: - 'App\Some\OtherService' ``` +
+ ## Usage ```php @@ -109,6 +135,6 @@ the Kernel is rebooted. ## Limitations This trick will not work if you have two different PHP processes, i.e. you are running -your tests with Panther, Selenium etc. +your tests with Panther, Selenium etc. We can also not create a proxy if your service is final.