@@ -77,15 +77,12 @@ public function testConfigUpdate(): void
77
77
$ this ->environmentMock ->expects ($ this ->once ())
78
78
->method ('getCryptKey ' )
79
79
->willReturn ('TWFnZW50byBSb3g= ' );
80
- $ this ->loggerMock ->expects ($ this ->never ())
81
- ->method ('error ' )
82
- ->with (
83
- 'Crypt key missing. Add the crypt key to the "app/etc/env.php" file, or set the "CRYPT_KEY" '
84
- . 'environment variable in the Cloud Project web UI. '
85
- );
86
- $ this ->loggerMock ->expects ($ this ->once ())
80
+ $ this ->loggerMock ->expects ($ this ->exactly (2 ))
87
81
->method ('info ' )
88
- ->with ('Setting encryption key ' );
82
+ ->withConsecutive (
83
+ ['Checking existence of encryption key ' ],
84
+ [sprintf ('Setting encryption key from %s ' , Environment::VARIABLE_CRYPT_KEY )]
85
+ );
89
86
$ this ->configWriterMock ->expects ($ this ->once ())
90
87
->method ('update ' )
91
88
->with (['crypt ' => ['key ' => 'TWFnZW50byBSb3g= ' ]]);
@@ -107,15 +104,12 @@ public function testConfigUpdateWithError(): void
107
104
$ this ->environmentMock ->expects ($ this ->once ())
108
105
->method ('getCryptKey ' )
109
106
->willReturn ('TWFnZW50byBSb3g= ' );
110
- $ this ->loggerMock ->expects ($ this ->never ())
111
- ->method ('error ' )
112
- ->with (
113
- 'Crypt key missing. Add the crypt key to the "app/etc/env.php" file, or set the "CRYPT_KEY" '
114
- . 'environment variable in the Cloud Project web UI. '
115
- );
116
- $ this ->loggerMock ->expects ($ this ->once ())
107
+ $ this ->loggerMock ->expects ($ this ->exactly (2 ))
117
108
->method ('info ' )
118
- ->with ('Setting encryption key ' );
109
+ ->withConsecutive (
110
+ ['Checking existence of encryption key ' ],
111
+ [sprintf ('Setting encryption key from %s ' , Environment::VARIABLE_CRYPT_KEY )]
112
+ );
119
113
$ this ->configWriterMock ->expects ($ this ->once ())
120
114
->method ('update ' )
121
115
->with (['crypt ' => ['key ' => 'TWFnZW50byBSb3g= ' ]])
@@ -136,13 +130,8 @@ public function testEnvironmentVariableNotSet(): void
136
130
->method ('getCryptKey ' )
137
131
->willReturn ('' );
138
132
$ this ->loggerMock ->expects ($ this ->once ())
139
- ->method ('notice ' )
140
- ->with (
141
- 'Crypt key missing. Add the crypt key to the "app/etc/env.php" file, or set the "CRYPT_KEY" '
142
- . 'environment variable in the Cloud Project web UI. '
143
- );
144
- $ this ->loggerMock ->expects ($ this ->never ())
145
- ->method ('info ' );
133
+ ->method ('info ' )
134
+ ->with ('Checking existence of encryption key ' );
146
135
$ this ->configWriterMock ->expects ($ this ->never ())
147
136
->method ('update ' );
148
137
@@ -159,14 +148,9 @@ public function testKeyAlreadySet(): void
159
148
->willReturn (['crypt ' => ['key ' => 'QmVuIHd1eiBoZXJl ' ]]);
160
149
$ this ->environmentMock ->expects ($ this ->never ())
161
150
->method ('getCryptKey ' );
162
- $ this ->loggerMock ->expects ($ this ->never ())
163
- ->method ('notice ' )
164
- ->with (
165
- 'Crypt key missing. Add the crypt key to the "app/etc/env.php" file, or set the "CRYPT_KEY" '
166
- . 'environment variable in the Cloud Project web UI. '
167
- );
168
- $ this ->loggerMock ->expects ($ this ->never ())
169
- ->method ('info ' );
151
+ $ this ->loggerMock ->expects ($ this ->once ())
152
+ ->method ('info ' )
153
+ ->with ('Checking existence of encryption key ' );
170
154
$ this ->configWriterMock ->expects ($ this ->never ())
171
155
->method ('update ' );
172
156
0 commit comments