Example #1
0
 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);
 }
Example #2
0
 public function setUp()
 {
     $this->requestMock = $this->getMock(\Magelight\Http\Request::class, [], [], '', false);
     \Magelight\Http\Request::forgeMock($this->requestMock);
     $this->responseMock = $this->getMock(\Magelight\Http\Response::class, [], [], '', false);
     \Magelight\Http\Response::forgeMock($this->responseMock);
     $this->appMock = $this->getMock(\Magelight\App::class, [], [], '', false);
     \Magelight\App::forgeMock($this->appMock);
     $this->serverMock = $this->getMock(\Magelight\Http\Server::class, [], [], '', false);
     \Magelight\Http\Server::forgeMock($this->serverMock);
     $this->controller = \Magelight\Controller::forge();
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     $this->appMock = $this->getMock(\Magelight\App::class, [], [], '', false);
     \Magelight\App::forgeMock($this->appMock);
     $this->dbMock = $this->getMock(\Magelight\Db\Common\Adapter::class, [], [], '', false);
     $this->appMock->expects($this->any())->method('db')->with(App::DEFAULT_INDEX)->will($this->returnValue($this->dbMock));
     $this->dbMock->expects($this->any())->method('getType')->will($this->returnValue(\Magelight\Db\Common\Adapter::TYPE_MYSQL));
     $this->ormMock = $this->getMock(\Magelight\Db\Mysql\Orm::class, [], [], '', false);
     \Magelight\Db\Mysql\Orm::forgeMock($this->ormMock);
     $this->ormMock->expects($this->once())->method('create')->with(['arg1' => 'value1'], false);
     $this->model = Model::forge(['arg1' => 'value1']);
 }
Example #4
0
 /**
  * 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();
 }