public function setUp()
 {
     parent::setUp();
     $this->viewHelper = $this->getAccessibleMock('TYPO3\\Fluid\\ViewHelpers\\Form\\UploadViewHelper', array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration', 'getValue', 'getMappingResultsForProperty'));
     $this->mockMappingResult = $this->getMock('TYPO3\\Flow\\Error\\Result');
     $this->viewHelper->expects($this->any())->method('getMappingResultsForProperty')->will($this->returnValue($this->mockMappingResult));
     $this->mockPropertyMapper = $this->getMock('TYPO3\\Flow\\Property\\PropertyMapper');
     $this->viewHelper->_set('propertyMapper', $this->mockPropertyMapper);
     $this->arguments['name'] = '';
     $this->injectDependenciesIntoViewHelper($this->viewHelper);
     $this->viewHelper->initializeArguments();
 }
 /**
  * @test
  */
 public function hiddenFieldsContainDataOfTheSpecifiedResource()
 {
     $resource = new Resource();
     $mockPersistenceManager = $this->createMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class);
     $mockPersistenceManager->expects($this->atLeastOnce())->method('getIdentifierByObject')->with($resource)->will($this->returnValue('79ecda60-1a27-69ca-17bf-a5d9e80e6c39'));
     $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
     $this->viewHelper->setArguments(array('name' => '[foo]', 'value' => $resource));
     $this->viewHelper->initialize();
     $expectedResult = '<input type="hidden" name="[foo][originallySubmittedResource][__identity]" value="79ecda60-1a27-69ca-17bf-a5d9e80e6c39" />';
     $actualResult = $this->viewHelper->render();
     $this->assertSame($expectedResult, $actualResult);
 }