26 public function indexFileUpdatesFileProperties() {
27 $GLOBALS[
'TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array(), array(),
'', FALSE);
30 $subject = $this->getMock(
31 'TYPO3\\CMS\\Core\\Resource\\Service\\IndexerService',
32 array(
'gatherFileInformation',
'getFileIndexRepository',
'emitPreFileIndexSignal',
'emitPostFileIndexSignal')
37 'identifier' =>
'/some/filepath/filename.jpg',
39 'uid' => rand(1, 100),
43 $subject->expects($this->any())->method(
'gatherFileInformation')->will($this->returnValue($fileInfo));
45 $repositoryMock = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\Index\\FileIndexRepository');
46 $repositoryMock->expects($this->any())->method(
'findByContentHash')->will($this->returnValue(array()));
47 $subject->expects($this->any())->method(
'getFileIndexRepository')->will($this->returnValue($repositoryMock));
49 $mockedFile = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\File', array(), array(),
'', FALSE);
50 $mockedFile->expects($this->once())->method(
'updateProperties');
52 $subject->indexFile($mockedFile);
58 public function indexFileSetsCreationdateAndTimestampPropertiesOfRecordToCurrentExecutionTime() {
61 $subject = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\Service\\IndexerService', array(
'gatherFileInformation',
'getFileIndexRepository',
'emitPreFileIndexSignal',
'emitPostFileIndexSignal'));
63 $subject->expects($this->any())->method(
'gatherFileInformation')->will($this->returnValue($fileInfo));
65 $repositoryMock = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\Index\\FileIndexRepository');
66 $repositoryMock->expects($this->any())->method(
'findByContentHash')->will($this->returnValue(array()));
67 $repositoryMock->expects($this->once())->method(
'add');
68 $subject->expects($this->any())->method(
'getFileIndexRepository')->will($this->returnValue($repositoryMock));
70 $GLOBALS[
'TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array(), array(),
'', FALSE);
72 $mockedFile = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\File', array(), array(),
'', FALSE);
74 $subject->indexFile($mockedFile);
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]