41 $this->_builderMock = $this->createMock(\
Magento\Backend\Model\Menu\Builder::class);
42 $this->_logger = $this->createMock(\Psr\Log\LoggerInterface::class);
43 $this->_commandMock = $this->createPartialMock(
44 \
Magento\Backend\Model\Menu\Builder\AbstractCommand::class,
45 [
'getId',
'_execute',
'execute',
'chain']
47 $this->_commandFactoryMock = $this->createPartialMock(
48 \
Magento\Backend\Model\Menu\Builder\CommandFactory::class,
51 $this->_commandFactoryMock->expects(
56 $this->returnValue($this->_commandMock)
59 $this->_commandMock->expects($this->any())->method(
'getId')->will($this->returnValue(
true));
60 $this->_model = new \Magento\Backend\Model\Menu\Director\Director($this->_commandFactoryMock);
65 $config = [[
'type' =>
'update'], [
'type' =>
'remove'], [
'type' =>
'added']];
66 $this->_builderMock->expects($this->at(2))->method(
'processCommand')->with($this->_commandMock);
67 $this->_logger->expects($this->at(1))->method(
'debug');
68 $this->_commandMock->expects($this->at(1))->method(
'getId');
69 $this->_model->direct(
$config, $this->_builderMock, $this->_logger);