‪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 
20 use PHPUnit\Framework\Attributes\Test;
31 
33 {
34  #[Test]
36  {
37  $this->expectException(InvalidArgumentException::class);
38  $this->expectExceptionCode(1366927513);
39  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
40  $node->__construct([], null);
41  }
42 
43  #[Test]
45  {
46  $this->expectException(InvalidArgumentException::class);
47  $this->expectExceptionCode(1366222207);
48  $parent = $this->createMock(NodeInterface::class);
49  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
50  $structure = [
51  'name' => 'foo/bar',
52  ];
53  $node->__construct($structure, $parent);
54  }
55 
56  #[Test]
57  public function ‪constructorSetsParent(): void
58  {
59  $parent = $this->createMock(NodeInterface::class);
60  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
61  $structure = [
62  'name' => 'foo',
63  ];
64  $node->__construct($structure, $parent);
65  self::assertSame($parent, $node->_call('getParent'));
66  }
67 
68  #[Test]
69  public function ‪constructorSetsTargetPermission(): void
70  {
71  $parent = $this->createMock(NodeInterface::class);
72  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
73  $targetPermission = '0660';
74  $structure = [
75  'name' => 'foo',
76  'targetPermission' => $targetPermission,
77  ];
78  $node->__construct($structure, $parent);
79  self::assertSame($targetPermission, $node->_call('getTargetPermission'));
80  }
81 
82  #[Test]
83  public function ‪constructorSetsName(): void
84  {
85  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
86  $parent = $this->createMock(RootNodeInterface::class);
87  $name = ‪StringUtility::getUniqueId('test_');
88  $node->__construct(['name' => $name], $parent);
89  self::assertSame($name, $node->getName());
90  }
91 
92  #[Test]
94  {
95  $this->expectException(InvalidArgumentException::class);
96  $this->expectExceptionCode(1380364361);
97  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
98  $parent = $this->createMock(RootNodeInterface::class);
99  $structure = [
100  'name' => 'foo',
101  'targetContent' => 'foo',
102  'targetContentFile' => 'aPath',
103  ];
104  $node->__construct($structure, $parent);
105  }
106 
107  #[Test]
108  public function ‪constructorSetsTargetContent(): void
109  {
110  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
111  $parent = $this->createMock(RootNodeInterface::class);
112  $targetContent = ‪StringUtility::getUniqueId('content_');
113  $structure = [
114  'name' => 'foo',
115  'targetContent' => $targetContent,
116  ];
117  $node->__construct($structure, $parent);
118  self::assertSame($targetContent, $node->_get('targetContent'));
119  }
120 
121  #[Test]
123  {
124  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
125  $parent = $this->createMock(RootNodeInterface::class);
126  $targetFile = $this->‪getTestFilePath('test_');
127  $targetContent = ‪StringUtility::getUniqueId('content_');
128  file_put_contents($targetFile, $targetContent);
129  $structure = [
130  'name' => 'foo',
131  'targetContentFile' => $targetFile,
132  ];
133  $node->__construct($structure, $parent);
134  self::assertSame($targetContent, $node->_get('targetContent'));
135  }
136 
137  #[Test]
139  {
140  $this->expectException(InvalidArgumentException::class);
141  $this->expectExceptionCode(1380364362);
142  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
143  $parent = $this->createMock(RootNodeInterface::class);
144  $targetFile = $this->‪getTestFilePath('test_');
145  $structure = [
146  'name' => 'foo',
147  'targetContentFile' => $targetFile,
148  ];
149  $node->__construct($structure, $parent);
150  }
151 
152  #[Test]
153  public function ‪targetContentIsNullIfNotGiven(): void
154  {
155  $node = $this->getAccessibleMock(FileNode::class, null, [], '', false);
156  $parent = $this->createMock(RootNodeInterface::class);
157  $structure = [
158  'name' => 'foo',
159  ];
160  $node->__construct($structure, $parent);
161  self::assertNull($node->_get('targetContent'));
162  }
163 
164  #[Test]
165  public function ‪getStatusReturnsArray(): void
166  {
167  $node = $this->getAccessibleMock(
168  FileNode::class,
169  ['getAbsolutePath', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
170  [],
171  '',
172  false
173  );
174  // do not use var path here, as file nodes explicitly check for public path
175  $testRoot = ‪Environment::getPublicPath() . '/typo3temp/tests/';
176  $this->testFilesToDelete[] = $testRoot;
178  $path = $testRoot . ‪StringUtility::getUniqueId('dir_');
179  $node->method('getAbsolutePath')->willReturn($path);
180  $node->method('exists')->willReturn(true);
181  $node->method('isFile')->willReturn(true);
182  $node->method('isPermissionCorrect')->willReturn(true);
183  $node->method('isWritable')->willReturn(true);
184  $node->method('isContentCorrect')->willReturn(true);
185  self::assertIsArray($node->getStatus());
186  }
187 
188  #[Test]
190  {
191  $node = $this->getAccessibleMock(
192  FileNode::class,
193  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
194  [],
195  '',
196  false
197  );
198  $path = $this->‪getTestDirectory('dir_');
199  $node->method('getAbsolutePath')->willReturn($path);
200  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
201  $node->method('exists')->willReturn(false);
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  $statusArray = $node->getStatus();
207  self::assertSame(ContextualFeedbackSeverity::WARNING, $statusArray[0]->getSeverity());
208  }
209 
210  #[Test]
212  {
213  $node = $this->getAccessibleMock(
214  FileNode::class,
215  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
216  [],
217  '',
218  false
219  );
220  $path = $this->‪getTestFilePath('dir_');
221  touch($path);
222  $node->method('getAbsolutePath')->willReturn($path);
223  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
224  $node->method('exists')->willReturn(true);
225  $node->method('isFile')->willReturn(false);
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::ERROR, $statusArray[0]->getSeverity());
231  }
232 
233  #[Test]
235  {
236  $node = $this->getAccessibleMock(
237  FileNode::class,
238  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
239  [],
240  '',
241  false
242  );
243  $path = $this->‪getTestFilePath('dir_');
244  touch($path);
245  $node->method('getAbsolutePath')->willReturn($path);
246  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
247  $node->method('exists')->willReturn(true);
248  $node->method('isFile')->willReturn(true);
249  $node->method('isPermissionCorrect')->willReturn(true);
250  $node->method('isWritable')->willReturn(false);
251  $node->method('isContentCorrect')->willReturn(true);
252  $statusArray = $node->getStatus();
253  self::assertSame(ContextualFeedbackSeverity::NOTICE, $statusArray[0]->getSeverity());
254  }
255 
256  #[Test]
258  {
259  $node = $this->getAccessibleMock(
260  FileNode::class,
261  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
262  [],
263  '',
264  false
265  );
266  $path = $this->‪getTestFilePath('dir_');
267  touch($path);
268  $node->method('getAbsolutePath')->willReturn($path);
269  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
270  $node->method('exists')->willReturn(true);
271  $node->method('isFile')->willReturn(true);
272  $node->method('isPermissionCorrect')->willReturn(false);
273  $node->method('isWritable')->willReturn(true);
274  $node->method('isContentCorrect')->willReturn(true);
275  $statusArray = $node->getStatus();
276  self::assertSame(ContextualFeedbackSeverity::NOTICE, $statusArray[0]->getSeverity());
277  }
278 
279  #[Test]
281  {
282  $node = $this->getAccessibleMock(
283  FileNode::class,
284  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
285  [],
286  '',
287  false
288  );
289  $path = $this->‪getTestFilePath('dir_');
290  touch($path);
291  $node->method('getAbsolutePath')->willReturn($path);
292  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
293  $node->method('exists')->willReturn(true);
294  $node->method('isFile')->willReturn(true);
295  $node->method('isPermissionCorrect')->willReturn(true);
296  $node->method('isWritable')->willReturn(true);
297  $node->method('isContentCorrect')->willReturn(false);
298  $statusArray = $node->getStatus();
299  self::assertSame(ContextualFeedbackSeverity::NOTICE, $statusArray[0]->getSeverity());
300  }
301 
302  #[Test]
304  {
305  $node = $this->getAccessibleMock(
306  FileNode::class,
307  ['getAbsolutePath', 'getRelativePathBelowSiteRoot', 'exists', 'isFile', 'isWritable', 'isPermissionCorrect', 'isContentCorrect'],
308  [],
309  '',
310  false
311  );
312  $path = $this->‪getTestFilePath('dir_');
313  touch($path);
314  $node->method('getAbsolutePath')->willReturn($path);
315  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
316  $node->method('exists')->willReturn(true);
317  $node->method('isFile')->willReturn(true);
318  $node->method('isPermissionCorrect')->willReturn(true);
319  $node->method('isWritable')->willReturn(true);
320  $node->method('isContentCorrect')->willReturn(true);
321  $statusArray = $node->getStatus();
322  self::assertSame(ContextualFeedbackSeverity::OK, $statusArray[0]->getSeverity());
323  }
324 
325  #[Test]
327  {
328  $node = $this->getAccessibleMock(
329  FileNode::class,
330  ['fixSelf'],
331  [],
332  '',
333  false
334  );
335  $uniqueReturn = [‪StringUtility::getUniqueId('foo_')];
336  $node->expects(self::once())->method('fixSelf')->willReturn($uniqueReturn);
337  self::assertSame($uniqueReturn, $node->fix());
338  }
339 
340  #[Test]
342  {
343  $node = $this->getAccessibleMock(
344  FileNode::class,
345  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
346  [],
347  '',
348  false
349  );
350  $node->method('exists')->willReturn(false);
351  $node->method('isFile')->willReturn(true);
352  $node->method('isPermissionCorrect')->willReturn(true);
353  $message = new ‪FlashMessage('foo');
354  $node->expects(self::once())->method('createFile')->willReturn($message);
355  $actualReturn = $node->_call('fixSelf');
356  $actualReturn = $actualReturn[0];
357  self::assertSame($message, $actualReturn);
358  }
359 
360  #[Test]
362  {
363  $node = $this->getAccessibleMock(
364  FileNode::class,
365  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
366  [],
367  '',
368  false
369  );
370  $node->method('exists')->willReturn(false);
371  $node->method('isFile')->willReturn(true);
372  $node->method('isPermissionCorrect')->willReturn(true);
373  $message1 = new ‪FlashMessage('foo');
374  $node->method('createFile')->willReturn($message1);
375  $node->_set('targetContent', 'foo');
376  $message2 = new ‪FlashMessage('foo');
377  $node->expects(self::once())->method('setContent')->willReturn($message2);
378  $actualReturn = $node->_call('fixSelf');
379  $actualReturn = $actualReturn[1];
380  self::assertSame($message2, $actualReturn);
381  }
382 
383  #[Test]
385  {
386  $node = $this->getAccessibleMock(
387  FileNode::class,
388  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
389  [],
390  '',
391  false
392  );
393  $node->method('exists')->willReturn(false);
394  $node->method('isFile')->willReturn(true);
395  $node->method('isPermissionCorrect')->willReturn(true);
396  $message = new ‪FlashMessage('foo', '', ContextualFeedbackSeverity::ERROR);
397  $node->method('createFile')->willReturn($message);
398  $node->_set('targetContent', 'foo');
399  $node->expects(self::never())->method('setContent');
400  $node->_call('fixSelf');
401  }
402 
403  #[Test]
405  {
406  $node = $this->getAccessibleMock(
407  FileNode::class,
408  ['exists', 'createFile', 'setContent', 'getAbsolutePath', 'isFile', 'isPermissionCorrect'],
409  [],
410  '',
411  false
412  );
413  $node->method('exists')->willReturn(false);
414  $node->method('isFile')->willReturn(true);
415  $node->method('isPermissionCorrect')->willReturn(true);
416  $message = new ‪FlashMessage('foo');
417  $node->method('createFile')->willReturn($message);
418  $node->_set('targetContent', null);
419  $node->expects(self::never())->method('setContent');
420  $node->_call('fixSelf');
421  }
422 
423  #[Test]
425  {
426  $node = $this->getAccessibleMock(
427  FileNode::class,
428  ['exists', 'createFile', 'getAbsolutePath', 'isFile', 'isPermissionCorrect', 'fixPermission'],
429  [],
430  '',
431  false
432  );
433  $node->method('exists')->willReturn(true);
434  $node->method('isFile')->willReturn(true);
435  $node->method('isPermissionCorrect')->willReturn(false);
436  $message = new ‪FlashMessage('foo');
437  $node->expects(self::once())->method('fixPermission')->willReturn($message);
438  self::assertSame([$message], $node->_call('fixSelf'));
439  }
440 
441  #[Test]
443  {
444  $node = $this->getAccessibleMock(
445  FileNode::class,
446  ['exists', 'createFile', 'getAbsolutePath', 'isFile', 'isPermissionCorrect', 'getRelativePathBelowSiteRoot'],
447  [],
448  '',
449  false
450  );
451  $node->method('exists')->willReturn(true);
452  $node->expects(self::once())->method('isFile')->willReturn(false);
453  $node->method('isPermissionCorrect')->willReturn(true);
454  $node->_call('fixSelf');
455  }
456 
457  #[Test]
459  {
460  $node = $this->getAccessibleMock(
461  FileNode::class,
462  ['exists', 'isFile', 'isPermissionCorrect'],
463  [],
464  '',
465  false
466  );
467  $node->method('exists')->willReturn(true);
468  $node->method('isFile')->willReturn(true);
469  $node->method('isPermissionCorrect')->willReturn(true);
470  self::assertIsArray($node->_call('fixSelf'));
471  }
472 
473  #[Test]
475  {
476  $this->expectException(Exception::class);
477  $this->expectExceptionCode(1366398198);
478  $node = $this->getAccessibleMock(FileNode::class, ['exists', 'getAbsolutePath'], [], '', false);
479  $node->expects(self::once())->method('getAbsolutePath')->willReturn('');
480  $node->expects(self::once())->method('exists')->willReturn(true);
481  $node->_call('createFile');
482  }
483 
484  #[Test]
486  {
487  $node = $this->getAccessibleMock(FileNode::class, ['exists', 'getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
488  $path = $this->‪getTestFilePath('file_');
489  $node->expects(self::once())->method('exists')->willReturn(false);
490  $node->method('getAbsolutePath')->willReturn($path);
491  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
492  self::assertSame(ContextualFeedbackSeverity::OK, $node->_call('createFile')->getSeverity());
493  }
494 
495  #[Test]
496  public function ‪createFileCreatesFile(): void
497  {
498  $node = $this->getAccessibleMock(FileNode::class, ['exists', 'getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
499  $path = $this->‪getTestFilePath('file_');
500  $node->expects(self::once())->method('exists')->willReturn(false);
501  $node->method('getAbsolutePath')->willReturn($path);
502  $node->method('getRelativePathBelowSiteRoot')->willReturn($path);
503  $node->_call('createFile');
504  self::assertTrue(is_file($path));
505  }
506 
507  #[Test]
509  {
510  $this->expectException(Exception::class);
511  $this->expectExceptionCode(1367056363);
512  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
513  $path = $this->‪getTestDirectory('dir_');
514  $node->method('getAbsolutePath')->willReturn($path);
515  $node->_call('isContentCorrect');
516  }
517 
518  #[Test]
520  {
521  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
522  $path = $this->‪getTestFilePath('file_');
523  touch($path);
524  $node->method('getAbsolutePath')->willReturn($path);
525  $node->_set('targetContent', null);
526  self::assertTrue($node->_call('isContentCorrect'));
527  }
528 
529  #[Test]
531  {
532  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
533  $path = $this->‪getTestFilePath('file_');
534  $content = ‪StringUtility::getUniqueId('content_');
535  file_put_contents($path, $content);
536  $node->method('getAbsolutePath')->willReturn($path);
537  $node->_set('targetContent', $content);
538  self::assertTrue($node->_call('isContentCorrect'));
539  }
540 
541  #[Test]
543  {
544  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
545  $path = $this->‪getTestFilePath('file_');
546  $content = ‪StringUtility::getUniqueId('content1_');
547  $targetContent = ‪StringUtility::getUniqueId('content2_');
548  file_put_contents($path, $content);
549  $node->method('getAbsolutePath')->willReturn($path);
550  $node->_set('targetContent', $targetContent);
551  self::assertFalse($node->_call('isContentCorrect'));
552  }
553 
554  #[Test]
556  {
557  $parent = $this->createMock(NodeInterface::class);
558  $node = $this->getAccessibleMock(FileNode::class, ['getCurrentPermission', 'isWindowsOs'], [], '', false);
559  $node->method('isWindowsOs')->willReturn(false);
560  $node->method('getCurrentPermission')->willReturn('0664');
561  $targetPermission = '0664';
562  $structure = [
563  'name' => 'foo',
564  'targetPermission' => $targetPermission,
565  ];
566  $node->__construct($structure, $parent);
567  self::assertTrue($node->_call('isPermissionCorrect'));
568  }
569 
570  #[Test]
572  {
573  $this->expectException(Exception::class);
574  $this->expectExceptionCode(1367060201);
575  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
576  $path = $this->‪getTestDirectory('dir_');
577  $node->method('getAbsolutePath')->willReturn($path);
578  $node->_set('targetContent', 'foo');
579  $node->_call('setContent');
580  }
581 
582  #[Test]
584  {
585  $this->expectException(Exception::class);
586  $this->expectExceptionCode(1367060202);
587  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
588  $path = $this->‪getTestFilePath('file_');
589  touch($path);
590  $node->method('getAbsolutePath')->willReturn($path);
591  $node->_set('targetContent', null);
592  $node->_call('setContent');
593  }
594 
595  #[Test]
596  public function ‪setContentSetsContentToFile(): void
597  {
598  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
599  $path = $this->‪getTestFilePath('file_');
600  touch($path);
601  $node->method('getAbsolutePath')->willReturn($path);
602  $targetContent = ‪StringUtility::getUniqueId('content_');
603  $node->_set('targetContent', $targetContent);
604  $node->_call('setContent');
605  $resultContent = file_get_contents($path);
606  self::assertSame($targetContent, $resultContent);
607  }
608 
609  #[Test]
611  {
612  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
613  $path = $this->‪getTestFilePath('file_');
614  touch($path);
615  $node->method('getAbsolutePath')->willReturn($path);
616  $targetContent = ‪StringUtility::getUniqueId('content_');
617  $node->_set('targetContent', $targetContent);
618  self::assertSame(ContextualFeedbackSeverity::OK, $node->_call('setContent')->getSeverity());
619  }
620 
621  #[Test]
622  public function ‪isFileReturnsTrueIfNameIsFile(): void
623  {
624  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath', 'getRelativePathBelowSiteRoot'], [], '', false);
625  $path = $this->‪getTestFilePath('file_');
626  touch($path);
627  $node->method('getAbsolutePath')->willReturn($path);
628  self::assertTrue($node->_call('isFile'));
629  }
630 
631  #[Test]
633  {
634  $node = $this->getAccessibleMock(FileNode::class, ['getAbsolutePath'], [], '', false);
635  // do not use var path here, as file nodes explicitly check for public path
636  $testRoot = ‪Environment::getPublicPath() . '/typo3temp/tests/';
637  $path = $testRoot . ‪StringUtility::getUniqueId('root_');
638  $this->testFilesToDelete[] = $testRoot;
640  $link = ‪StringUtility::getUniqueId('link_');
641  $file = ‪StringUtility::getUniqueId('file_');
642  touch($path . '/' . $file);
643  symlink($path . '/' . $file, $path . '/' . $link);
644  $node->method('getAbsolutePath')->willReturn($path . '/' . $link);
645  self::assertFalse($node->_call('isFile'));
646  }
647 }
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithNoticeStatusIfFileExistsButContentIsNotCorrect
‪getStatusReturnsArrayWithNoticeStatusIfFileExistsButContentIsNotCorrect()
Definition: FileNodeTest.php:280
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest
Definition: FileNodeTest.php:33
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileReturnsOkStatusIfFileWasCreated
‪createFileReturnsOkStatusIfFileWasCreated()
Definition: FileNodeTest.php:485
‪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:404
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileCreatesFile
‪createFileCreatesFile()
Definition: FileNodeTest.php:496
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayNoticeStatusIfFileExistsButIsNotWritable
‪getStatusReturnsArrayNoticeStatusIfFileExistsButIsNotWritable()
Definition: FileNodeTest.php:234
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentReturnsOkStatusIfContentWasSuccessfullySet
‪setContentReturnsOkStatusIfContentWasSuccessfullySet()
Definition: FileNodeTest.php:610
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentSetsContentToFile
‪setContentSetsContentToFile()
Definition: FileNodeTest.php:596
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\setContentThrowsExceptionIfTargetIsNotAFile
‪setContentThrowsExceptionIfTargetIsNotAFile()
Definition: FileNodeTest.php:571
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfReturnsArrayOfStatusMessages
‪fixSelfReturnsArrayOfStatusMessages()
Definition: FileNodeTest.php:458
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static getPublicPath()
Definition: Environment.php:187
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsTrueIfTargetContentEqualsCurrentContent
‪isContentCorrectReturnsTrueIfTargetContentEqualsCurrentContent()
Definition: FileNodeTest.php:530
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithWarningStatusIFileNotExists
‪getStatusReturnsArrayWithWarningStatusIFileNotExists()
Definition: FileNodeTest.php:189
‪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:303
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\createFileThrowsExceptionIfNodeExists
‪createFileThrowsExceptionIfNodeExists()
Definition: FileNodeTest.php:474
‪TYPO3\CMS\Install\FolderStructure\RootNodeInterface
Definition: RootNodeInterface.php:21
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArray
‪getStatusReturnsArray()
Definition: FileNodeTest.php:165
‪TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep
‪static mkdir_deep(string $directory)
Definition: GeneralUtility.php:1654
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithNoticeStatusIfFileExistsButPermissionAreNotCorrect
‪getStatusReturnsArrayWithNoticeStatusIfFileExistsButPermissionAreNotCorrect()
Definition: FileNodeTest.php:257
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsParent
‪constructorSetsParent()
Definition: FileNodeTest.php:57
‪TYPO3\CMS\Core\Type\ContextualFeedbackSeverity
‪ContextualFeedbackSeverity
Definition: ContextualFeedbackSeverity.php:25
‪TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
Definition: InvalidArgumentException.php:23
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\AbstractFolderStructureTestCase
Definition: AbstractFolderStructureTestCase.php:26
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfNameContainsForwardSlash
‪constructorThrowsExceptionIfNameContainsForwardSlash()
Definition: FileNodeTest.php:44
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure
Definition: AbstractFolderStructureTestCase.php:18
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfCallsCreateFileIfFileDoesNotExistAndReturnsResult
‪fixSelfCallsCreateFileIfFileDoesNotExistAndReturnsResult()
Definition: FileNodeTest.php:341
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsTargetPermission
‪constructorSetsTargetPermission()
Definition: FileNodeTest.php:69
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isPermissionCorrectReturnsTrueIfTargetPermissionAndCurrentPermissionAreIdentical
‪isPermissionCorrectReturnsTrueIfTargetPermissionAndCurrentPermissionAreIdentical()
Definition: FileNodeTest.php:555
‪TYPO3\CMS\Install\FolderStructure\FileNode
Definition: FileNode.php:27
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isFileReturnsTrueIfNameIsFile
‪isFileReturnsTrueIfNameIsFile()
Definition: FileNodeTest.php:622
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfDoesNotCallSetContentIfFileCreationFailed
‪fixSelfDoesNotCallSetContentIfFileCreationFailed()
Definition: FileNodeTest.php:384
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectThrowsExceptionIfTargetIsNotAFile
‪isContentCorrectThrowsExceptionIfTargetIsNotAFile()
Definition: FileNodeTest.php:508
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\getStatusReturnsArrayWithErrorStatusIfNodeIsNotAFile
‪getStatusReturnsArrayWithErrorStatusIfNodeIsNotAFile()
Definition: FileNodeTest.php:211
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsTrueIfTargetContentPropertyIsNull
‪isContentCorrectReturnsTrueIfTargetContentPropertyIsNull()
Definition: FileNodeTest.php:519
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfCallsFixPermissionIfFileExistsButPermissionAreWrong
‪fixSelfCallsFixPermissionIfFileExistsButPermissionAreWrong()
Definition: FileNodeTest.php:442
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\targetContentIsNullIfNotGiven
‪targetContentIsNullIfNotGiven()
Definition: FileNodeTest.php:153
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfReturnsErrorStatusIfNodeExistsButIsNotAFileAndReturnsResult
‪fixSelfReturnsErrorStatusIfNodeExistsButIsNotAFileAndReturnsResult()
Definition: FileNodeTest.php:424
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isContentCorrectReturnsFalseIfTargetContentNotEqualsCurrentContent
‪isContentCorrectReturnsFalseIfTargetContentNotEqualsCurrentContent()
Definition: FileNodeTest.php:542
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\isFileReturnsFalseIfNameIsALinkFile
‪isFileReturnsFalseIfNameIsALinkFile()
Definition: FileNodeTest.php:632
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:27
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfBothTargetContentAndTargetContentFileAreSet
‪constructorThrowsExceptionIfBothTargetContentAndTargetContentFileAreSet()
Definition: FileNodeTest.php:93
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:41
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfParentIsNull
‪constructorThrowsExceptionIfParentIsNull()
Definition: FileNodeTest.php:35
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsTargetContentToContentOfTargetContentFile
‪constructorSetsTargetContentToContentOfTargetContentFile()
Definition: FileNodeTest.php:122
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorSetsName
‪constructorSetsName()
Definition: FileNodeTest.php:83
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\constructorThrowsExceptionIfTargetContentFileDoesNotExist
‪constructorThrowsExceptionIfTargetContentFileDoesNotExist()
Definition: FileNodeTest.php:138
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixSelfCallsSetsContentIfFileCreationWasSuccessfulAndTargetContentIsNotNullAndReturnsResult
‪fixSelfCallsSetsContentIfFileCreationWasSuccessfulAndTargetContentIsNotNullAndReturnsResult()
Definition: FileNodeTest.php:361
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪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:108
‪TYPO3\CMS\Install\FolderStructure\Exception
Definition: InvalidArgumentException.php:16
‪TYPO3\CMS\Install\Tests\Unit\FolderStructure\FileNodeTest\fixCallsFixSelfAndReturnsItsResult
‪fixCallsFixSelfAndReturnsItsResult()
Definition: FileNodeTest.php:326
‪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:583