Skip to content

Commit b85e8ea

Browse files
author
Sergey Semenov
committed
Merge remote-tracking branch 'origin/MAGETWO-50767' into BUGS
2 parents 782cd5c + 9107e87 commit b85e8ea

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

app/code/Magento/Theme/Model/Design/Backend/Theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function invalidateCache($forceInvalidate = false)
8787
*/
8888
public function getValue()
8989
{
90-
return $this->getData('value') != '' ? $this->getData('value') : null;
90+
return $this->getData('value') !== null ? $this->getData('value') : '';
9191
}
9292

9393
/**

app/code/Magento/Theme/Test/Unit/Model/Design/Backend/ThemeTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,26 @@ public function testAfterSave($callNumber, $oldValue)
111111
$this->assertInstanceOf(get_class($this->model), $this->model->afterSave());
112112
}
113113

114+
/**
115+
* @param string|null $value
116+
* @param string $expectedResult
117+
* @return void
118+
* @dataProvider getValueDataProvider
119+
*/
120+
public function testGetValue($value, $expectedResult)
121+
{
122+
$this->model->setValue($value);
123+
$this->assertEquals($expectedResult, $this->model->getValue());
124+
}
125+
126+
public function getValueDataProvider()
127+
{
128+
return [
129+
[null, ''],
130+
['value', 'value']
131+
];
132+
}
133+
114134
public function afterSaveDataProvider()
115135
{
116136
return [

0 commit comments

Comments
 (0)