Skip to content

Commit b09cbd1

Browse files
committed
fix services declared as public for tests in the wrong place
1 parent 81c7c62 commit b09cbd1

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ Pre-requisites (see [composer.json](composer.json)) :
7777
- ext-pgsql
7878
- [Symfony local web server](https://symfony.com/doc/current/setup/symfony_server.html)
7979

80+
Create an account on [OpenWeatherMap](https://home.openweathermap.org/api_keys) and copy your api key:
81+
82+
```
83+
# in /.env.dev.local
84+
OPENWEATHER_API_KEY=xxx
85+
```
86+
8087
Start local dev environment with:
8188

8289
```

config/packages/test/services.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ services:
77
factory: ['WireMock\Client\WireMock', 'create']
88
# See docker-compose.yml
99
arguments: ['wiremock', '8080']
10+
11+
# Mark Secondary Ports (Hexagonal Architecture meaning) public to allow mocking them in behat tests
12+
# To be done in config/services.yml if concrete class, or in config/packages/test/services.yml if Interface
13+
App\Domain\WeatherProvider: ~
14+
App\Domain\RunningSessionRepository: ~

config/services.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,10 @@ services:
2929
# please note that last definitions always *replace* previous ones
3030

3131
# Mark Command/Query handlers public to allow mocking them in controller tests
32+
# To be done in config/services.yml if concrete class, or in config/packages/test/services.yml if Interface
3233
App\Application\Command\RegisterRunningSessionHandler:
3334
public: true
3435

35-
# Mark Secondary Ports (Hexagonal Architecture meaning) public to allow mocking them in behat tests
36-
App\Domain\WeatherProvider:
37-
public: true
38-
App\Domain\RunningSessionRepository:
39-
public: true
40-
4136
guzzle.accuweather:
4237
class: GuzzleHttp\Client
4338
arguments:

0 commit comments

Comments
 (0)