We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit decb1d48 authored by Ivan Chepurnyi's avatar Ivan Chepurnyi

Fix minor issues with controller tests for admin panel

parent c2c493f4
......@@ -43,10 +43,19 @@ class EcomDev_PHPUnit_Test_Case_Helper_Session
*/
public function helperMockSession($classAlias, array $methods = array())
{
if (!empty($methods) && !in_array('start', $methods, true)) {
$methods[] = 'start';
}
$sessionMock = EcomDev_PHPUnit_Helper::invoke('mockModel', $classAlias, $methods)
->disableOriginalConstructor();
TestUtil::replaceByMock('singleton', $classAlias, $sessionMock);
$sessionMock->expects($this->testCase->any())
->method('start')
->willReturnSelf();
return $sessionMock;
}
......@@ -58,6 +67,8 @@ class EcomDev_PHPUnit_Test_Case_Helper_Session
*/
public function helperAdminSession(array $resources = array())
{
$this->helperMockSession('core/session', array('renew'));
$this->helperMockSession('adminhtml/session', array('renew'));
$session = $this->helperMockSession('admin/session', array('refreshAcl'));
$user = $this->createUser();
$this->loadRules($user, $this->getAcl(), $resources);
......
......@@ -292,7 +292,7 @@ class EcomDev_PHPUnit_Constraint_Layout_Block extends EcomDev_PHPUnit_Constraint
return false;
}
return $blockInfo['root'] === true;
return $blockInfo['is_root'] === true;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment