ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\GlobalScreen\MainMenu\FactoryImplTest Class Reference

Class FactoryImplTest. More...

+ Inheritance diagram for ILIAS\GlobalScreen\MainMenu\FactoryImplTest:
+ Collaboration diagram for ILIAS\GlobalScreen\MainMenu\FactoryImplTest:

Public Member Functions

 testAvailableMethods ()
 
 testInterchangeableContraints ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $id
 
 $provider
 
 $identification
 
 $factory
 

Detailed Description

Class FactoryImplTest.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 38 of file FactoryImplTest.php.

Member Function Documentation

◆ setUp()

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::setUp ( )
protected

Definition at line 61 of file FactoryImplTest.php.

61  : void
62  {
63  parent::setUp();
64 
65  $this->identification = new IdentificationFactory(new NullProviderFactory());
66  $this->provider = $this->getMockBuilder(StaticMainMenuProvider::class)->getMock();
67 
68  $this->id = $this->identification->core($this->provider)->identifier('dummy');
69 
70  $this->factory = new MainMenuItemFactory();
71  }

◆ testAvailableMethods()

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::testAvailableMethods ( )

Definition at line 74 of file FactoryImplTest.php.

74  : void
75  {
76  $r = new ReflectionClass($this->factory);
77 
78  $methods = [];
79  foreach ($r->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
80  $methods[] = $method->getName();
81  }
82  sort($methods);
83  $this->assertEquals(
84  [
85  0 => 'complex',
86  1 => 'custom',
87  2 => 'link',
88  3 => 'linkList',
89  4 => 'repositoryLink',
90  5 => 'separator',
91  6 => 'topLinkItem',
92  7 => 'topParentItem',
93  ],
94  $methods
95  );
96  }

◆ testInterchangeableContraints()

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::testInterchangeableContraints ( )

Definition at line 99 of file FactoryImplTest.php.

99  : void
100  {
101  $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->topLinkItem($this->id));
102  $this->assertNotInstanceOf(isInterchangeableItem::class, $this->factory->topParentItem($this->id));
103  $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->complex($this->id));
104  $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->link($this->id));
105  $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->repositoryLink($this->id));
106  $this->assertNotInstanceOf(isInterchangeableItem::class, $this->factory->separator($this->id));
107  }

Field Documentation

◆ $factory

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$factory
protected

Definition at line 55 of file FactoryImplTest.php.

◆ $id

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$id
protected

Definition at line 43 of file FactoryImplTest.php.

◆ $identification

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$identification
protected

Definition at line 51 of file FactoryImplTest.php.

◆ $provider

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$provider
protected

Definition at line 47 of file FactoryImplTest.php.


The documentation for this class was generated from the following file: