@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | defined('TYPO3') or die(); |
52 | 52 | |
53 | 53 | call_user_func(function () { |
54 | - $configuration = GeneralUtility::makeInstance( |
|
55 | - ExtensionConfiguration::class |
|
56 | - )->get('media'); |
|
54 | + $configuration = GeneralUtility::makeInstance( |
|
55 | + ExtensionConfiguration::class |
|
56 | + )->get('media'); |
|
57 | 57 | |
58 | - // Default User TSConfig to be added in any case. |
|
59 | - ExtensionManagementUtility::addUserTSConfig(' |
|
58 | + // Default User TSConfig to be added in any case. |
|
59 | + ExtensionManagementUtility::addUserTSConfig(' |
|
60 | 60 | |
61 | 61 | # Enable or disabled the Media File Picker in the BE |
62 | 62 | options.vidi.enableMediaFilePicker = 1 |
@@ -66,145 +66,145 @@ discard block |
||
66 | 66 | |
67 | 67 | '); |
68 | 68 | |
69 | - $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang.xlf'; |
|
70 | - if ($configuration['hide_file_list'] == 1) { |
|
71 | - $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang_filelist.xlf'; |
|
69 | + $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang.xlf'; |
|
70 | + if ($configuration['hide_file_list'] == 1) { |
|
71 | + $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang_filelist.xlf'; |
|
72 | 72 | |
73 | - // Default User TSConfig to be added in any case. |
|
74 | - ExtensionManagementUtility::addUserTSConfig(' |
|
73 | + // Default User TSConfig to be added in any case. |
|
74 | + ExtensionManagementUtility::addUserTSConfig(' |
|
75 | 75 | |
76 | 76 | # Hide default File List |
77 | 77 | options.hideModules.file := addToList(FilelistList) |
78 | 78 | '); |
79 | - } |
|
80 | - |
|
81 | - ExtensionUtility::registerModule( |
|
82 | - 'Media', |
|
83 | - 'user', // Make media module a submodule of 'user' |
|
84 | - 'm1', |
|
85 | - 'bottom', // Position |
|
86 | - [ |
|
87 | - AssetController::class => 'create, update, download, editStorage', |
|
88 | - ImageEditorController::class => 'show', |
|
89 | - LinkCreatorController::class => 'show', |
|
90 | - ProcessedFileController::class => 'create', |
|
91 | - ], |
|
92 | - [ |
|
93 | - 'access' => 'user,group', |
|
94 | - 'icon' => 'EXT:media/Resources/Public/Icons/Extension.svg', |
|
95 | - 'labels' => 'LLL:EXT:media/Resources/Private/Language/locallang_module.xlf', |
|
96 | - ] |
|
97 | - ); |
|
98 | - |
|
99 | - $defaultMainModule = (bool)$configuration['has_folder_tree'] ? 'file' : 'content'; |
|
100 | - |
|
101 | - /** @var ModuleLoader $moduleLoader */ |
|
102 | - $moduleLoader = GeneralUtility::makeInstance( |
|
103 | - ModuleLoader::class, |
|
104 | - 'sys_file' |
|
105 | - ); |
|
106 | - $moduleLoader->setIcon('EXT:media/Resources/Public/Icons/Extension.svg') |
|
107 | - ->setModuleLanguageFile($moduleFileLanguage) |
|
108 | - ->setMainModule($defaultMainModule) |
|
109 | - ->addJavaScriptFiles([ |
|
110 | - 'EXT:media/Resources/Public/Libraries/Fineuploader/jquery.fineuploader-5.0.9.min.js', |
|
111 | - ]) |
|
112 | - ->addStyleSheetFiles([ |
|
113 | - 'EXT:media/Resources/Public/StyleSheets/media.css', |
|
114 | - 'EXT:media/Resources/Public/StyleSheets/fineuploader.css', |
|
115 | - ]) |
|
116 | - ->setDocHeaderTopLeftComponents( |
|
117 | - [ |
|
118 | - StorageMenu::class, |
|
119 | - RecursiveCheckbox::class,] |
|
120 | - ) |
|
121 | - ->setDocHeaderBottomLeftComponents([ |
|
122 | - ClipboardButton::class, |
|
123 | - NewFolder::class, |
|
124 | - UploadButton::class, |
|
125 | - ]) |
|
126 | - ->setGridTopComponents([ |
|
127 | - InlineJavaScript::class, |
|
128 | - ConfigurationWarning::class, |
|
129 | - SelectedFolderInfo::class, |
|
130 | - ]) |
|
131 | - ->setGridBottomComponents([ |
|
132 | - LinkCreatorPlugin::class, |
|
133 | - ImageEditorPlugin::class, |
|
134 | - FilePickerPlugin::class, |
|
135 | - ]) |
|
136 | - ->setGridButtonsComponents([ |
|
137 | - LinkCreatorButton::class, |
|
138 | - ImageEditorButton::class, |
|
139 | - FilePickerButton::class, |
|
140 | - EditButton::class, |
|
141 | - DownloadButton::class, |
|
142 | - DeleteButton::class, |
|
143 | - ]) |
|
144 | - ->setMenuMassActionComponents([ |
|
145 | - ExportXlsMenuItem::class, |
|
146 | - ExportXmlMenuItem::class, |
|
147 | - ExportCsvMenuItem::class, |
|
148 | - DividerMenuItem::class, |
|
149 | - |
|
150 | - // Media custom View Helper |
|
151 | - ClipboardMenuItem::class, |
|
152 | - FilePickerMenuItem::class, |
|
153 | - ChangeStorageMenuItem::class, |
|
154 | - MassDeleteMenuItem::class, |
|
155 | - ]) |
|
156 | - ->register(); |
|
157 | - |
|
158 | - |
|
159 | - /** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */ |
|
160 | - $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class); |
|
161 | - |
|
162 | - # Register some tool for Media. |
|
163 | - ToolRegistry::getInstance()->register('sys_file', ThumbnailGeneratorTool::class); |
|
164 | - ToolRegistry::getInstance()->register('sys_file', CacheWarmUpTool::class); |
|
165 | - ToolRegistry::getInstance()->register('sys_file', MissingFilesFinderTool::class); |
|
166 | - ToolRegistry::getInstance()->register('sys_file', DuplicateRecordsFinderTool::class); |
|
167 | - ToolRegistry::getInstance()->register('sys_file', DuplicateFilesFinderTool::class); |
|
168 | - |
|
169 | - // Connect some signals with slots. |
|
170 | - $signalSlotDispatcher->connect( |
|
171 | - 'Fab\Vidi\Controller\Backend\ContentController', // Small exception in naming here as the class was previously located in "Controller\Backend". |
|
172 | - 'postProcessMatcherObject', |
|
173 | - FilePermissionsAspect::class, |
|
174 | - 'addFilePermissionsForFileStorages' |
|
175 | - ); |
|
176 | - |
|
177 | - $signalSlotDispatcher->connect( |
|
178 | - ContentRepository::class, |
|
179 | - 'postProcessConstraintsObject', |
|
180 | - FilePermissionsAspect::class, |
|
181 | - 'addFilePermissionsForFileMounts' |
|
182 | - ); |
|
183 | - |
|
184 | - $signalSlotDispatcher->connect( |
|
185 | - ContentService::class, |
|
186 | - 'afterFindContentObjects', |
|
187 | - ActionPermissionFacet::class, |
|
188 | - 'modifyResultSet' |
|
189 | - ); |
|
190 | - |
|
191 | - // Add new sprite icon. |
|
192 | - $icons = [ |
|
193 | - 'image-edit' => 'EXT:media/Resources/Public/Icons/image_edit.png', |
|
194 | - 'image-link' => 'EXT:media/Resources/Public/Icons/image_link.png', |
|
195 | - 'image-export' => 'EXT:media/Resources/Public/Icons/image_export.png', |
|
196 | - 'storage-change' => 'EXT:media/Resources/Public/Icons/folder_go.png', |
|
197 | - ]; |
|
198 | - /** @var IconRegistry $iconRegistry */ |
|
199 | - $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); |
|
200 | - foreach ($icons as $key => $icon) { |
|
201 | - $iconRegistry->registerIcon( |
|
202 | - 'extensions-media-' . $key, |
|
203 | - BitmapIconProvider::class, |
|
204 | - [ |
|
205 | - 'source' => $icon |
|
206 | - ] |
|
207 | - ); |
|
208 | - } |
|
209 | - unset($iconRegistry); |
|
79 | + } |
|
80 | + |
|
81 | + ExtensionUtility::registerModule( |
|
82 | + 'Media', |
|
83 | + 'user', // Make media module a submodule of 'user' |
|
84 | + 'm1', |
|
85 | + 'bottom', // Position |
|
86 | + [ |
|
87 | + AssetController::class => 'create, update, download, editStorage', |
|
88 | + ImageEditorController::class => 'show', |
|
89 | + LinkCreatorController::class => 'show', |
|
90 | + ProcessedFileController::class => 'create', |
|
91 | + ], |
|
92 | + [ |
|
93 | + 'access' => 'user,group', |
|
94 | + 'icon' => 'EXT:media/Resources/Public/Icons/Extension.svg', |
|
95 | + 'labels' => 'LLL:EXT:media/Resources/Private/Language/locallang_module.xlf', |
|
96 | + ] |
|
97 | + ); |
|
98 | + |
|
99 | + $defaultMainModule = (bool)$configuration['has_folder_tree'] ? 'file' : 'content'; |
|
100 | + |
|
101 | + /** @var ModuleLoader $moduleLoader */ |
|
102 | + $moduleLoader = GeneralUtility::makeInstance( |
|
103 | + ModuleLoader::class, |
|
104 | + 'sys_file' |
|
105 | + ); |
|
106 | + $moduleLoader->setIcon('EXT:media/Resources/Public/Icons/Extension.svg') |
|
107 | + ->setModuleLanguageFile($moduleFileLanguage) |
|
108 | + ->setMainModule($defaultMainModule) |
|
109 | + ->addJavaScriptFiles([ |
|
110 | + 'EXT:media/Resources/Public/Libraries/Fineuploader/jquery.fineuploader-5.0.9.min.js', |
|
111 | + ]) |
|
112 | + ->addStyleSheetFiles([ |
|
113 | + 'EXT:media/Resources/Public/StyleSheets/media.css', |
|
114 | + 'EXT:media/Resources/Public/StyleSheets/fineuploader.css', |
|
115 | + ]) |
|
116 | + ->setDocHeaderTopLeftComponents( |
|
117 | + [ |
|
118 | + StorageMenu::class, |
|
119 | + RecursiveCheckbox::class,] |
|
120 | + ) |
|
121 | + ->setDocHeaderBottomLeftComponents([ |
|
122 | + ClipboardButton::class, |
|
123 | + NewFolder::class, |
|
124 | + UploadButton::class, |
|
125 | + ]) |
|
126 | + ->setGridTopComponents([ |
|
127 | + InlineJavaScript::class, |
|
128 | + ConfigurationWarning::class, |
|
129 | + SelectedFolderInfo::class, |
|
130 | + ]) |
|
131 | + ->setGridBottomComponents([ |
|
132 | + LinkCreatorPlugin::class, |
|
133 | + ImageEditorPlugin::class, |
|
134 | + FilePickerPlugin::class, |
|
135 | + ]) |
|
136 | + ->setGridButtonsComponents([ |
|
137 | + LinkCreatorButton::class, |
|
138 | + ImageEditorButton::class, |
|
139 | + FilePickerButton::class, |
|
140 | + EditButton::class, |
|
141 | + DownloadButton::class, |
|
142 | + DeleteButton::class, |
|
143 | + ]) |
|
144 | + ->setMenuMassActionComponents([ |
|
145 | + ExportXlsMenuItem::class, |
|
146 | + ExportXmlMenuItem::class, |
|
147 | + ExportCsvMenuItem::class, |
|
148 | + DividerMenuItem::class, |
|
149 | + |
|
150 | + // Media custom View Helper |
|
151 | + ClipboardMenuItem::class, |
|
152 | + FilePickerMenuItem::class, |
|
153 | + ChangeStorageMenuItem::class, |
|
154 | + MassDeleteMenuItem::class, |
|
155 | + ]) |
|
156 | + ->register(); |
|
157 | + |
|
158 | + |
|
159 | + /** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */ |
|
160 | + $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class); |
|
161 | + |
|
162 | + # Register some tool for Media. |
|
163 | + ToolRegistry::getInstance()->register('sys_file', ThumbnailGeneratorTool::class); |
|
164 | + ToolRegistry::getInstance()->register('sys_file', CacheWarmUpTool::class); |
|
165 | + ToolRegistry::getInstance()->register('sys_file', MissingFilesFinderTool::class); |
|
166 | + ToolRegistry::getInstance()->register('sys_file', DuplicateRecordsFinderTool::class); |
|
167 | + ToolRegistry::getInstance()->register('sys_file', DuplicateFilesFinderTool::class); |
|
168 | + |
|
169 | + // Connect some signals with slots. |
|
170 | + $signalSlotDispatcher->connect( |
|
171 | + 'Fab\Vidi\Controller\Backend\ContentController', // Small exception in naming here as the class was previously located in "Controller\Backend". |
|
172 | + 'postProcessMatcherObject', |
|
173 | + FilePermissionsAspect::class, |
|
174 | + 'addFilePermissionsForFileStorages' |
|
175 | + ); |
|
176 | + |
|
177 | + $signalSlotDispatcher->connect( |
|
178 | + ContentRepository::class, |
|
179 | + 'postProcessConstraintsObject', |
|
180 | + FilePermissionsAspect::class, |
|
181 | + 'addFilePermissionsForFileMounts' |
|
182 | + ); |
|
183 | + |
|
184 | + $signalSlotDispatcher->connect( |
|
185 | + ContentService::class, |
|
186 | + 'afterFindContentObjects', |
|
187 | + ActionPermissionFacet::class, |
|
188 | + 'modifyResultSet' |
|
189 | + ); |
|
190 | + |
|
191 | + // Add new sprite icon. |
|
192 | + $icons = [ |
|
193 | + 'image-edit' => 'EXT:media/Resources/Public/Icons/image_edit.png', |
|
194 | + 'image-link' => 'EXT:media/Resources/Public/Icons/image_link.png', |
|
195 | + 'image-export' => 'EXT:media/Resources/Public/Icons/image_export.png', |
|
196 | + 'storage-change' => 'EXT:media/Resources/Public/Icons/folder_go.png', |
|
197 | + ]; |
|
198 | + /** @var IconRegistry $iconRegistry */ |
|
199 | + $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); |
|
200 | + foreach ($icons as $key => $icon) { |
|
201 | + $iconRegistry->registerIcon( |
|
202 | + 'extensions-media-' . $key, |
|
203 | + BitmapIconProvider::class, |
|
204 | + [ |
|
205 | + 'source' => $icon |
|
206 | + ] |
|
207 | + ); |
|
208 | + } |
|
209 | + unset($iconRegistry); |
|
210 | 210 | }); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | defined('TYPO3') or die(); |
52 | 52 | |
53 | -call_user_func(function () { |
|
53 | +call_user_func(function() { |
|
54 | 54 | $configuration = GeneralUtility::makeInstance( |
55 | 55 | ExtensionConfiguration::class |
56 | 56 | )->get('media'); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | ->setDocHeaderTopLeftComponents( |
117 | 117 | [ |
118 | 118 | StorageMenu::class, |
119 | - RecursiveCheckbox::class,] |
|
119 | + RecursiveCheckbox::class, ] |
|
120 | 120 | ) |
121 | 121 | ->setDocHeaderBottomLeftComponents([ |
122 | 122 | ClipboardButton::class, |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); |
200 | 200 | foreach ($icons as $key => $icon) { |
201 | 201 | $iconRegistry->registerIcon( |
202 | - 'extensions-media-' . $key, |
|
202 | + 'extensions-media-'.$key, |
|
203 | 203 | BitmapIconProvider::class, |
204 | 204 | [ |
205 | 205 | 'source' => $icon |
@@ -1,30 +1,30 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $EM_CONF[$_EXTKEY] = [ |
4 | - 'title' => 'Media management', |
|
5 | - 'description' => 'Media management system for TYPO3 CMS.', |
|
6 | - 'category' => 'module', |
|
7 | - 'author' => 'Fabien Udriot', |
|
8 | - 'author_email' => '[email protected]', |
|
9 | - 'state' => 'stable', |
|
10 | - 'version' => '6.1.0-dev', |
|
11 | - 'autoload' => [ |
|
12 | - 'psr-4' => ['Fab\\Media\\' => 'Classes'] |
|
13 | - ], |
|
14 | - 'constraints' => |
|
15 | - [ |
|
16 | - 'depends' => |
|
17 | - [ |
|
18 | - 'typo3' => '11.5.0-11.5.99', |
|
19 | - 'vidi' => '5.0.0-0.0.0', |
|
20 | - ], |
|
21 | - 'conflicts' => |
|
22 | - [ |
|
23 | - ], |
|
24 | - 'suggests' => |
|
25 | - [ |
|
26 | - 'metadata' => '', |
|
27 | - 'filemetadata' => '', |
|
28 | - ], |
|
29 | - ] |
|
4 | + 'title' => 'Media management', |
|
5 | + 'description' => 'Media management system for TYPO3 CMS.', |
|
6 | + 'category' => 'module', |
|
7 | + 'author' => 'Fabien Udriot', |
|
8 | + 'author_email' => '[email protected]', |
|
9 | + 'state' => 'stable', |
|
10 | + 'version' => '6.1.0-dev', |
|
11 | + 'autoload' => [ |
|
12 | + 'psr-4' => ['Fab\\Media\\' => 'Classes'] |
|
13 | + ], |
|
14 | + 'constraints' => |
|
15 | + [ |
|
16 | + 'depends' => |
|
17 | + [ |
|
18 | + 'typo3' => '11.5.0-11.5.99', |
|
19 | + 'vidi' => '5.0.0-0.0.0', |
|
20 | + ], |
|
21 | + 'conflicts' => |
|
22 | + [ |
|
23 | + ], |
|
24 | + 'suggests' => |
|
25 | + [ |
|
26 | + 'metadata' => '', |
|
27 | + 'filemetadata' => '', |
|
28 | + ], |
|
29 | + ] |
|
30 | 30 | ]; |
@@ -21,42 +21,42 @@ |
||
21 | 21 | */ |
22 | 22 | class DomElementTest extends UnitTestCase |
23 | 23 | { |
24 | - /** |
|
25 | - * @var DomElement |
|
26 | - */ |
|
27 | - private $fixture; |
|
24 | + /** |
|
25 | + * @var DomElement |
|
26 | + */ |
|
27 | + private $fixture; |
|
28 | 28 | |
29 | - public function setUp() |
|
30 | - { |
|
31 | - $this->fixture = new DomElement(); |
|
32 | - } |
|
29 | + public function setUp() |
|
30 | + { |
|
31 | + $this->fixture = new DomElement(); |
|
32 | + } |
|
33 | 33 | |
34 | - public function tearDown() |
|
35 | - { |
|
36 | - unset($this->fixture); |
|
37 | - } |
|
34 | + public function tearDown() |
|
35 | + { |
|
36 | + unset($this->fixture); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @test |
|
41 | - * @dataProvider nameProvider |
|
42 | - */ |
|
43 | - public function givenNameCanBeConvertedToAnExpectedId($input, $expectedId) |
|
44 | - { |
|
45 | - $this->assertEquals($expectedId, $this->fixture->formatId($input)); |
|
46 | - } |
|
39 | + /** |
|
40 | + * @test |
|
41 | + * @dataProvider nameProvider |
|
42 | + */ |
|
43 | + public function givenNameCanBeConvertedToAnExpectedId($input, $expectedId) |
|
44 | + { |
|
45 | + $this->assertEquals($expectedId, $this->fixture->formatId($input)); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Provider |
|
50 | - */ |
|
51 | - public function nameProvider() |
|
52 | - { |
|
53 | - return array( |
|
54 | - array('foobar', 'foobar'), |
|
55 | - array('foo-bar', 'foo-bar'), |
|
56 | - array('foo_bar', 'foo-bar'), |
|
57 | - array('FooBarBaz', 'foo-bar-baz'), |
|
58 | - array('Foo Bar', 'foo-bar'), |
|
59 | - array('foo[bar]', 'foo-bar'), |
|
60 | - ); |
|
61 | - } |
|
48 | + /** |
|
49 | + * Provider |
|
50 | + */ |
|
51 | + public function nameProvider() |
|
52 | + { |
|
53 | + return array( |
|
54 | + array('foobar', 'foobar'), |
|
55 | + array('foo-bar', 'foo-bar'), |
|
56 | + array('foo_bar', 'foo-bar'), |
|
57 | + array('FooBarBaz', 'foo-bar-baz'), |
|
58 | + array('Foo Bar', 'foo-bar'), |
|
59 | + array('foo[bar]', 'foo-bar'), |
|
60 | + ); |
|
61 | + } |
|
62 | 62 | } |
@@ -21,26 +21,26 @@ |
||
21 | 21 | */ |
22 | 22 | class PermissionUtilityTest extends UnitTestCase |
23 | 23 | { |
24 | - /** |
|
25 | - * @var PermissionUtility |
|
26 | - */ |
|
27 | - private $fixture; |
|
24 | + /** |
|
25 | + * @var PermissionUtility |
|
26 | + */ |
|
27 | + private $fixture; |
|
28 | 28 | |
29 | - public function setUp() |
|
30 | - { |
|
31 | - $this->fixture = new PermissionUtility(); |
|
32 | - } |
|
29 | + public function setUp() |
|
30 | + { |
|
31 | + $this->fixture = new PermissionUtility(); |
|
32 | + } |
|
33 | 33 | |
34 | - public function tearDown() |
|
35 | - { |
|
36 | - unset($this->fixture); |
|
37 | - } |
|
34 | + public function tearDown() |
|
35 | + { |
|
36 | + unset($this->fixture); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @test |
|
41 | - */ |
|
42 | - public function checkWhetherPermissionUtilityIsCorrect() |
|
43 | - { |
|
44 | - $this->assertInstanceOf('\Fab\Media\Utility\PermissionUtility', $this->fixture); |
|
45 | - } |
|
39 | + /** |
|
40 | + * @test |
|
41 | + */ |
|
42 | + public function checkWhetherPermissionUtilityIsCorrect() |
|
43 | + { |
|
44 | + $this->assertInstanceOf('\Fab\Media\Utility\PermissionUtility', $this->fixture); |
|
45 | + } |
|
46 | 46 | } |
@@ -23,63 +23,63 @@ |
||
23 | 23 | */ |
24 | 24 | class PathTest extends UnitTestCase |
25 | 25 | { |
26 | - public function setUp() |
|
27 | - { |
|
28 | - } |
|
26 | + public function setUp() |
|
27 | + { |
|
28 | + } |
|
29 | 29 | |
30 | - public function tearDown() |
|
31 | - { |
|
32 | - } |
|
30 | + public function tearDown() |
|
31 | + { |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * @test |
|
36 | - */ |
|
37 | - public function canResolvesAPath() |
|
38 | - { |
|
39 | - $resourceName = uniqid('resource'); |
|
40 | - $expected = 'media/Resources/Public/' . $resourceName; |
|
41 | - $actual = Path::resolvePath($resourceName); |
|
34 | + /** |
|
35 | + * @test |
|
36 | + */ |
|
37 | + public function canResolvesAPath() |
|
38 | + { |
|
39 | + $resourceName = uniqid('resource'); |
|
40 | + $expected = 'media/Resources/Public/' . $resourceName; |
|
41 | + $actual = Path::resolvePath($resourceName); |
|
42 | 42 | |
43 | - $this->assertTrue(strpos($actual, $expected) > 0); |
|
44 | - $this->assertEquals(0, strpos(Environment::getPublicPath() . '/', $expected)); |
|
45 | - } |
|
43 | + $this->assertTrue(strpos($actual, $expected) > 0); |
|
44 | + $this->assertEquals(0, strpos(Environment::getPublicPath() . '/', $expected)); |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @test |
|
49 | - */ |
|
50 | - public function canReturnsAPublicPath() |
|
51 | - { |
|
52 | - $resourceName = uniqid('resource'); |
|
53 | - $expected = 'media/Resources/Public/' . $resourceName; |
|
54 | - $actual = Path::getRelativePath($resourceName); |
|
47 | + /** |
|
48 | + * @test |
|
49 | + */ |
|
50 | + public function canReturnsAPublicPath() |
|
51 | + { |
|
52 | + $resourceName = uniqid('resource'); |
|
53 | + $expected = 'media/Resources/Public/' . $resourceName; |
|
54 | + $actual = Path::getRelativePath($resourceName); |
|
55 | 55 | |
56 | - $this->assertTrue(strpos($actual, $expected) > 0); |
|
57 | - $this->assertFalse(strpos(Environment::getPublicPath() . '/', $expected)); |
|
58 | - } |
|
56 | + $this->assertTrue(strpos($actual, $expected) > 0); |
|
57 | + $this->assertFalse(strpos(Environment::getPublicPath() . '/', $expected)); |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @test |
|
62 | - */ |
|
63 | - public function methodExistsReturnTrueForFileExistingInExtensionMedia() |
|
64 | - { |
|
65 | - $this->assertTrue(Path::exists('Icons/MissingMimeTypeIcon.png')); |
|
66 | - } |
|
60 | + /** |
|
61 | + * @test |
|
62 | + */ |
|
63 | + public function methodExistsReturnTrueForFileExistingInExtensionMedia() |
|
64 | + { |
|
65 | + $this->assertTrue(Path::exists('Icons/MissingMimeTypeIcon.png')); |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @test |
|
70 | - */ |
|
71 | - public function methodNotExistsReturnFalseForFileExistingInExtensionMedia() |
|
72 | - { |
|
73 | - $this->assertFalse(Path::notExists('Icons/MissingMimeTypeIcon.png')); |
|
74 | - } |
|
68 | + /** |
|
69 | + * @test |
|
70 | + */ |
|
71 | + public function methodNotExistsReturnFalseForFileExistingInExtensionMedia() |
|
72 | + { |
|
73 | + $this->assertFalse(Path::notExists('Icons/MissingMimeTypeIcon.png')); |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * @test |
|
78 | - */ |
|
79 | - public function returnsCanonicalPathForPathContainingRelativeSegment() |
|
80 | - { |
|
81 | - $actual = '../bar/../../foo.png'; |
|
82 | - $expected = 'bar/foo.png'; |
|
83 | - $this->assertSame($expected, Path::canonicalPath($actual)); |
|
84 | - } |
|
76 | + /** |
|
77 | + * @test |
|
78 | + */ |
|
79 | + public function returnsCanonicalPathForPathContainingRelativeSegment() |
|
80 | + { |
|
81 | + $actual = '../bar/../../foo.png'; |
|
82 | + $expected = 'bar/foo.png'; |
|
83 | + $this->assertSame($expected, Path::canonicalPath($actual)); |
|
84 | + } |
|
85 | 85 | } |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | public function canResolvesAPath() |
38 | 38 | { |
39 | 39 | $resourceName = uniqid('resource'); |
40 | - $expected = 'media/Resources/Public/' . $resourceName; |
|
40 | + $expected = 'media/Resources/Public/'.$resourceName; |
|
41 | 41 | $actual = Path::resolvePath($resourceName); |
42 | 42 | |
43 | 43 | $this->assertTrue(strpos($actual, $expected) > 0); |
44 | - $this->assertEquals(0, strpos(Environment::getPublicPath() . '/', $expected)); |
|
44 | + $this->assertEquals(0, strpos(Environment::getPublicPath().'/', $expected)); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | public function canReturnsAPublicPath() |
51 | 51 | { |
52 | 52 | $resourceName = uniqid('resource'); |
53 | - $expected = 'media/Resources/Public/' . $resourceName; |
|
53 | + $expected = 'media/Resources/Public/'.$resourceName; |
|
54 | 54 | $actual = Path::getRelativePath($resourceName); |
55 | 55 | |
56 | 56 | $this->assertTrue(strpos($actual, $expected) > 0); |
57 | - $this->assertFalse(strpos(Environment::getPublicPath() . '/', $expected)); |
|
57 | + $this->assertFalse(strpos(Environment::getPublicPath().'/', $expected)); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -21,79 +21,79 @@ |
||
21 | 21 | */ |
22 | 22 | class UploadManagerTest extends UnitTestCase |
23 | 23 | { |
24 | - /** |
|
25 | - * @var UploadManager |
|
26 | - */ |
|
27 | - private $fixture; |
|
24 | + /** |
|
25 | + * @var UploadManager |
|
26 | + */ |
|
27 | + private $fixture; |
|
28 | 28 | |
29 | - /** |
|
30 | - * @var string |
|
31 | - */ |
|
32 | - private $fakeName = ''; |
|
29 | + /** |
|
30 | + * @var string |
|
31 | + */ |
|
32 | + private $fakeName = ''; |
|
33 | 33 | |
34 | - /** |
|
35 | - * @var string |
|
36 | - */ |
|
37 | - private $fakePrefix = ''; |
|
34 | + /** |
|
35 | + * @var string |
|
36 | + */ |
|
37 | + private $fakePrefix = ''; |
|
38 | 38 | |
39 | - public function setUp() |
|
40 | - { |
|
41 | - $this->fixture = new UploadManager(); |
|
42 | - $this->fakeName = uniqid('name'); |
|
43 | - $this->fakePrefix= uniqid('prefix'); |
|
44 | - } |
|
39 | + public function setUp() |
|
40 | + { |
|
41 | + $this->fixture = new UploadManager(); |
|
42 | + $this->fakeName = uniqid('name'); |
|
43 | + $this->fakePrefix= uniqid('prefix'); |
|
44 | + } |
|
45 | 45 | |
46 | - public function tearDown() |
|
47 | - { |
|
48 | - unset($this->fixture); |
|
49 | - } |
|
46 | + public function tearDown() |
|
47 | + { |
|
48 | + unset($this->fixture); |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @test |
|
53 | - * @dataProvider propertyProvider |
|
54 | - */ |
|
55 | - public function testProperty($propertyName, $value) |
|
56 | - { |
|
57 | - $setter = 'set' . ucfirst($propertyName); |
|
58 | - $getter = 'get' . ucfirst($propertyName); |
|
59 | - call_user_func_array(array($this->fixture, $setter), array($value)); |
|
60 | - $this->assertEquals($value, call_user_func(array($this->fixture, $getter))); |
|
61 | - } |
|
51 | + /** |
|
52 | + * @test |
|
53 | + * @dataProvider propertyProvider |
|
54 | + */ |
|
55 | + public function testProperty($propertyName, $value) |
|
56 | + { |
|
57 | + $setter = 'set' . ucfirst($propertyName); |
|
58 | + $getter = 'get' . ucfirst($propertyName); |
|
59 | + call_user_func_array(array($this->fixture, $setter), array($value)); |
|
60 | + $this->assertEquals($value, call_user_func(array($this->fixture, $getter))); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Provider |
|
65 | - */ |
|
66 | - public function propertyProvider() |
|
67 | - { |
|
68 | - return array( |
|
69 | - array('uploadFolder', uniqid()), |
|
70 | - array('inputName', uniqid()), |
|
71 | - array('sizeLimit', rand(10, 100)), |
|
72 | - ); |
|
73 | - } |
|
63 | + /** |
|
64 | + * Provider |
|
65 | + */ |
|
66 | + public function propertyProvider() |
|
67 | + { |
|
68 | + return array( |
|
69 | + array('uploadFolder', uniqid()), |
|
70 | + array('inputName', uniqid()), |
|
71 | + array('sizeLimit', rand(10, 100)), |
|
72 | + ); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @test |
|
77 | - * @dataProvider fileNameProvider |
|
78 | - */ |
|
79 | - public function sanitizeFileNameTest($actual, $expected) |
|
80 | - { |
|
81 | - $this->assertSame($expected, $this->fixture->sanitizeFileName($actual)); |
|
82 | - } |
|
75 | + /** |
|
76 | + * @test |
|
77 | + * @dataProvider fileNameProvider |
|
78 | + */ |
|
79 | + public function sanitizeFileNameTest($actual, $expected) |
|
80 | + { |
|
81 | + $this->assertSame($expected, $this->fixture->sanitizeFileName($actual)); |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * Provider |
|
86 | - */ |
|
87 | - public function fileNameProvider() |
|
88 | - { |
|
89 | - return array( |
|
90 | - array('éléphant', 'elephant'), |
|
91 | - array('foo bar', 'foo-bar'), |
|
92 | - array('Foo Bar', 'Foo-Bar'), |
|
93 | - array('foo_bar', 'foo_bar'), |
|
94 | - array('foo&bar', 'foo-bar'), |
|
95 | - array('foo!bar', 'foo-bar'), |
|
96 | - array('foo~bar', 'foo-bar'), |
|
97 | - ); |
|
98 | - } |
|
84 | + /** |
|
85 | + * Provider |
|
86 | + */ |
|
87 | + public function fileNameProvider() |
|
88 | + { |
|
89 | + return array( |
|
90 | + array('éléphant', 'elephant'), |
|
91 | + array('foo bar', 'foo-bar'), |
|
92 | + array('Foo Bar', 'Foo-Bar'), |
|
93 | + array('foo_bar', 'foo_bar'), |
|
94 | + array('foo&bar', 'foo-bar'), |
|
95 | + array('foo!bar', 'foo-bar'), |
|
96 | + array('foo~bar', 'foo-bar'), |
|
97 | + ); |
|
98 | + } |
|
99 | 99 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $this->fixture = new UploadManager(); |
42 | 42 | $this->fakeName = uniqid('name'); |
43 | - $this->fakePrefix= uniqid('prefix'); |
|
43 | + $this->fakePrefix = uniqid('prefix'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function tearDown() |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function testProperty($propertyName, $value) |
56 | 56 | { |
57 | - $setter = 'set' . ucfirst($propertyName); |
|
58 | - $getter = 'get' . ucfirst($propertyName); |
|
57 | + $setter = 'set'.ucfirst($propertyName); |
|
58 | + $getter = 'get'.ucfirst($propertyName); |
|
59 | 59 | call_user_func_array(array($this->fixture, $setter), array($value)); |
60 | 60 | $this->assertEquals($value, call_user_func(array($this->fixture, $getter))); |
61 | 61 | } |
@@ -21,48 +21,48 @@ |
||
21 | 21 | */ |
22 | 22 | class ImageOptimizerTest extends UnitTestCase |
23 | 23 | { |
24 | - /** |
|
25 | - * @var ImageOptimizer |
|
26 | - */ |
|
27 | - private $fixture; |
|
24 | + /** |
|
25 | + * @var ImageOptimizer |
|
26 | + */ |
|
27 | + private $fixture; |
|
28 | 28 | |
29 | - public function setUp() |
|
30 | - { |
|
31 | - $this->fixture = new ImageOptimizer(); |
|
32 | - } |
|
29 | + public function setUp() |
|
30 | + { |
|
31 | + $this->fixture = new ImageOptimizer(); |
|
32 | + } |
|
33 | 33 | |
34 | - public function tearDown() |
|
35 | - { |
|
36 | - unset($this->fixture); |
|
37 | - } |
|
34 | + public function tearDown() |
|
35 | + { |
|
36 | + unset($this->fixture); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @test |
|
41 | - */ |
|
42 | - public function checkOptimizersPropertyContainsDefaultValues() |
|
43 | - { |
|
44 | - $this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Resize', 'optimizers', $this->fixture); |
|
45 | - $this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Rotate', 'optimizers', $this->fixture); |
|
46 | - } |
|
39 | + /** |
|
40 | + * @test |
|
41 | + */ |
|
42 | + public function checkOptimizersPropertyContainsDefaultValues() |
|
43 | + { |
|
44 | + $this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Resize', 'optimizers', $this->fixture); |
|
45 | + $this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Rotate', 'optimizers', $this->fixture); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * @test |
|
50 | - */ |
|
51 | - public function addNewRandomOptimizer() |
|
52 | - { |
|
53 | - $optimizer = uniqid(); |
|
54 | - $this->fixture->add($optimizer); |
|
55 | - $this->assertAttributeContains($optimizer, 'optimizers', $this->fixture); |
|
56 | - } |
|
48 | + /** |
|
49 | + * @test |
|
50 | + */ |
|
51 | + public function addNewRandomOptimizer() |
|
52 | + { |
|
53 | + $optimizer = uniqid(); |
|
54 | + $this->fixture->add($optimizer); |
|
55 | + $this->assertAttributeContains($optimizer, 'optimizers', $this->fixture); |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @test |
|
60 | - */ |
|
61 | - public function addNewRandomAndRemoveOptimizer() |
|
62 | - { |
|
63 | - $optimizer = uniqid(); |
|
64 | - $this->fixture->add($optimizer); |
|
65 | - $this->fixture->remove($optimizer); |
|
66 | - $this->assertAttributeNotContains($optimizer, 'optimizers', $this->fixture); |
|
67 | - } |
|
58 | + /** |
|
59 | + * @test |
|
60 | + */ |
|
61 | + public function addNewRandomAndRemoveOptimizer() |
|
62 | + { |
|
63 | + $optimizer = uniqid(); |
|
64 | + $this->fixture->add($optimizer); |
|
65 | + $this->fixture->remove($optimizer); |
|
66 | + $this->assertAttributeNotContains($optimizer, 'optimizers', $this->fixture); |
|
67 | + } |
|
68 | 68 | } |
@@ -21,26 +21,26 @@ |
||
21 | 21 | */ |
22 | 22 | class CategoryRendererTest extends UnitTestCase |
23 | 23 | { |
24 | - /** |
|
25 | - * @var CategoryRenderer |
|
26 | - */ |
|
27 | - private $fixture; |
|
24 | + /** |
|
25 | + * @var CategoryRenderer |
|
26 | + */ |
|
27 | + private $fixture; |
|
28 | 28 | |
29 | - public function setUp() |
|
30 | - { |
|
31 | - $this->fixture = new CategoryRenderer(); |
|
32 | - } |
|
29 | + public function setUp() |
|
30 | + { |
|
31 | + $this->fixture = new CategoryRenderer(); |
|
32 | + } |
|
33 | 33 | |
34 | - public function tearDown() |
|
35 | - { |
|
36 | - unset($this->fixture); |
|
37 | - } |
|
34 | + public function tearDown() |
|
35 | + { |
|
36 | + unset($this->fixture); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @test |
|
41 | - */ |
|
42 | - public function fixtureIsOfTypeGridRendererCategoryRenderer() |
|
43 | - { |
|
44 | - $this->assertInstanceOf('Fab\Media\Grid\CategoryRenderer', $this->fixture); |
|
45 | - } |
|
39 | + /** |
|
40 | + * @test |
|
41 | + */ |
|
42 | + public function fixtureIsOfTypeGridRendererCategoryRenderer() |
|
43 | + { |
|
44 | + $this->assertInstanceOf('Fab\Media\Grid\CategoryRenderer', $this->fixture); |
|
45 | + } |
|
46 | 46 | } |
@@ -21,26 +21,26 @@ |
||
21 | 21 | */ |
22 | 22 | class UsageRendererTest extends UnitTestCase |
23 | 23 | { |
24 | - /** |
|
25 | - * @var UsageRenderer |
|
26 | - */ |
|
27 | - private $fixture; |
|
24 | + /** |
|
25 | + * @var UsageRenderer |
|
26 | + */ |
|
27 | + private $fixture; |
|
28 | 28 | |
29 | - public function setUp() |
|
30 | - { |
|
31 | - $this->fixture = new UsageRenderer(); |
|
32 | - } |
|
29 | + public function setUp() |
|
30 | + { |
|
31 | + $this->fixture = new UsageRenderer(); |
|
32 | + } |
|
33 | 33 | |
34 | - public function tearDown() |
|
35 | - { |
|
36 | - unset($this->fixture); |
|
37 | - } |
|
34 | + public function tearDown() |
|
35 | + { |
|
36 | + unset($this->fixture); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @test |
|
41 | - */ |
|
42 | - public function fixtureIsOfTypeGridRendererUsageRenderer() |
|
43 | - { |
|
44 | - $this->assertInstanceOf('Fab\Media\Grid\UsageRenderer', $this->fixture); |
|
45 | - } |
|
39 | + /** |
|
40 | + * @test |
|
41 | + */ |
|
42 | + public function fixtureIsOfTypeGridRendererUsageRenderer() |
|
43 | + { |
|
44 | + $this->assertInstanceOf('Fab\Media\Grid\UsageRenderer', $this->fixture); |
|
45 | + } |
|
46 | 46 | } |