32 $this->testSubject = new \TYPO3\CMS\Core\Resource\Collection\FileCollectionRegistry();
39 $className = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection'));
40 $this->testSubject->registerFileCollectionClass($className,
'foobar');
41 $returnedClassName = $this->testSubject->getFileCollectionClass(
'foobar');
42 $this->assertEquals($className, $returnedClassName);
51 $this->testSubject->registerFileCollectionClass($this->
getUniqueId(), substr($this->
getUniqueId(), 0, 30));
60 $className = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection'));
61 $type = str_pad(
'', 40);
62 $this->testSubject->registerFileCollectionClass($className, $type);
71 $className = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection'));
72 $className2 = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\StaticFileCollection'));
73 $this->testSubject->registerFileCollectionClass($className,
'foobar');
74 $this->testSubject->registerFileCollectionClass($className2,
'foobar');
81 $className = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection'));
82 $className2 = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\StaticFileCollection'));
83 $this->testSubject->registerFileCollectionClass($className,
'foobar');
84 $this->testSubject->registerFileCollectionClass($className2,
'foobar', TRUE);
93 $this->testSubject->getFileCollectionClass($this->
getUniqueId());
100 $className = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection'));
101 $this->testSubject->registerFileCollectionClass($className,
'foobar');
102 $this->assertEquals($className, $this->testSubject->getFileCollectionClass(
'foobar'));
109 $className = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection'));
111 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fal'][
'registeredCollections'] = array(
115 $this->assertEquals($className, $this->testSubject->getFileCollectionClass($type));
122 $className = get_class($this->getMockForAbstractClass(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection'));
124 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fal'][
'registeredCollections'] = array(
128 $this->assertTrue($this->testSubject->fileCollectionTypeExists($type));
129 $this->assertFalse($this->testSubject->fileCollectionTypeExists(
'bar'));
136 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fal'][
'registeredFileCollections'] = array();
138 $this->assertFalse($this->testSubject->fileCollectionTypeExists($this->getUniqueId()));
147 $GLOBALS[
'TCA'][
'sys_file_collection'] = array(
149 'typeB' => array(
'showitem' =>
'fieldA, fieldB, fieldC;labelC;paletteC;specialC, fieldD'),
154 'items' => array(
'Type B',
'typeB')
161 $label =
'The Label';
163 $this->testSubject->addTypeToTCA($type, $label,
'something');
166 $this->assertEquals(
'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, title;;1, type, something',
$GLOBALS[
'TCA'][
'sys_file_collection'][
'types'][
'my_type'][
'showitem']);
168 $indexOfNewType = count(
$GLOBALS[
'TCA'][
'sys_file_collection'][
'columns'][
'type'][
'config'][
'items']) - 1;
171 $this->assertEquals($type,
$GLOBALS[
'TCA'][
'sys_file_collection'][
'columns'][
'type'][
'config'][
'items'][$indexOfNewType][1]);
172 $this->assertEquals($label,
$GLOBALS[
'TCA'][
'sys_file_collection'][
'columns'][
'type'][
'config'][
'items'][$indexOfNewType][0]);
getFileCollectionClassThrowsExceptionIfClassIsNotRegistered()
registerFileCollectionClassThrowsExceptionIfClassDoesNotExist()
fileCollectionExistsReturnsFalseIfFileCollectionDoesNotExist()
registeredFileCollectionClassesCanBeRetrieved()
registerFileCollectionClassOverridesExistingRegisteredFileCollectionClass()
fileCollectionExistsReturnsTrueForAllExistingFileCollections()
getFileCollectionClassAcceptsClassNameIfClassIsRegistered()
registerFileCollectionClassThrowsExceptionIfTypeIsTooLong()
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
registerFileCollectionClassThrowsExceptionIfTypeIsAlreadyRegistered()
fileCollectionRegistryIsInitializedWithPreconfiguredFileCollections()