2 namespace TYPO3\CMS\Backend\Tests\Unit\Module;
29 $this->moduleController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Module\ModuleController::class, array(
'getLanguageService'), array(),
'',
false);
37 $entry = $this->moduleController->_call(
'createEntryFromRawData', array());
38 $this->assertInstanceOf(\TYPO3\CMS\Backend\Domain\Model\Module\BackendModule::class, $entry);
44 public function createEntryFromRawDataSetsPropertiesInEntryObject()
48 'title' =>
'titleTest',
49 'onclick' =>
'onclickTest',
54 'description' =>
'descriptionTest',
55 'navigationComponentId' =>
'navigationComponentIdTest'
58 $languageServiceMock = $this->getMock(\TYPO3\CMS\Lang\LanguageService::class, array(), array(),
'',
false);
59 $languageServiceMock->expects($this->once())->method(
'sL')->will($this->returnValue(
'titleTest'));
60 $this->moduleController->expects($this->once())->method(
'getLanguageService')->will($this->returnValue($languageServiceMock));
63 $entry = $this->moduleController->_call(
'createEntryFromRawData', $rawModule);
64 $this->assertEquals(
'nameTest', $entry->getName());
65 $this->assertEquals(
'titleTest', $entry->getTitle());
66 $this->assertEquals(
'linkTest', $entry->getLink());
67 $this->assertEquals(
'onclickTest', $entry->getOnClick());
68 $this->assertEquals(
'navigationComponentIdTest', $entry->getNavigationComponentId());
69 $this->assertEquals(
'descriptionTest', $entry->getDescription());
70 $this->assertEquals(array(
'test' =>
'123'), $entry->getIcon());
76 public function createEntryFromRawDataSetsLinkIfPathIsGivenInEntryObject()
82 $entry = $this->moduleController->_call(
'createEntryFromRawData', $rawModule);
83 $this->assertEquals(
'pathTest', $entry->getLink());