diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php index 915bb123be583..a843f53ee202c 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php @@ -121,7 +121,11 @@ protected function setUp() false ); - $this->_menuMock = $this->getMock('Magento\Backend\Model\Menu', array(), array(), '', false); + $this->_menuMock = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $this->_menuBuilderMock = $this->getMock('Magento\Backend\Model\Menu\Builder', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php index bdae94029bd78..719d2f46ad028 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php @@ -251,7 +251,11 @@ public function testIsAllowedReturnsFalseIfResourceIsNotAvailable() public function testGetChildrenCreatesSubmenuOnFirstCall() { - $menuMock = $this->getMock('Magento\Backend\Model\Menu', array(), array(), '', false); + $menuMock = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $this->_menuFactoryMock->expects($this->once())->method('create')->will($this->returnValue($menuMock)); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php index dcad003b47088..084410f0785de 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php @@ -79,7 +79,7 @@ public function testAddDoLogAddAction() public function testAddToItem() { - $subMenu = $this->getMock("Magento\Backend\Model\Menu", array(), array($this->_logger)); + $subMenu = $this->getMock('Magento\Backend\Model\Menu', array(), array($this->_logger)); $subMenu->expects($this->once())->method("add")->with($this->_items['item2']); $this->_items['item1']->expects($this->once())->method("getChildren")->will($this->returnValue($subMenu)); @@ -152,7 +152,11 @@ public function testMove() $this->_model->add($this->_items['item2']); $this->_model->add($this->_items['item3']); - $subMenu = $this->getMock("Magento\Backend\Model\Menu", array(), array(), '', false); + $subMenu = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $subMenu->expects($this->once())->method("add")->with($this->_items['item3']); $this->_items['item1']->expects($this->once())->method("getChildren")->will($this->returnValue($subMenu)); @@ -201,7 +205,11 @@ public function testRemoveRemovesMenuItem() public function testRemoveRemovesMenuItemRecursively() { - $menuMock = $this->getMock('Magento\Backend\Model\Menu', array(), array(), '', false); + $menuMock = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $menuMock->expects($this->once())->method('remove')->with($this->equalTo('item2')); $this->_items['item1']->expects($this->any())->method('hasChildren')->will($this->returnValue(true)); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php index cd372b32e233a..059d70552d630 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php @@ -93,7 +93,11 @@ class UrlTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->_menuMock = $this->getMock('Magento\Backend\Model\Menu', array(), array(), '', false); + $this->_menuMock = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $this->_menuConfigMock = $this->getMock('Magento\Backend\Model\Menu\Config', array(), array(), '', false); $this->_menuConfigMock->expects($this->any())->method('getMenu')->will($this->returnValue($this->_menuMock)); diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Model/CaptchaFactoryTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Model/CaptchaFactoryTest.php index db185840e7ca4..5a45c63b5b6a8 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Model/CaptchaFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Model/CaptchaFactoryTest.php @@ -60,7 +60,7 @@ public function testCreateNegative() { $captchaType = 'wrong_instance'; - $defaultCaptchaMock = $this->getMock('stdClass', array(), array(), '', false); + $defaultCaptchaMock = $this->getMock('stdClass'); $this->_objectManagerMock->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php b/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php index e1293d81d92d8..4a9fc61ffaf77 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php @@ -384,7 +384,7 @@ protected function _getSourceDataMocks($addExpectations, $doubleOptions) false ); - $productModelMock = $this->getMock('stdClass', array('getProductEntitiesInfo'), array(), '', false); + $productModelMock = $this->getMock('stdClass', array('getProductEntitiesInfo')); $productModelMock->expects( $this->any() )->method( @@ -884,7 +884,7 @@ public function validateAmbiguousDataDataProvider() public function testParseRequiredData() { - $modelData = $this->getMock('stdClass', array('getNextBunch'), array(), '', false); + $modelData = $this->getMock('stdClass', array('getNextBunch')); $modelData->expects( $this->at(0) )->method( @@ -896,7 +896,7 @@ public function testParseRequiredData() ); $modelData->expects($this->at(1))->method('getNextBunch')->will($this->returnValue(null)); - $productModel = $this->getMock('stdClass', array('getProductEntitiesInfo'), array(), '', false); + $productModel = $this->getMock('stdClass', array('getProductEntitiesInfo')); $productModel->expects($this->any())->method('getProductEntitiesInfo')->will($this->returnValue(array())); $productEntity = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php b/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php index f9147a0e48aeb..4e42620bbe51a 100644 --- a/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php +++ b/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php @@ -71,7 +71,11 @@ protected function setUp() $layoutMock = $this->getMock('Magento\Framework\View\Layout', array(), array(), '', false, false); $helperMock = $this->getMock('Magento\Backend\Helper\Data', array(), array(), '', false, false); $menuConfigMock = $this->getMock('Magento\Backend\Model\Menu\Config', array(), array(), '', false, false); - $menuMock = $this->getMock('Magento\Backend\Model\Menu', array(), array(), '', false, false); + $menuMock = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $menuItemMock = $this->getMock('Magento\Backend\Model\Menu\Item', array(), array(), '', false, false); $urlBuilder = $this->getMock('Magento\Backend\Model\Url', array(), array(), '', false, false); $this->_configStructureMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Framework/Data/Form/Element/DateTest.php b/dev/tests/unit/testsuite/Magento/Framework/Data/Form/Element/DateTest.php index 87b5860c8ee35..c538eca673609 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Data/Form/Element/DateTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Data/Form/Element/DateTest.php @@ -107,13 +107,7 @@ public function providerGetElementHtmlDateFormat() protected function getFormMock($exactly) { $functions = array('getFieldNameSuffix', 'getHtmlIdPrefix', 'getHtmlIdSuffix'); - $formMock = $this->getMock( - 'stdClass', - $functions, - array(), - '', - false - ); + $formMock = $this->getMock('stdClass', $functions); foreach ($functions as $method) { switch($exactly) { case 'once': diff --git a/dev/tests/unit/testsuite/Magento/Framework/Image/AdapterFactoryTest.php b/dev/tests/unit/testsuite/Magento/Framework/Image/AdapterFactoryTest.php index a4475b444ff50..c7255d72573de 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Image/AdapterFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Image/AdapterFactoryTest.php @@ -190,7 +190,7 @@ public function testWrongInstance() '', false ); - $imageAdapterMock = $this->getMock($class, array('checkDependencies'), array(), '', false); + $imageAdapterMock = $this->getMock($class, array('checkDependencies')); $objectManagerMock->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/Framework/Session/SaveHandlerFactoryTest.php b/dev/tests/unit/testsuite/Magento/Framework/Session/SaveHandlerFactoryTest.php index 7fee03770e83b..a0e21218890d8 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Session/SaveHandlerFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Session/SaveHandlerFactoryTest.php @@ -30,7 +30,7 @@ class SaveHandlerFactoryTest extends \PHPUnit_Framework_TestCase */ public function testCreate($handlers, $saveClass, $saveMethod) { - $saveHandler = $this->getMock($saveClass, array(), array(), '', false); + $saveHandler = $this->getMock($saveClass); $objectManager = $this->getMock( '\Magento\Framework\ObjectManager\ObjectManager', array('create'), diff --git a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php index 2f92bf8265bff..3228e307e7cde 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php @@ -838,7 +838,11 @@ protected function _createIntegrationController() // for _setActiveMenu $this->_viewMock->expects($this->any())->method('getLayout')->will($this->returnValue($this->_layoutMock)); $blockMock = $this->getMockBuilder('Magento\Backend\Block\Menu')->disableOriginalConstructor()->getMock(); - $menuMock = $this->getMockBuilder('Magento\Backend\Model\Menu')->disableOriginalConstructor()->getMock(); + $menuMock = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $loggerMock = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); $loggerMock->expects($this->any())->method('logException')->will($this->returnSelf()); $menuMock->expects($this->any())->method('getParentItems')->will($this->returnValue(array())); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php index 49b3086a4591d..3e5864853499f 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php @@ -190,7 +190,11 @@ public function testSaveAction() public function testIndexAction() { - $menuModel = $this->getMock('\Magento\Backend\Model\Menu', array(), array(), '', false); + $menuModel = $this->getMock( + 'Magento\Backend\Model\Menu', + [], + [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + ); $menuModel->expects($this->once()) ->method('getParentItems') ->with($this->equalTo('Magento_Theme::system_design_theme')) diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategyTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategyTest.php index 277147c7d0845..0f4e2171db72f 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategyTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/Wsdl/ComplexTypeStrategyTest.php @@ -98,7 +98,7 @@ public function testAddComplexTypeSimpleParameters($type, $data) $this->_wsdl->expects($this->any())->method('toDomDocument')->will($this->returnValue(new \DOMDocument())); - $schemaMock = $this->_getDomElementMock(); + $schemaMock = $this->getMock('DOMElement', [], ['a']); $schemaMock->expects($this->any())->method('appendChild'); $this->_wsdl->expects($this->any())->method('getSchema')->will($this->returnValue($schemaMock)); @@ -244,7 +244,7 @@ public function testAddComplexTypeComplexParameters() ); $this->_wsdl->expects($this->any())->method('toDomDocument')->will($this->returnValue(new \DOMDocument())); - $schemaMock = $this->_getDomElementMock(); + $schemaMock = $this->getMock('DOMElement', [], ['a']); $schemaMock->expects($this->any())->method('appendChild'); $this->_wsdl->expects($this->any())->method('getSchema')->will($this->returnValue($schemaMock)); $this->_typeProcessor->expects( @@ -285,14 +285,4 @@ public function testAddAnnotationToComplexType() $complexType->getElementsByTagName("xsd:documentation")->item(0)->nodeValue ); } - - /** - * Create mock for DOMElement. - * - * @return \PHPUnit_Framework_MockObject_MockObject - */ - protected function _getDomElementMock() - { - return $this->getMockBuilder('DOMElement')->disableOriginalConstructor()->getMock(); - } }