‪TYPO3CMS  ‪main
FileNodeTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
30 
32 {
37  {
38  $this->expectException(InvalidArgumentException::class);
39  $this->expectExceptionCode(1366927513);
40  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
41  $node->__construct([], null);
42  }
43 
48  {
49  $this->expectException(InvalidArgumentException::class);
50  $this->expectExceptionCode(1366222207);
51  $parent = $this->createMock(NodeInterface::class);
52  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
53  $structure = [
54  'name' => 'foo/bar',
55  ];
56  $node->__construct($structure, $parent);
57  }
58 
62  public function ‪constructorSetsParent(): void
63  {
64  $parent = $this->createMock(NodeInterface::class);
65  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
66  $structure = [
67  'name' => 'foo',
68  ];
69  $node->__construct($structure, $parent);
70  self::assertSame($parent, $node->_call('getParent'));
71  }
72 
76  public function ‪constructorSetsTargetPermission(): void
77  {
78  $parent = $this->createMock(NodeInterface::class);
79  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
80  $targetPermission = '0660';
81  $structure = [
82  'name' => 'foo',
83  'targetPermission' => $targetPermission,
84  ];
85  $node->__construct($structure, $parent);
86  self::assertSame($targetPermission, $node->_call('getTargetPermission'));
87  }
88 
92  public function ‪constructorSetsName(): void
93  {
94  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
95  $parent = $this->createMock(RootNodeInterface::class);
96  $name = ‪StringUtility::getUniqueId('test_');
97  $node->__construct(['name' => $name], $parent);
98  self::assertSame($name, $node->getName());
99  }
100 
105  {
106  $this->expectException(InvalidArgumentException::class);
107  $this->expectExceptionCode(1380364361);
108  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
109  $parent = $this->createMock(RootNodeInterface::class);
110  $structure = [
111  'name' => 'foo',
112  'targetContent' => 'foo',
113  'targetContentFile' => 'aPath',
114  ];
115  $node->__construct($structure, $parent);
116  }
117 
121  public function ‪constructorSetsTargetContent(): void
122  {
123  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
124  $parent = $this->createMock(RootNodeInterface::class);
125  $targetContent = ‪StringUtility::getUniqueId('content_');
126  $structure = [
127  'name' => 'foo',
128  'targetContent' => $targetContent,
129  ];
130  $node->__construct($structure, $parent);
131  self::assertSame($targetContent, $node->_get('targetContent'));
132  }
133 
138  {
139  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
140  $parent = $this->createMock(RootNodeInterface::class);
141  $targetFile = $this->‪getTestFilePath('test_');
142  $targetContent = ‪StringUtility::getUniqueId('content_');
143  file_put_contents($targetFile, $targetContent);
144  $structure = [
145  'name' => 'foo',
146  'targetContentFile' => $targetFile,
147  ];
148  $node->__construct($structure, $parent);
149  self::assertSame($targetContent, $node->_get('targetContent'));
150  }
151 
156  {
157  $this->expectException(InvalidArgumentException::class);
158  $this->expectExceptionCode(1380364362);
159  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
160  $parent = $this->createMock(RootNodeInterface::class);
161  $targetFile = $this->‪getTestFilePath('test_');
162  $structure = [
163  'name' => 'foo',
164  'targetContentFile' => $targetFile,
165  ];
166  $node->__construct($structure, $parent);
167  }
168 
172  public function ‪targetContentIsNullIfNotGiven(): void
173  {
174  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
175  $parent = $this->createMock(RootNodeInterface::class);
176  $structure = [
177  'name' => 'foo',
178  ];
179  $node->__construct($structure, $parent);
180  self::assertNull($node->_get('targetContent'));
181  }
182 
186  public function ‪getStatusReturnsArray(): void
187  {
188  $node = $this->getAccessibleMock(
189  FileNode::class,
190  ['getAbsolutePath', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
191  [],
192  '',
193  false
194  );
195  // do not use var path here, as file nodes explicitly check for public path
196  $testRoot = ‪Environment::getPublicPath() . '/typo3temp/tests/';
197  $this->testFilesToDelete[] = $testRoot;
199  $path = $testRoot . ‪StringUtility::getUniqueId('dir_');
200  $node->method('getAbsolutePath')->willReturn($path);
201  $node->method('exists')->willReturn(true);
202  $node->method('isFile')->willReturn(true);
203  $node->method('isPermissionCorrect')->willReturn(true);
204  $node->method('isWritable')->willReturn(true);
205  $node->method('isContentCorrect')->willReturn(true);
206  self::assertIsArray($node->getStatus());
207  }
208 
213  {
214  $node = $this->getAccessibleMock(
215  FileNode::class,
216  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
217  [],
218  '',
219  false
220  );
221  $path = $this->‪getTestDirectory('dir_');
222  $node->method('getAbsolutePath')->willReturn($path);
223  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
224  $node->method('exists')->willReturn(false);
225  $node->method('isFile')->willReturn(true);
226  $node->method('isPermissionCorrect')->willReturn(true);
227  $node->method('isWritable')->willReturn(true);
228  $node->method('isContentCorrect')->willReturn(true);
229  $statusArray = $node->getStatus();
230  self::assertSame(ContextualFeedbackSeverity::WARNING, $statusArray[0]->getSeverity());
231  }
232 
237  {
238  $node = $this->getAccessibleMock(
239  FileNode::class,
240  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
241  [],
242  '',
243  false
244  );
245  $path = $this->‪getTestFilePath('dir_');
246  touch($path);
247  $node->method('getAbsolutePath')->willReturn($path);
248  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
249  $node->method('exists')->willReturn(true);
250  $node->method('isFile')->willReturn(false);
251  $node->method('isPermissionCorrect')->willReturn(true);
252  $node->method('isWritable')->willReturn(true);
253  $node->method('isContentCorrect')->willReturn(true);
254  $statusArray = $node->getStatus();
255  self::assertSame(ContextualFeedbackSeverity::ERROR, $statusArray[0]->getSeverity());
256  }
257 
262  {
263  $node = $this->getAccessibleMock(
264  FileNode::class,
265  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
266  [],
267  '',
268  false
269  );
270  $path = $this->‪getTestFilePath('dir_');
271  touch($path);
272  $node->method('getAbsolutePath')->willReturn($path);
273  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
274  $node->method('exists')->willReturn(true);
275  $node->method('isFile')->willReturn(true);
276  $node->method('isPermissionCorrect')->willReturn(true);
277  $node->method('isWritable')->willReturn(false);
278  $node->method('isContentCorrect')->willReturn(true);
279  $statusArray = $node->getStatus();
280  self::assertSame(ContextualFeedbackSeverity::NOTICE, $statusArray[0]->getSeverity());
281  }
282 
287  {
288  $node = $this->getAccessibleMock(
289  FileNode::class,
290  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
291  [],
292  '',
293  false
294  );
295  $path = $this->‪getTestFilePath('dir_');
296  touch($path);
297  $node->method('getAbsolutePath')->willReturn($path);
298  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
299  $node->method('exists')->willReturn(true);
300  $node->method('isFile')->willReturn(true);
301  $node->method('isPermissionCorrect')->willReturn(false);
302  $node->method('isWritable')->willReturn(true);
303  $node->method('isContentCorrect')->willReturn(true);
304  $statusArray = $node->getStatus();
305  self::assertSame(ContextualFeedbackSeverity::NOTICE, $statusArray[0]->getSeverity());
306  }
307 
312  {
313  $node = $this->getAccessibleMock(
314  FileNode::class,
315  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
316  [],
317  '',
318  false
319  );
320  $path = $this->‪getTestFilePath('dir_');
321  touch($path);
322  $node->method('getAbsolutePath')->willReturn($path);
323  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
324  $node->method('exists')->willReturn(true);
325  $node->method('isFile')->willReturn(true);
326  $node->method('isPermissionCorrect')->willReturn(true);
327  $node->method('isWritable')->willReturn(true);
328  $node->method('isContentCorrect')->willReturn(false);
329  $statusArray = $node->getStatus();
330  self::assertSame(ContextualFeedbackSeverity::NOTICE, $statusArray[0]->getSeverity());
331  }
332 
337  {
338  $node = $this->getAccessibleMock(
339  FileNode::class,
340  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
341  [],
342  '',
343  false
344  );
345  $path = $this->‪getTestFilePath('dir_');
346  touch($path);
347  $node->method('getAbsolutePath')->willReturn($path);
348  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
349  $node->method('exists')->willReturn(true);
350  $node->method('isFile')->willReturn(true);
351  $node->method('isPermissionCorrect')->willReturn(true);
352  $node->method('isWritable')->willReturn(true);
353  $node->method('isContentCorrect')->willReturn(true);
354  $statusArray = $node->getStatus();
355  self::assertSame(ContextualFeedbackSeverity::OK, $statusArray[0]->getSeverity());
356  }
357 
362  {
363  $node = $this->getAccessibleMock(
364  FileNode::class,
365  ['fixSelf'],
366  [],
367  '',
368  false
369  );
370  $uniqueReturn = [‪StringUtility::getUniqueId('foo_')];
371  $node->expects(self::once())->method('fixSelf')->willReturn($uniqueReturn);
372  self::assertSame($uniqueReturn, $node->fix());
373  }
374 
379  {
380  $node = $this->getAccessibleMock(
381  FileNode::class,
382  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
383  [],
384  '',
385  false
386  );
387  $node->method('exists')->willReturn(false);
388  $node->method('isFile')->willReturn(true);
389  $node->method('isPermissionCorrect')->willReturn(true);
390  $message = new ‪FlashMessage('foo');
391  $node->expects(self::once())->method('createFile')->willReturn($message);
392  $actualReturn = $node->_call('fixSelf');
393  $actualReturn = $actualReturn[0];
394  self::assertSame($message, $actualReturn);
395  }
396 
401  {
402  $node = $this->getAccessibleMock(
403  FileNode::class,
404  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
405  [],
406  '',
407  false
408  );
409  $node->method('exists')->willReturn(false);
410  $node->method('isFile')->willReturn(true);
411  $node->method('isPermissionCorrect')->willReturn(true);
412  $message1 = new ‪FlashMessage('foo');
413  $node->method('createFile')->willReturn($message1);
414  $node->_set('targetContent', 'foo');
415  $message2 = new ‪FlashMessage('foo');
416  $node->expects(self::once())->method('setContent')->willReturn($message2);
417  $actualReturn = $node->_call('fixSelf');
418  $actualReturn = $actualReturn[1];
419  self::assertSame($message2, $actualReturn);
420  }
421 
426  {
427  $node = $this->getAccessibleMock(
428  FileNode::class,
429  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
430  [],
431  '',
432  false
433  );
434  $node->method('exists')->willReturn(false);
435  $node->method('isFile')->willReturn(true);
436  $node->method('isPermissionCorrect')->willReturn(true);
437  $message = new ‪FlashMessage('foo', '', ContextualFeedbackSeverity::ERROR);
438  $node->method('createFile')->willReturn($message);
439  $node->_set('targetContent', 'foo');
440  $node->expects(self::never())->method('setContent');
441  $node->_call('fixSelf');
442  }
443 
448  {
449  $node = $this->getAccessibleMock(
450  FileNode::class,
451  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
452  [],
453  '',
454  false
455  );
456  $node->method('exists')->willReturn(false);
457  $node->method('isFile')->willReturn(true);
458  $node->method('isPermissionCorrect')->willReturn(true);
459  $message = new ‪FlashMessage('foo');
460  $node->method('createFile')->willReturn($message);
461  $node->_set('targetContent', null);
462  $node->expects(self::never())->method('setContent');
463  $node->_call('fixSelf');
464  }
465 
470  {
471  $node = $this->getAccessibleMock(
472  FileNode::class,
473  ['exists', 'createFile', 'getAbsolutePath', 'isFile', 'isPermissionCorrect', 'fixPermission'],
474  [],
475  '',
476  false
477  );
478  $node->method('exists')->willReturn(true);
479  $node->method('isFile')->willReturn(true);
480  $node->method('isPermissionCorrect')->willReturn(false);
481  $message = new ‪FlashMessage('foo');
482  $node->expects(self::once())->method('fixPermission')->willReturn($message);
483  self::assertSame([$message], $node->_call('fixSelf'));
484  }
485 
490  {
491  $node = $this->getAccessibleMock(
492  FileNode::class,
493  ['exists', 'createFile', 'getAbsolutePath', 'isFile', 'isPermissionCorrect', 'getRelativePathBelowSiteRoot'],
494  [],
495  '',
496  false
497  );
498  $node->method('exists')->willReturn(true);
499  $node->expects(self::once())->method('isFile')->willReturn(false);
500  $node->method('isPermissionCorrect')->willReturn(true);
501  $node->_call('fixSelf');
502  }
503 
508  {
509  $node = $this->getAccessibleMock(
510  FileNode::class,
511  ['exists', 'isFile', 'isPermissionCorrect'],
512  [],
513  '',
514  false
515  );
516  $node->method('exists')->willReturn(true);
517  $node->method('isFile')->willReturn(true);
518  $node->method('isPermissionCorrect')->willReturn(true);
519  self::assertIsArray($node->_call('fixSelf'));
520  }
521 
526  {
527  $this->expectException(Exception::class);
528  $this->expectExceptionCode(1366398198);
529  $node = $this->getAccessibleMock(FileNode::class, ['exists', 'getAbsolutePath'], [], '', false);
530  $node->expects(self::once())->method('getAbsolutePath')->willReturn('');
531  $node->expects(self::once())->method('exists')->willReturn(true);
532  $node->_call('createFile');
533  }
534 
539  {
540  $node = $this->getAccessibleMock(FileNode::class, ['exists', 'getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
541  $path = $this->‪getTestFilePath('file_');
542  $node->expects(self::once())->method('exists')->willReturn(false);
543  $node->method('getAbsolutePath')->willReturn($path);
544  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
545  self::assertSame(ContextualFeedbackSeverity::OK, $node->_call('createFile')->getSeverity());
546  }
547 
551  public function ‪createFileCreatesFile(): void
552  {
553  $node = $this->getAccessibleMock(FileNode::class, ['exists', 'getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
554  $path = $this->‪getTestFilePath('file_');
555  $node->expects(self::once())->method('exists')->willReturn(false);
556  $node->method('getAbsolutePath')->willReturn($path);
557  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
558  $node->_call('createFile');
559  self::assertTrue(is_file($path));
560  }
561 
566  {
567  $this->expectException(Exception::class);
568  $this->expectExceptionCode(1367056363);
569  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
570  $path = $this->‪getTestDirectory('dir_');
571  $node->method('getAbsolutePath')->willReturn($path);
572  $node->_call('isContentCorrect');
573  }
574 
579  {
580  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
581  $path = $this->‪getTestFilePath('file_');
582  touch($path);
583  $node->method('getAbsolutePath')->willReturn($path);
584  $node->_set('targetContent', null);
585  self::assertTrue($node->_call('isContentCorrect'));
586  }
587 
592  {
593  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
594  $path = $this->‪getTestFilePath('file_');
595  $content = ‪StringUtility::getUniqueId('content_');
596  file_put_contents($path, $content);
597  $node->method('getAbsolutePath')->willReturn($path);
598  $node->_set('targetContent', $content);
599  self::assertTrue($node->_call('isContentCorrect'));
600  }
601 
606  {
607  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
608  $path = $this->‪getTestFilePath('file_');
609  $content = ‪StringUtility::getUniqueId('content1_');
610  $targetContent = ‪StringUtility::getUniqueId('content2_');
611  file_put_contents($path, $content);
612  $node->method('getAbsolutePath')->willReturn($path);
613  $node->_set('targetContent', $targetContent);
614  self::assertFalse($node->_call('isContentCorrect'));
615  }
616 
621  {
622  $parent = $this->createMock(NodeInterface::class);
623  $node = $this->getAccessibleMock(FileNode::class, ['getCurrentPermission', 'isWindowsOs'], [], '', false);
624  $node->method('isWindowsOs')->willReturn(false);
625  $node->method('getCurrentPermission')->willReturn('0664');
626  $targetPermission = '0664';
627  $structure = [
628  'name' => 'foo',
629  'targetPermission' => $targetPermission,
630  ];
631  $node->__construct($structure, $parent);
632  self::assertTrue($node->_call('isPermissionCorrect'));
633  }
634 
639  {
640  $this->expectException(Exception::class);
641  $this->expectExceptionCode(1367060201);
642  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
643  $path = $this->‪getTestDirectory('dir_');
644  $node->method('getAbsolutePath')->willReturn($path);
645  $node->_set('targetContent', 'foo');
646  $node->_call('setContent');
647  }
648 
653  {
654  $this->expectException(Exception::class);
655  $this->expectExceptionCode(1367060202);
656  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
657  $path = $this->‪getTestFilePath('file_');
658  touch($path);
659  $node->method('getAbsolutePath')->willReturn($path);
660  $node->_set('targetContent', null);
661  $node->_call('setContent');
662  }
663 
667  public function ‪setContentSetsContentToFile(): void
668  {
669  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
670  $path = $this->‪getTestFilePath('file_');
671  touch($path);
672  $node->method('getAbsolutePath')->willReturn($path);
673  $targetContent = ‪StringUtility::getUniqueId('content_');
674  $node->_set('targetContent', $targetContent);
675  $node->_call('setContent');
676  $resultContent = file_get_contents($path);
677  self::assertSame($targetContent, $resultContent);
678  }
679 
684  {
685  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
686  $path = $this->‪getTestFilePath('file_');
687  touch($path);
688  $node->method('getAbsolutePath')->willReturn($path);
689  $targetContent = ‪StringUtility::getUniqueId('content_');
690  $node->_set('targetContent', $targetContent);
691  self::assertSame(ContextualFeedbackSeverity::OK, $node->_call('setContent')->getSeverity());
692  }
693 
697  public function ‪isFileReturnsTrueIfNameIsFile(): void
698  {
699  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
700  $path = $this->‪getTestFilePath('file_');
701  touch($path);
702  $node->method('getAbsolutePath')->willReturn($path);
703  self::assertTrue($node->_call('isFile'));
704  }
705 
710  {
711  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
712  // do not use var path here, as file nodes explicitly check for public path
713  $testRoot = ‪Environment::getPublicPath() . '/typo3temp/tests/';
714  $path = $testRoot . ‪StringUtility::getUniqueId('root_');
715  $this->testFilesToDelete[] = $testRoot;
717  $link = ‪StringUtility::getUniqueId('link_');
718  $file = ‪StringUtility::getUniqueId('file_');
719  touch($path . '/' . $file);
720  symlink($path . '/' . $file, $path . '/' . $link);
721  $node->method('getAbsolutePath')->willReturn($path . '/' . $link);
722  self::assertFalse($node->_call('isFile'));
723  }
724 }
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithNoticeStatusIfFileExistsButContentIsNotCorrect
‪getStatusReturnsArrayWithNoticeStatusIfFileExistsButContentIsNotCorrect()
Definition: FileNodeTest.php:311
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest
Definition: FileNodeTest.php:32
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileReturnsOkStatusIfFileWasCreated
‪createFileReturnsOkStatusIfFileWasCreated()
Definition: FileNodeTest.php:538
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\AbstractFolderStructureTestCase\getTestDirectory
‪getTestDirectory($prefix='root_')
Definition: AbstractFolderStructureTestCase.php:33
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfDoesNotCallSetContentIfFileTargetContentIsNull
‪fixSelfDoesNotCallSetContentIfFileTargetContentIsNull()
Definition: FileNodeTest.php:447
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileCreatesFile
‪createFileCreatesFile()
Definition: FileNodeTest.php:551
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayNoticeStatusIfFileExistsButIsNotWritable
‪getStatusReturnsArrayNoticeStatusIfFileExistsButIsNotWritable()
Definition: FileNodeTest.php:261
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentReturnsOkStatusIfContentWasSuccessfullySet
‪setContentReturnsOkStatusIfContentWasSuccessfullySet()
Definition: FileNodeTest.php:683
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentSetsContentToFile
‪setContentSetsContentToFile()
Definition: FileNodeTest.php:667
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentThrowsExceptionIfTargetIsNotAFile
‪setContentThrowsExceptionIfTargetIsNotAFile()
Definition: FileNodeTest.php:638
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfReturnsArrayOfStatusMessages
‪fixSelfReturnsArrayOfStatusMessages()
Definition: FileNodeTest.php:507
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static getPublicPath()
Definition: Environment.php:187
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsTrueIfTargetContentEqualsCurrentContent
‪isContentCorrectReturnsTrueIfTargetContentEqualsCurrentContent()
Definition: FileNodeTest.php:591
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithWarningStatusIFileNotExists
‪getStatusReturnsArrayWithWarningStatusIFileNotExists()
Definition: FileNodeTest.php:212
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\AbstractFolderStructureTestCase\getTestFilePath
‪non empty string getTestFilePath($prefix='file_')
Definition: AbstractFolderStructureTestCase.php:48
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithOkStatusIfFileExistsAndPermissionAreCorrect
‪getStatusReturnsArrayWithOkStatusIfFileExistsAndPermissionAreCorrect()
Definition: FileNodeTest.php:336
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileThrowsExceptionIfNodeExists
‪createFileThrowsExceptionIfNodeExists()
Definition: FileNodeTest.php:525
‪TYPO3\CMS\Install\FolderStructure\RootNodeInterface
Definition: RootNodeInterface.php:22
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArray
‪getStatusReturnsArray()
Definition: FileNodeTest.php:186
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithNoticeStatusIfFileExistsButPermissionAreNotCorrect
‪getStatusReturnsArrayWithNoticeStatusIfFileExistsButPermissionAreNotCorrect()
Definition: FileNodeTest.php:286
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsParent
‪constructorSetsParent()
Definition: FileNodeTest.php:62
‪TYPO3\CMS\Core\Type\ContextualFeedbackSeverity
‪ContextualFeedbackSeverity
Definition: ContextualFeedbackSeverity.php:25
‪TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
Definition: InvalidArgumentException.php:24
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\AbstractFolderStructureTestCase
Definition: AbstractFolderStructureTestCase.php:26
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfNameContainsForwardSlash
‪constructorThrowsExceptionIfNameContainsForwardSlash()
Definition: FileNodeTest.php:47
‪TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep
‪static mkdir_deep($directory)
Definition: GeneralUtility.php:1638
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure
Definition: AbstractFolderStructureTestCase.php:18
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfCallsCreateFileIfFileDoesNotExistAndReturnsResult
‪fixSelfCallsCreateFileIfFileDoesNotExistAndReturnsResult()
Definition: FileNodeTest.php:378
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsTargetPermission
‪constructorSetsTargetPermission()
Definition: FileNodeTest.php:76
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isPermissionCorrectReturnsTrueIfTargetPermissionAndCurrentPermissionAreIdentical
‪isPermissionCorrectReturnsTrueIfTargetPermissionAndCurrentPermissionAreIdentical()
Definition: FileNodeTest.php:620
‪TYPO3\CMS\Install\FolderStructure\FileNode
Definition: FileNode.php:27
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isFileReturnsTrueIfNameIsFile
‪isFileReturnsTrueIfNameIsFile()
Definition: FileNodeTest.php:697
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfDoesNotCallSetContentIfFileCreationFailed
‪fixSelfDoesNotCallSetContentIfFileCreationFailed()
Definition: FileNodeTest.php:425
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectThrowsExceptionIfTargetIsNotAFile
‪isContentCorrectThrowsExceptionIfTargetIsNotAFile()
Definition: FileNodeTest.php:565
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithErrorStatusIfNodeIsNotAFile
‪getStatusReturnsArrayWithErrorStatusIfNodeIsNotAFile()
Definition: FileNodeTest.php:236
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsTrueIfTargetContentPropertyIsNull
‪isContentCorrectReturnsTrueIfTargetContentPropertyIsNull()
Definition: FileNodeTest.php:578
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfCallsFixPermissionIfFileExistsButPermissionAreWrong
‪fixSelfCallsFixPermissionIfFileExistsButPermissionAreWrong()
Definition: FileNodeTest.php:489
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\targetContentIsNullIfNotGiven
‪targetContentIsNullIfNotGiven()
Definition: FileNodeTest.php:172
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfReturnsErrorStatusIfNodeExistsButIsNotAFileAndReturnsResult
‪fixSelfReturnsErrorStatusIfNodeExistsButIsNotAFileAndReturnsResult()
Definition: FileNodeTest.php:469
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsFalseIfTargetContentNotEqualsCurrentContent
‪isContentCorrectReturnsFalseIfTargetContentNotEqualsCurrentContent()
Definition: FileNodeTest.php:605
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isFileReturnsFalseIfNameIsALinkFile
‪isFileReturnsFalseIfNameIsALinkFile()
Definition: FileNodeTest.php:709
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:27
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfBothTargetContentAndTargetContentFileAreSet
‪constructorThrowsExceptionIfBothTargetContentAndTargetContentFileAreSet()
Definition: FileNodeTest.php:104
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:41
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfParentIsNull
‪constructorThrowsExceptionIfParentIsNull()
Definition: FileNodeTest.php:36
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsTargetContentToContentOfTargetContentFile
‪constructorSetsTargetContentToContentOfTargetContentFile()
Definition: FileNodeTest.php:137
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsName
‪constructorSetsName()
Definition: FileNodeTest.php:92
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfTargetContentFileDoesNotExist
‪constructorThrowsExceptionIfTargetContentFileDoesNotExist()
Definition: FileNodeTest.php:155
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfCallsSetsContentIfFileCreationWasSuccessfulAndTargetContentIsNotNullAndReturnsResult
‪fixSelfCallsSetsContentIfFileCreationWasSuccessfulAndTargetContentIsNotNullAndReturnsResult()
Definition: FileNodeTest.php:400
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:51
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:24
‪TYPO3\CMS\Install\FolderStructure\NodeInterface
Definition: NodeInterface.php:24
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsTargetContent
‪constructorSetsTargetContent()
Definition: FileNodeTest.php:121
‪TYPO3\CMS\Install\FolderStructure\Exception
Definition: InvalidArgumentException.php:16
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixCallsFixSelfAndReturnsItsResult
‪fixCallsFixSelfAndReturnsItsResult()
Definition: FileNodeTest.php:361
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static getUniqueId(string $prefix='')
Definition: StringUtility.php:57
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentThrowsExceptionIfTargetContentIsNull
‪setContentThrowsExceptionIfTargetContentIsNull()
Definition: FileNodeTest.php:652