Skip to content
Permalink
Browse files

Merge branch 'b-6.x'

# Conflicts:
#	tests/Unit/Application/Controller/ViewConfigTest.php
  • Loading branch information
Sieg committed Nov 14, 2019
2 parents 77eb9cb + 2f65190 commit f64a6eab49e8dd0f84bdb4b41aa6dd617a1e12ef
Showing with 14 additions and 12 deletions.
  1. +14 −12 tests/Unit/Application/Controller/ViewConfigTest.php
@@ -72,7 +72,7 @@ public function testGetHomeLinkEng()
*
* @return array
*/
public function testGetHomeLinkDataProvider()
public function getHomeLinkDataProvider()
{
$sShopUrl = $this->getConfig()->getShopUrl();
@@ -98,7 +98,7 @@ public function testGetHomeLinkDataProvider()
* @param int $iDefaultBrowserLanguage default browser language
* @param string $sExpectedUrl expected URL
*
* @dataProvider testGetHomeLinkDataProvider
* @dataProvider getHomeLinkDataProvider
*/
public function testGetHomeLink($iDefaultShopLanguage, $iDefaultBrowserLanguage, $sExpectedUrl)
{
@@ -152,13 +152,17 @@ public function testGetShowWishlist()
*/
public function testGetShowCompareList()
{
$oView = $this->getMock(\OxidEsales\Eshop\Core\Controller\BaseController::class, array('getIsOrderStep'));
$oView->expects($this->once())->method('getIsOrderStep')->will($this->returnValue(true));
$oView = $this->createPartialMock(\OxidEsales\Eshop\Core\Controller\BaseController::class, array('getIsOrderStep'));
$oView->expects($this->any())->method('getIsOrderStep')->will($this->returnValue(true));
$oCfg = $this->getMock(\OxidEsales\Eshop\Core\Config::class, array('getConfigParam', 'getActiveView'));
$oCfg->expects($this->at(0))->method('getConfigParam')->with($this->equalTo('bl_showCompareList'))->will($this->returnValue(true));
$oCfg->expects($this->at(1))->method('getConfigParam')->with($this->equalTo('blDisableNavBars'))->will($this->returnValue(true));
$oCfg->expects($this->at(2))->method('getActiveView')->will($this->returnValue($oView));
$oCfg = $this->createPartialMock(\OxidEsales\Eshop\Core\Config::class, array('getConfigParam', 'getActiveView'));
$oCfg->expects($this->any())
->method('getConfigParam')
->will($this->returnValueMap([
['bl_showCompareList', true],
['blDisableNavBars', true]
]));
$oCfg->expects($this->any())->method('getActiveView')->will($this->returnValue($oView));
$oVC = oxNew(\OxidEsales\Eshop\Core\ViewConfig::class);
\OxidEsales\Eshop\Core\Registry::set(\OxidEsales\Eshop\Core\Config::class, $oCfg);
@@ -214,7 +218,6 @@ public function testGetLogoutLink()
$oCfg->expects($this->once())
->method('isSsl')
->will($this->returnValue(false));
\OxidEsales\Eshop\Core\Registry::set(\OxidEsales\Eshop\Core\Config::class, $oCfg);
Registry::set(Config::class, $oCfg);
@@ -266,7 +269,6 @@ public function testGetLogoutLinkSsl()
$oCfg->expects($this->once())
->method('isSsl')
->will($this->returnValue(true));
\OxidEsales\Eshop\Core\Registry::set(\OxidEsales\Eshop\Core\Config::class, $oCfg);
Registry::set(Config::class, $oCfg);
@@ -822,12 +824,12 @@ public function testGetTopActiveClassName()
public function testIsFunctionalityEnabled()
{
$oConfig = $this->getMock(\OxidEsales\Eshop\Core\Config::class, array("getConfigParam"));
$oConfig = $this->createPartialMock(\OxidEsales\Eshop\Core\Config::class, array("getConfigParam"));
$oConfig->expects($this->once())->method("getConfigParam")->with($this->equalTo('bl_showWishlist'))->will($this->returnValue("will"));
Registry::set(Config::class, $oConfig);
$oViewConfig = oxNew(ViewConfig::class);
Registry::set(Config::class, $oConfig);
$this->assertTrue($oViewConfig->isFunctionalityEnabled('bl_showWishlist'));
}

0 comments on commit f64a6ea

Please sign in to comment.
You can’t perform that action at this time.