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);
 }
Exemple #2
0
 /**
  * Enable Developer mode
  *
  * @return void
  */
 public function enableDeveloperMode()
 {
     $this->filesystem->cleanupFilesystem([DirectoryList::CACHE, DirectoryList::GENERATION, DirectoryList::DI, DirectoryList::TMP_MATERIALIZATION_DIR, DirectoryList::STATIC_VIEW]);
     $this->setStoreMode(State::MODE_DEVELOPER);
 }