‪TYPO3CMS  10.4
BackendLayoutTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Prophecy\Argument;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
28 class ‪BackendLayoutTest extends UnitTestCase
29 {
30  protected ‪$resetSingletonInstances = true;
31 
36  {
37  $this->expectException(\UnexpectedValueException::class);
38  $this->expectExceptionCode(1381597630);
39  $identifier = ‪StringUtility::getUniqueId('identifier__');
40  $title = ‪StringUtility::getUniqueId('title');
41  $configuration = ‪StringUtility::getUniqueId('configuration');
42  new ‪BackendLayout($identifier, $title, $configuration);
43  }
44 
48  public function ‪objectIsCreated()
49  {
50  $backendLayoutView = $this->prophesize(BackendLayoutView::class);
51  $backendLayoutView->parseStructure(Argument::any())->willReturn([]);
52  GeneralUtility::setSingletonInstance(BackendLayoutView::class, $backendLayoutView->reveal());
53 
54  $identifier = ‪StringUtility::getUniqueId('identifier');
55  $title = ‪StringUtility::getUniqueId('title');
56  $configuration = ‪StringUtility::getUniqueId('configuration');
57  $backendLayout = new ‪BackendLayout($identifier, $title, $configuration);
58 
59  self::assertEquals($identifier, $backendLayout->getIdentifier());
60  self::assertEquals($title, $backendLayout->getTitle());
61  self::assertEquals($configuration, $backendLayout->getConfiguration());
62  }
63 }
‪TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout\BackendLayoutTest\$resetSingletonInstances
‪$resetSingletonInstances
Definition: BackendLayoutTest.php:30
‪TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout\BackendLayoutTest\objectIsCreated
‪objectIsCreated()
Definition: BackendLayoutTest.php:48
‪TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout
Definition: BackendLayoutCollectionTest.php:16
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:92
‪TYPO3\CMS\Backend\View\BackendLayoutView
Definition: BackendLayoutView.php:36
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout
Definition: BackendLayout.php:25
‪TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout\BackendLayoutTest\invalidIdentifierIsRecognizedOnCreation
‪invalidIdentifierIsRecognizedOnCreation()
Definition: BackendLayoutTest.php:35
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout\BackendLayoutTest
Definition: BackendLayoutTest.php:29