Skip to content

Commit c252363

Browse files
committed
Updates for code syntax to fix Static Tests build errors.
Update to PHPUnit test scenrio (some methods launched by condition after update).
1 parent 813f1d7 commit c252363

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function __construct(
4444

4545
/**
4646
* Return whole scopes config data from db.
47+
*
4748
* Ignore $path argument due to config source must return all config data
4849
*
4950
* @param string $path
@@ -64,6 +65,8 @@ public function get($path = '')
6465
}
6566

6667
/**
68+
* Retrieve default connection
69+
*
6770
* @return AdapterInterface
6871
*/
6972
private function getConnection()
@@ -86,7 +89,7 @@ private function getEntities($table, $keyField)
8689
$data = [];
8790
$tableName = $this->resourceConnection->getTableName($table);
8891
// Check if db table exists before fetch data
89-
if($this->resourceConnection->getConnection()->isTableExists($tableName)) {
92+
if ($this->resourceConnection->getConnection()->isTableExists($tableName)) {
9093
$entities = $this->getConnection()->fetchAll(
9194
$this->getConnection()->select()->from($tableName)
9295
);

app/code/Magento/Store/Test/Unit/App/Config/Source/RuntimeConfigSourceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public function setUp()
5353

5454
public function testGet()
5555
{
56-
$this->deploymentConfig->expects($this->once())
56+
$this->deploymentConfig->expects($this->any())
5757
->method('get')
5858
->with('db')
5959
->willReturn(true);
60-
$this->resourceConnection->expects($this->once())->method('getConnection')->willReturn($this->connection);
60+
$this->resourceConnection->expects($this->any())->method('getConnection')->willReturn($this->connection);
6161

6262
$selectMock = $this->getMockBuilder(Select::class)->disableOriginalConstructor()->getMock();
6363
$selectMock->expects($this->any())->method('from')->willReturnSelf();

0 commit comments

Comments
 (0)