Skip to content

Commit c3f8950

Browse files
authored
ISSUE-33802: ensure that deployment config will reload its data, if the key was not found
Update tests
1 parent 92fa1fd commit c3f8950

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfigTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -234,31 +234,31 @@ public function testResetDataOnMissingConfig(): void
234234
$this->assertEquals($defaultValue, $result);
235235
}
236236

237-
public function testNoEnvVariables()
237+
public function testNoEnvVariables(): void
238238
{
239-
$this->reader->expects($this->once())->method('load')->willReturn(['a'=>'b']);
240-
$this->assertSame('b', $this->_deploymentConfig->get('a'));
239+
$this->readerMock->expects($this->once())->method('load')->willReturn(['a'=>'b']);
240+
$this->assertSame('b', $this->deploymentConfig->get('a'));
241241
}
242242

243-
public function testEnvVariables()
243+
public function testEnvVariables(): void
244244
{
245-
$this->reader->expects($this->once())->method('load')->willReturn([]);
245+
$this->readerMock->expects($this->once())->method('load')->willReturn([]);
246246
putenv('MAGENTO_DC__OVERRIDE={"a": "c"}');
247-
$this->assertSame('c', $this->_deploymentConfig->get('a'));
247+
$this->assertSame('c', $this->deploymentConfig->get('a'));
248248
}
249249

250-
public function testEnvVariablesWithNoBaseConfig()
250+
public function testEnvVariablesWithNoBaseConfig(): void
251251
{
252-
$this->reader->expects($this->once())->method('load')->willReturn(['a'=>'b']);
252+
$this->readerMock->expects($this->once())->method('load')->willReturn(['a'=>'b']);
253253
putenv('MAGENTO_DC_A=c');
254254
putenv('MAGENTO_DC_B__B__B=D');
255-
$this->assertSame('c', $this->_deploymentConfig->get('a'));
256-
$this->assertSame('D', $this->_deploymentConfig->get('b/b/b'));
255+
$this->assertSame('c', $this->deploymentConfig->get('a'));
256+
$this->assertSame('D', $this->deploymentConfig->get('b/b/b'));
257257
}
258258

259-
public function testEnvVariablesSubstitution()
259+
public function testEnvVariablesSubstitution(): void
260260
{
261-
$this->reader->expects($this->once())
261+
$this->readerMock->expects($this->once())
262262
->method('load')
263263
->willReturn(
264264
[
@@ -269,8 +269,8 @@ public function testEnvVariablesSubstitution()
269269
);
270270
putenv('MAGENTO_DC____A=c');
271271
putenv('MAGENTO_DC____B=D');
272-
$this->assertSame('c', $this->_deploymentConfig->get('a'));
273-
$this->assertSame('D', $this->_deploymentConfig->get('b'), 'return value from env');
274-
$this->assertSame('e$%^&', $this->_deploymentConfig->get('c'), 'return default value');
272+
$this->assertSame('c', $this->deploymentConfig->get('a'));
273+
$this->assertSame('D', $this->deploymentConfig->get('b'), 'return value from env');
274+
$this->assertSame('e$%^&', $this->deploymentConfig->get('c'), 'return default value');
275275
}
276276
}

0 commit comments

Comments
 (0)