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