TYPO3 CMS  TYPO3_6-2
BackendLayoutCollectionTest.php
Go to the documentation of this file.
1 <?php
3 
23 
29  $identifier = $this->getUniqueId('identifier__');
30  new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
31  }
32 
36  public function objectIsCreated() {
37  $identifier = $this->getUniqueId('identifier');
38  $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
39 
40  $this->assertEquals($identifier, $backendLayoutCollection->getIdentifier());
41  }
42 
48  $identifier = $this->getUniqueId('identifier');
49  $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
50  $backendLayoutIdentifier = $this->getUniqueId('identifier__');
51  $backendLayoutMock = $this->getMock('TYPO3\\CMS\\Backend\\View\\BackendLayout\\BackendLayout', array('getIdentifier'), array(), '', FALSE);
52  $backendLayoutMock->expects($this->once())->method('getIdentifier')->will($this->returnValue($backendLayoutIdentifier));
53 
54  $backendLayoutCollection->add($backendLayoutMock);
55  }
56 
62  $identifier = $this->getUniqueId('identifier');
63  $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
64  $backendLayoutIdentifier = $this->getUniqueId('identifier');
65  $firstBackendLayoutMock = $this->getMock('TYPO3\\CMS\\Backend\\View\\BackendLayout\\BackendLayout', array('getIdentifier'), array(), '', FALSE);
66  $firstBackendLayoutMock->expects($this->once())->method('getIdentifier')->will($this->returnValue($backendLayoutIdentifier));
67  $secondBackendLayoutMock = $this->getMock('TYPO3\\CMS\\Backend\\View\\BackendLayout\\BackendLayout', array('getIdentifier'), array(), '', FALSE);
68  $secondBackendLayoutMock->expects($this->once())->method('getIdentifier')->will($this->returnValue($backendLayoutIdentifier));
69 
70  $backendLayoutCollection->add($firstBackendLayoutMock);
71  $backendLayoutCollection->add($secondBackendLayoutMock);
72  }
73 
77  public function backendLayoutCanBeFetched() {
78  $identifier = $this->getUniqueId('identifier');
79  $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
80  $backendLayoutIdentifier = $this->getUniqueId('identifier');
81  $backendLayoutMock = $this->getMock('TYPO3\\CMS\\Backend\\View\\BackendLayout\\BackendLayout', array('getIdentifier'), array(), '', FALSE);
82  $backendLayoutMock->expects($this->once())->method('getIdentifier')->will($this->returnValue($backendLayoutIdentifier));
83 
84  $backendLayoutCollection->add($backendLayoutMock);
85 
86  $this->assertEquals($backendLayoutMock, $backendLayoutCollection->get($backendLayoutIdentifier));
87  }
88 
89 }