‪TYPO3CMS  11.5
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 
35 {
40  {
41  $this->expectException(InvalidArgumentException::class);
42  $this->expectExceptionCode(1366927513);
43  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
44  $node->__construct([], null);
45  }
46 
51  {
52  $this->expectException(InvalidArgumentException::class);
53  $this->expectExceptionCode(1366222207);
54  $parent = $this->createMock(NodeInterface::class);
55  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
56  $structure = [
57  'name' => 'foo/bar',
58  ];
59  $node->__construct($structure, $parent);
60  }
61 
65  public function ‪constructorSetsParent(): void
66  {
67  $parent = $this->createMock(NodeInterface::class);
68  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
69  $structure = [
70  'name' => 'foo',
71  ];
72  $node->__construct($structure, $parent);
73  self::assertSame($parent, $node->_call('getParent'));
74  }
75 
79  public function ‪constructorSetsTargetPermission(): void
80  {
81  $parent = $this->createMock(NodeInterface::class);
82  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
83  $targetPermission = '0660';
84  $structure = [
85  'name' => 'foo',
86  'targetPermission' => $targetPermission,
87  ];
88  $node->__construct($structure, $parent);
89  self::assertSame($targetPermission, $node->_call('getTargetPermission'));
90  }
91 
95  public function ‪constructorSetsName(): void
96  {
97  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
98  $parent = $this->createMock(RootNodeInterface::class);
99  $name = ‪StringUtility::getUniqueId('test_');
100  $node->__construct(['name' => $name], $parent);
101  self::assertSame($name, $node->getName());
102  }
103 
108  {
109  $this->expectException(InvalidArgumentException::class);
110  $this->expectExceptionCode(1380364361);
111  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
112  $parent = $this->createMock(RootNodeInterface::class);
113  $structure = [
114  'name' => 'foo',
115  'targetContent' => 'foo',
116  'targetContentFile' => 'aPath',
117  ];
118  $node->__construct($structure, $parent);
119  }
120 
124  public function ‪constructorSetsTargetContent(): void
125  {
126  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
127  $parent = $this->createMock(RootNodeInterface::class);
128  $targetContent = ‪StringUtility::getUniqueId('content_');
129  $structure = [
130  'name' => 'foo',
131  'targetContent' => $targetContent,
132  ];
133  $node->__construct($structure, $parent);
134  self::assertSame($targetContent, $node->_get('targetContent'));
135  }
136 
141  {
142  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
143  $parent = $this->createMock(RootNodeInterface::class);
144  $targetFile = $this->‪getVirtualTestFilePath('test_');
145  $targetContent = ‪StringUtility::getUniqueId('content_');
146  file_put_contents($targetFile, $targetContent);
147  $structure = [
148  'name' => 'foo',
149  'targetContentFile' => $targetFile,
150  ];
151  $node->__construct($structure, $parent);
152  self::assertSame($targetContent, $node->_get('targetContent'));
153  }
154 
159  {
160  $this->expectException(InvalidArgumentException::class);
161  $this->expectExceptionCode(1380364362);
162  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
163  $parent = $this->createMock(RootNodeInterface::class);
164  $targetFile = $this->‪getVirtualTestFilePath('test_');
165  $structure = [
166  'name' => 'foo',
167  'targetContentFile' => $targetFile,
168  ];
169  $node->__construct($structure, $parent);
170  }
171 
175  public function ‪targetContentIsNullIfNotGiven(): void
176  {
177  $node = $this->getAccessibleMock(FileNode::class, ['dummy'], [], '', false);
178  $parent = $this->createMock(RootNodeInterface::class);
179  $structure = [
180  'name' => 'foo',
181  ];
182  $node->__construct($structure, $parent);
183  self::assertNull($node->_get('targetContent'));
184  }
185 
189  public function ‪getStatusReturnsArray(): void
190  {
191  $node = $this->getAccessibleMock(
192  FileNode::class,
193  ['getAbsolutePath', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
194  [],
195  '',
196  false
197  );
198  // do not use var path here, as file nodes explicitly check for public path
199  $path = ‪Environment::getPublicPath() . '/typo3temp/tests/' . ‪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->‪getVirtualTestDir('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(‪FlashMessage::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->‪getVirtualTestFilePath('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(‪FlashMessage::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->‪getVirtualTestFilePath('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(‪FlashMessage::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->‪getVirtualTestFilePath('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(‪FlashMessage::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->‪getVirtualTestFilePath('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(‪FlashMessage::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->‪getVirtualTestFilePath('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(‪FlashMessage::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', '', ‪FlashMessage::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->‪getVirtualTestFilePath('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(‪FlashMessage::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->‪getVirtualTestFilePath('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  $node = $this->getAccessibleMock(FileNode::class, ['exists', 'getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
568  $path = $this->‪getVirtualTestDir();
569  chmod($path, 02550);
570  $subPath = $path . '/' . ‪StringUtility::getUniqueId('file_');
571  $node->expects(self::once())->method('exists')->willReturn(false);
572  $node->method('getAbsolutePath')->willReturn($subPath);
573  $node->method('getRelativePathBelowSiteRoot')->willReturn($subPath);
574  self::assertSame(‪FlashMessage::ERROR, $node->_call('createFile')->getSeverity());
575  }
576 
581  {
582  $this->expectException(Exception::class);
583  $this->expectExceptionCode(1367056363);
584  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
585  $path = $this->‪getVirtualTestDir('dir_');
586  $node->method('getAbsolutePath')->willReturn($path);
587  $node->_call('isContentCorrect');
588  }
589 
594  {
595  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
596  $path = $this->‪getVirtualTestFilePath('file_');
597  touch($path);
598  $node->method('getAbsolutePath')->willReturn($path);
599  $node->_set('targetContent', null);
600  self::assertTrue($node->_call('isContentCorrect'));
601  }
602 
607  {
608  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
609  $path = $this->‪getVirtualTestFilePath('file_');
610  $content = ‪StringUtility::getUniqueId('content_');
611  file_put_contents($path, $content);
612  $node->method('getAbsolutePath')->willReturn($path);
613  $node->_set('targetContent', $content);
614  self::assertTrue($node->_call('isContentCorrect'));
615  }
616 
621  {
622  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
623  $path = $this->‪getVirtualTestFilePath('file_');
624  $content = ‪StringUtility::getUniqueId('content1_');
625  $targetContent = ‪StringUtility::getUniqueId('content2_');
626  file_put_contents($path, $content);
627  $node->method('getAbsolutePath')->willReturn($path);
628  $node->_set('targetContent', $targetContent);
629  self::assertFalse($node->_call('isContentCorrect'));
630  }
631 
636  {
637  $parent = $this->createMock(NodeInterface::class);
638  $node = $this->getAccessibleMock(FileNode::class, ['getCurrentPermission', 'isWindowsOs'], [], '', false);
639  $node->method('isWindowsOs')->willReturn(false);
640  $node->method('getCurrentPermission')->willReturn('0664');
641  $targetPermission = '0664';
642  $structure = [
643  'name' => 'foo',
644  'targetPermission' => $targetPermission,
645  ];
646  $node->__construct($structure, $parent);
647  self::assertTrue($node->_call('isPermissionCorrect'));
648  }
649 
654  {
655  $this->expectException(Exception::class);
656  $this->expectExceptionCode(1367060201);
657  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
658  $path = $this->‪getVirtualTestDir('dir_');
659  $node->method('getAbsolutePath')->willReturn($path);
660  $node->_set('targetContent', 'foo');
661  $node->_call('setContent');
662  }
663 
668  {
669  $this->expectException(Exception::class);
670  $this->expectExceptionCode(1367060202);
671  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
672  $path = $this->‪getVirtualTestFilePath('file_');
673  touch($path);
674  $node->method('getAbsolutePath')->willReturn($path);
675  $node->_set('targetContent', null);
676  $node->_call('setContent');
677  }
678 
682  public function ‪setContentSetsContentToFile(): void
683  {
684  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
685  $path = $this->‪getVirtualTestFilePath('file_');
686  touch($path);
687  $node->method('getAbsolutePath')->willReturn($path);
688  $targetContent = ‪StringUtility::getUniqueId('content_');
689  $node->_set('targetContent', $targetContent);
690  $node->_call('setContent');
691  $resultContent = file_get_contents($path);
692  self::assertSame($targetContent, $resultContent);
693  }
694 
699  {
700  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
701  $path = $this->‪getVirtualTestFilePath('file_');
702  touch($path);
703  $node->method('getAbsolutePath')->willReturn($path);
704  $targetContent = ‪StringUtility::getUniqueId('content_');
705  $node->_set('targetContent', $targetContent);
706  self::assertSame(‪FlashMessage::OK, $node->_call('setContent')->getSeverity());
707  }
708 
712  public function ‪isFileReturnsTrueIfNameIsFile(): void
713  {
714  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
715  $path = $this->‪getVirtualTestFilePath('file_');
716  touch($path);
717  $node->method('getAbsolutePath')->willReturn($path);
718  self::assertTrue($node->_call('isFile'));
719  }
720 
726  {
727  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
728  $path = ‪Environment::getVarPath() . '/tests/' . ‪StringUtility::getUniqueId('root_');
730  $this->testFilesToDelete[] = $path;
731  $link = ‪StringUtility::getUniqueId('link_');
732  $file = ‪StringUtility::getUniqueId('file_');
733  touch($path . '/' . $file);
734  symlink($path . '/' . $file, $path . '/' . $link);
735  $node->method('getAbsolutePath')->willReturn($path . '/' . $link);
736  self::assertFalse($node->_call('isFile'));
737  }
738 }
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithNoticeStatusIfFileExistsButContentIsNotCorrect
‪getStatusReturnsArrayWithNoticeStatusIfFileExistsButContentIsNotCorrect()
Definition: FileNodeTest.php:311
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest
Definition: FileNodeTest.php:35
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileReturnsOkStatusIfFileWasCreated
‪createFileReturnsOkStatusIfFileWasCreated()
Definition: FileNodeTest.php:538
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfDoesNotCallSetContentIfFileTargetContentIsNull
‪fixSelfDoesNotCallSetContentIfFileTargetContentIsNull()
Definition: FileNodeTest.php:447
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileReturnsErrorStatusIfFileWasNotCreated
‪createFileReturnsErrorStatusIfFileWasNotCreated()
Definition: FileNodeTest.php:565
‪TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase\getVirtualTestDir
‪string getVirtualTestDir($prefix='root_')
Definition: FolderStructureTestCase.php:36
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:206
‪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:698
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentSetsContentToFile
‪setContentSetsContentToFile()
Definition: FileNodeTest.php:682
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentThrowsExceptionIfTargetIsNotAFile
‪setContentThrowsExceptionIfTargetIsNotAFile()
Definition: FileNodeTest.php:653
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfReturnsArrayOfStatusMessages
‪fixSelfReturnsArrayOfStatusMessages()
Definition: FileNodeTest.php:507
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsTrueIfTargetContentEqualsCurrentContent
‪isContentCorrectReturnsTrueIfTargetContentEqualsCurrentContent()
Definition: FileNodeTest.php:606
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithWarningStatusIFileNotExists
‪getStatusReturnsArrayWithWarningStatusIFileNotExists()
Definition: FileNodeTest.php:212
‪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:21
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArray
‪getStatusReturnsArray()
Definition: FileNodeTest.php:189
‪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:65
‪TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
Definition: InvalidArgumentException.php:23
‪TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
‪const WARNING
Definition: AbstractMessage.php:30
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfNameContainsForwardSlash
‪constructorThrowsExceptionIfNameContainsForwardSlash()
Definition: FileNodeTest.php:50
‪TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep
‪static mkdir_deep($directory)
Definition: GeneralUtility.php:1908
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure
Definition: AbstractNodeTest.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:79
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isPermissionCorrectReturnsTrueIfTargetPermissionAndCurrentPermissionAreIdentical
‪isPermissionCorrectReturnsTrueIfTargetPermissionAndCurrentPermissionAreIdentical()
Definition: FileNodeTest.php:635
‪TYPO3\CMS\Install\FolderStructure\FileNode
Definition: FileNode.php:26
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isFileReturnsTrueIfNameIsFile
‪isFileReturnsTrueIfNameIsFile()
Definition: FileNodeTest.php:712
‪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:580
‪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:593
‪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:175
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfReturnsErrorStatusIfNodeExistsButIsNotAFileAndReturnsResult
‪fixSelfReturnsErrorStatusIfNodeExistsButIsNotAFileAndReturnsResult()
Definition: FileNodeTest.php:469
‪TYPO3\CMS\Core\Messaging\AbstractMessage\OK
‪const OK
Definition: AbstractMessage.php:29
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsFalseIfTargetContentNotEqualsCurrentContent
‪isContentCorrectReturnsFalseIfTargetContentNotEqualsCurrentContent()
Definition: FileNodeTest.php:620
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isFileReturnsFalseIfNameIsALinkFile
‪isFileReturnsFalseIfNameIsALinkFile()
Definition: FileNodeTest.php:725
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:128
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:26
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfBothTargetContentAndTargetContentFileAreSet
‪constructorThrowsExceptionIfBothTargetContentAndTargetContentFileAreSet()
Definition: FileNodeTest.php:107
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:43
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfParentIsNull
‪constructorThrowsExceptionIfParentIsNull()
Definition: FileNodeTest.php:39
‪TYPO3\CMS\Core\Messaging\AbstractMessage\NOTICE
‪const NOTICE
Definition: AbstractMessage.php:27
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsTargetContentToContentOfTargetContentFile
‪constructorSetsTargetContentToContentOfTargetContentFile()
Definition: FileNodeTest.php:140
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsName
‪constructorSetsName()
Definition: FileNodeTest.php:95
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfTargetContentFileDoesNotExist
‪constructorThrowsExceptionIfTargetContentFileDoesNotExist()
Definition: FileNodeTest.php:158
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfCallsSetsContentIfFileCreationWasSuccessfulAndTargetContentIsNotNullAndReturnsResult
‪fixSelfCallsSetsContentIfFileCreationWasSuccessfulAndTargetContentIsNotNullAndReturnsResult()
Definition: FileNodeTest.php:400
‪TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
Definition: FolderStructureTestCase.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Install\FolderStructure\NodeInterface
Definition: NodeInterface.php:24
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsTargetContent
‪constructorSetsTargetContent()
Definition: FileNodeTest.php:124
‪TYPO3\CMS\Install\FolderStructure\Exception
Definition: InvalidArgumentException.php:16
‪TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR
‪const ERROR
Definition: AbstractMessage.php:31
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixCallsFixSelfAndReturnsItsResult
‪fixCallsFixSelfAndReturnsItsResult()
Definition: FileNodeTest.php:361
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentThrowsExceptionIfTargetContentIsNull
‪setContentThrowsExceptionIfTargetContentIsNull()
Definition: FileNodeTest.php:667
‪TYPO3\CMS\Core\Core\Environment\getVarPath
‪static string getVarPath()
Definition: Environment.php:218
‪TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase\getVirtualTestFilePath
‪string getVirtualTestFilePath($prefix='file_')
Definition: FolderStructureTestCase.php:50