Exemplo n.º 1
0
 /**
  * @test
  * @covers ::getCountOfExtensions
  */
 public function getCountOfExtensionsCountsLocalInstalledExtensions()
 {
     $data = array();
     $extensionApiServiceMock = $this->getMock('Etobi\\CoreAPI\\Service\\ExtensionApiService', array('listExtensions'));
     $extensionApiServiceMock->expects($this->once())->method('listExtensions')->with('Local')->will($this->returnValue($this->getExtensionArrayForCreateUploadFolders()));
     $objectManagerMock = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager', array('get'));
     $objectManagerMock->expects($this->once())->method('get')->will($this->returnValue($extensionApiServiceMock));
     $this->subject->injectObjectManager($objectManagerMock);
     $data = $this->subject->getCountOfExtensions($data);
     $this->assertEquals(4, $data['Count local installed extensions']);
 }
 /**
  * Sys news record is displayed at the login page.
  *
  * @param string $header Header text
  * @param string $text   Basic text
  *
  * @return void
  */
 public function createSysNewsCommand($header, $text = '')
 {
     $result = FALSE;
     try {
         $result = $this->siteApiService->createSysNews($header, $text);
     } catch (\Exception $e) {
         $this->outputLine($e->getMessage());
         $this->quit(1);
     }
     if ($result) {
         $this->outputLine('News entry successfully created.');
     } else {
         $this->outputLine('News entry NOT created.');
         $this->quit(1);
     }
 }