TYPO3 CMS  TYPO3_7-6
MenuContentObjectFactoryTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
24 {
30  {
31  $factory = new MenuContentObjectFactory;
32  $factory->getMenuObjectByType($this->getUniqueId('foo_'));
33  }
34 
39  {
40  $factory = new MenuContentObjectFactory;
41  $this->assertInternalType('object', $factory->getMenuObjectByType('GMENU'));
42  }
43 
48  {
49  $factory = new MenuContentObjectFactory;
50  $this->assertInternalType('object', $factory->getMenuObjectByType('gmenu'));
51  }
52 
57  {
58  $factory = new MenuContentObjectFactory;
59  $selfClassName = get_class($this);
60  $factory->registerMenuType('GMENU', $selfClassName);
61  $this->assertInstanceOf($selfClassName, $factory->getMenuObjectByType('GMENU'));
62  }
63 
68  {
69  $factory = new MenuContentObjectFactory;
70  $selfClassName = get_class($this);
71  $uniqueMenuType = $this->getUniqueId('foo_');
72  $factory->registerMenuType($uniqueMenuType, $selfClassName);
73  $this->assertInstanceOf($selfClassName, $factory->getMenuObjectByType($uniqueMenuType));
74  }
75 
81  {
82  $factory = new MenuContentObjectFactory;
83  $factory->registerMenuType([], 'foo');
84  }
85 
91  {
92  $factory = new MenuContentObjectFactory;
93  $factory->registerMenuType('foo', []);
94  }
95 }