public function setUp() { $this->modulesMock = $this->getMock(\Magelight\Components\Modules::class, [], [], '', false); $this->configMock = $this->getMock(\Magelight\Config::class, [], [], '', false); $this->dbMock = $this->getMock(\Magelight\Db\Mysql\Adapter::class, [], [], '', false); $this->appMock = $this->getMockForAbstractClass(App::class, [], '', false, false, true, ['db']); \Magelight\Components\Modules::forgeMock($this->modulesMock); \Magelight\Config::forgeMock($this->configMock); \Magelight\Db\Mysql\Adapter::forgeMock($this->dbMock); \Magelight\App::forgeMock($this->appMock); }
/** * Set up before test * * @throws Exception */ public function setUp() { $this->appMock = $this->getMock(\Magelight\App::class, [], [], '', false); \Magelight\App::forgeMock($this->appMock); $this->configLoaderMock = $this->getMock(\Magelight\Components\Loaders\Config::class, ['getConfig', 'loadConfig', 'getModulesConfigFilePath'], [], '', false); \Magelight\Components\Loaders\Config::forgeMock($this->configLoaderMock); $this->modulesMock = $this->getMock(\Magelight\Components\Modules::class, [], [], '', false); \Magelight\Components\Modules::forgeMock($this->modulesMock); $this->cacheAdapterPoolMock = $this->getMock(\Magelight\Cache\AdapterPool::class, [], [], '', false); \Magelight\Cache\AdapterPool::forgeMock($this->cacheAdapterPoolMock); $this->cacheAdapterMock = $this->getMockForAbstractClass(\Magelight\Cache\AdapterAbstract::class, [], '', false, false, true, []); $this->cacheAdapterPoolMock->expects($this->any())->method('getAdapter')->will($this->returnValue($this->cacheAdapterMock)); $this->config = \Magelight\Config::forge(); }
/** * Set up before test */ public function setUp() { $this->app = $this->getMockForAbstractClass(App::class, [], '', false, false, true, []); $this->modulesMock = $this->getMock(\Magelight\Components\Modules::class, [], [], '', false); $this->configMock = $this->getMock(\Magelight\Config::class, [], [], '', false); $this->routerMock = $this->getMock(\Magelight\Components\Router::class, [], [], '', false); $this->sessionMock = $this->getMock(\Magelight\Http\Session::class, [], [], '', false); $this->translatorMock = $this->getMock(\Magelight\I18n\Translator::class, [], [], '', false); $this->eventManagerMock = $this->getMock(\Magelight\Event\Manager::class, [], [], '', false); \Magelight\Components\Modules::forgeMock($this->modulesMock); \Magelight\Config::forgeMock($this->configMock); \Magelight\Components\Router::forgeMock($this->routerMock); \Magelight\Http\Session::forgeMock($this->sessionMock); \Magelight\I18n\Translator::forgeMock($this->translatorMock); \Magelight\Event\Manager::forgeMock($this->eventManagerMock); }