/** * Set Up before test */ protected function setUp() { $this->_fixtureDir = __DIR__ . '/Performance/_files'; $this->_fixtureConfigData = (require $this->_fixtureDir . '/config_data.php'); $this->_installerScript = realpath($this->_fixtureDir . '/app_base_dir//dev/shell/install.php'); $this->_config = new \Magento\TestFramework\Performance\Config($this->_fixtureConfigData, $this->_fixtureDir, $this->_fixtureDir . '/app_base_dir'); $this->_shell = $this->getMock('Magento\\Framework\\Shell', array('execute'), array(), '', false); $this->_object = $this->getMock('Magento\\TestFramework\\Application', array('_bootstrap', '_cleanupMage', '_reindex', '_updateFilesystemPermissions'), array($this->_config, $this->_shell)); $this->_object->expects($this->any())->method('_reindex')->will($this->returnValue($this->_object)); // For fixture testing $this->_object->applied = array(); }
/** * Set Up before test */ protected function setUp() { $this->_fixtureDir = __DIR__ . '/Performance/_files'; $this->_fixtureConfigData = (require $this->_fixtureDir . '/config_data.php'); $this->_script = realpath($this->_fixtureDir . '/app_base_dir/bin/magento'); $this->_config = new \Magento\TestFramework\Performance\Config($this->_fixtureConfigData, $this->_fixtureDir, $this->_fixtureDir . '/app_base_dir'); $this->_shell = $this->getMock('Magento\\Framework\\Shell', ['execute'], [], '', false); $objectManager = $this->getMock('\\Magento\\Framework\\ObjectManagerInterface'); $this->_object = $this->getMock('Magento\\TestFramework\\Application', ['_cleanupMage', '_reindex', '_updateFilesystemPermissions', 'getObjectManager'], [$this->_config, $objectManager, $this->_shell]); $this->_object->expects($this->any())->method('_reindex')->will($this->returnValue($this->_object)); $this->_object->expects($this->any())->method('getObjectManager')->will($this->returnValue($objectManager)); // For fixture testing $this->_object->applied = []; }
public function testRunApp() { $this->_application->expects($this->once())->method('run'); $this->_object->runApp(); }