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 ...@@ -43,10 +43,19 @@ class EcomDev_PHPUnit_Test_Case_Helper_Session
*/ */
public function helperMockSession($classAlias, array $methods = array()) 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) $sessionMock = EcomDev_PHPUnit_Helper::invoke('mockModel', $classAlias, $methods)
->disableOriginalConstructor(); ->disableOriginalConstructor();
TestUtil::replaceByMock('singleton', $classAlias, $sessionMock); TestUtil::replaceByMock('singleton', $classAlias, $sessionMock);
$sessionMock->expects($this->testCase->any())
->method('start')
->willReturnSelf();
return $sessionMock; return $sessionMock;
} }
...@@ -58,6 +67,8 @@ class EcomDev_PHPUnit_Test_Case_Helper_Session ...@@ -58,6 +67,8 @@ class EcomDev_PHPUnit_Test_Case_Helper_Session
*/ */
public function helperAdminSession(array $resources = array()) 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')); $session = $this->helperMockSession('admin/session', array('refreshAcl'));
$user = $this->createUser(); $user = $this->createUser();
$this->loadRules($user, $this->getAcl(), $resources); $this->loadRules($user, $this->getAcl(), $resources);
......
...@@ -292,7 +292,7 @@ class EcomDev_PHPUnit_Constraint_Layout_Block extends EcomDev_PHPUnit_Constraint ...@@ -292,7 +292,7 @@ class EcomDev_PHPUnit_Constraint_Layout_Block extends EcomDev_PHPUnit_Constraint
return false; 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