Пример #1
0
 /**
  * Enable production mode
  *
  * @return void
  */
 public function enableProductionMode()
 {
     $this->enableMaintenanceMode($this->output);
     $this->filesystem->regenerateStatic($this->output);
     $this->setStoreMode(State::MODE_PRODUCTION);
     $this->disableMaintenanceMode($this->output);
 }
Пример #2
0
 public function testRegenerateStatic()
 {
     $storeLocales = ['fr_FR', 'de_DE', 'nl_NL'];
     $adminUserInterfaceLocales = ['de_DE', 'en_US'];
     $this->storeViewMock->expects($this->once())->method('retrieveLocales')->willReturn($storeLocales);
     $userMock = $this->getMock(\Magento\User\Model\User::class, [], [], '', false);
     $userMock->expects($this->once())->method('getInterfaceLocale')->willReturn('en_US');
     $this->userCollectionMock->expects($this->once())->method('getIterator')->willReturn(new \ArrayIterator([$userMock]));
     $usedLocales = array_unique(array_merge($storeLocales, $adminUserInterfaceLocales));
     $staticContentDeployCmd = $this->cmdPrefix . 'setup:static-content:deploy ' . implode(' ', $usedLocales);
     $setupDiCompileCmd = $this->cmdPrefix . 'setup:di:compile';
     $this->shellMock->expects($this->at(0))->method('execute')->with($staticContentDeployCmd);
     $this->shellMock->expects($this->at(1))->method('execute')->with($setupDiCompileCmd);
     $this->outputMock->expects($this->at(0))->method('writeln')->with('Starting deployment of static content');
     $this->outputMock->expects($this->at(2))->method('writeln')->with('Deployment of static content complete');
     $this->outputMock->expects($this->at(3))->method('writeln')->with('Starting compilation');
     $this->outputMock->expects($this->at(5))->method('writeln')->with('Compilation complete');
     $this->filesystem->regenerateStatic($this->outputMock);
 }