ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPhantomJSRendererUiTest Class Reference
+ Inheritance diagram for ilPhantomJSRendererUiTest:
+ Collaboration diagram for ilPhantomJSRendererUiTest:

Public Member Functions

 __construct ()
 ilPhantomJSRenderer constructor. More...
 
 testBuildJavascriptDelayForm ()
 
 testBuildMarginForm ()
 
 testBuildFooterHeightForm ()
 
 testBuildFooterTextForm ()
 
 testBuildHeaderHeightForm ()
 
 testBuildHeaderTextForm ()
 
 testBuildHeaderPageNumbersForm ()
 
 testBuildFooterPageNumbersForm ()
 
 testBuildViewPortForm ()
 
 testBuildPageSizesForm ()
 
 testBuildOrientationForm ()
 

Static Public Member Functions

static callMethod ($obj, $name, array $args)
 

Protected Member Functions

 setUp ()
 
 setGlobalVariable ($name, $value)
 

Static Protected Member Functions

static getMethod ($name)
 

Protected Attributes

 $lng
 
 $form
 

Detailed Description

Definition at line 17 of file ilPhantomJSRendererUiTest.php.

Constructor & Destructor Documentation

◆ __construct()

ilPhantomJSRendererUiTest::__construct ( )

ilPhantomJSRenderer constructor.

Definition at line 48 of file ilPhantomJSRendererUiTest.php.

49  {
50  $this->lng = $this->getMockBuilder('ilLanguage')
51  ->disableOriginalConstructor()
52  ->getMock();
53  $this->lng->method('txt')
54  ->will($this->returnArgument(0));
55  }

Member Function Documentation

◆ callMethod()

static ilPhantomJSRendererUiTest::callMethod (   $obj,
  $name,
array  $args 
)
static

Definition at line 65 of file ilPhantomJSRendererUiTest.php.

References $name.

Referenced by setUp().

66  {
67  $class = new ReflectionClass($obj);
68  $method = $class->getMethod($name);
69  $method->setAccessible(true);
70  return $method->invokeArgs($obj, $args);
71  }
+ Here is the caller graph for this function:

◆ getMethod()

static ilPhantomJSRendererUiTest::getMethod (   $name)
staticprotected

Definition at line 57 of file ilPhantomJSRendererUiTest.php.

References $name.

58  {
59  $class = new ReflectionClass('ilPhantomJSRenderer');
60  $method = $class->getMethod($name);
61  $method->setAccessible(true);
62  return $method;
63  }

◆ setGlobalVariable()

ilPhantomJSRendererUiTest::setGlobalVariable (   $name,
  $value 
)
protected
Parameters
string$name
mixed$value

Definition at line 34 of file ilPhantomJSRendererUiTest.php.

References $c, $DIC, $GLOBALS, and $name.

Referenced by setUp().

35  {
36  global $DIC;
37 
38  $GLOBALS[$name] = $value;
39 
40  unset($DIC[$name]);
41  $DIC[$name] = function ($c) use ($name) {
42  return $GLOBALS[$name];
43  };
44  }
global $DIC
Definition: saml.php:7
$GLOBALS["DIC"]
+ Here is the caller graph for this function:

◆ setUp()

ilPhantomJSRendererUiTest::setUp ( )
protected

Definition at line 23 of file ilPhantomJSRendererUiTest.php.

References callMethod(), and setGlobalVariable().

24  {
25  $this->form = new ilPhantomJSRenderer(true);
26  $this->callMethod($this->form, 'setLanguage', array($this->lng));
27  $this->setGlobalVariable('lng', $this->lng);
28  $this->setGlobalVariable('ilCtrl', null);
29  }
static callMethod($obj, $name, array $args)
+ Here is the call graph for this function:

◆ testBuildFooterHeightForm()

ilPhantomJSRendererUiTest::testBuildFooterHeightForm ( )

Definition at line 89 of file ilPhantomJSRendererUiTest.php.

90  {
91  $transformer = self::getMethod('buildFooterHeightForm');
92  $this->assertInstanceOf('ilTextInputGUI', $transformer->invokeArgs($this->form, array()));
93  $this->assertSame('footer_height', $transformer->invokeArgs($this->form, array())->getTitle());
94  $this->assertSame('footer_height', $transformer->invokeArgs($this->form, array())->getPostVar());
95  }

◆ testBuildFooterPageNumbersForm()

ilPhantomJSRendererUiTest::testBuildFooterPageNumbersForm ( )

Definition at line 129 of file ilPhantomJSRendererUiTest.php.

130  {
131  $transformer = self::getMethod('buildFooterPageNumbersForm');
132  $this->assertInstanceOf('ilCheckboxInputGUI', $transformer->invokeArgs($this->form, array()));
133  $this->assertSame('footer_show_pages', $transformer->invokeArgs($this->form, array())->getTitle());
134  $this->assertSame('footer_show_pages', $transformer->invokeArgs($this->form, array())->getPostVar());
135  }

◆ testBuildFooterTextForm()

ilPhantomJSRendererUiTest::testBuildFooterTextForm ( )

Definition at line 97 of file ilPhantomJSRendererUiTest.php.

98  {
99  $transformer = self::getMethod('buildFooterTextForm');
100  $this->assertInstanceOf('ilTextInputGUI', $transformer->invokeArgs($this->form, array()));
101  $this->assertSame('footer_text', $transformer->invokeArgs($this->form, array())->getTitle());
102  $this->assertSame('footer_text', $transformer->invokeArgs($this->form, array())->getPostVar());
103  }

◆ testBuildHeaderHeightForm()

ilPhantomJSRendererUiTest::testBuildHeaderHeightForm ( )

Definition at line 105 of file ilPhantomJSRendererUiTest.php.

106  {
107  $transformer = self::getMethod('buildHeaderHeightForm');
108  $this->assertInstanceOf('ilTextInputGUI', $transformer->invokeArgs($this->form, array()));
109  $this->assertSame('header_height', $transformer->invokeArgs($this->form, array())->getTitle());
110  $this->assertSame('header_height', $transformer->invokeArgs($this->form, array())->getPostVar());
111  }

◆ testBuildHeaderPageNumbersForm()

ilPhantomJSRendererUiTest::testBuildHeaderPageNumbersForm ( )

Definition at line 121 of file ilPhantomJSRendererUiTest.php.

122  {
123  $transformer = self::getMethod('buildHeaderPageNumbersForm');
124  $this->assertInstanceOf('ilCheckboxInputGUI', $transformer->invokeArgs($this->form, array()));
125  $this->assertSame('header_show_pages', $transformer->invokeArgs($this->form, array())->getTitle());
126  $this->assertSame('header_show_pages', $transformer->invokeArgs($this->form, array())->getPostVar());
127  }

◆ testBuildHeaderTextForm()

ilPhantomJSRendererUiTest::testBuildHeaderTextForm ( )

Definition at line 113 of file ilPhantomJSRendererUiTest.php.

114  {
115  $transformer = self::getMethod('buildHeaderTextForm');
116  $this->assertInstanceOf('ilTextInputGUI', $transformer->invokeArgs($this->form, array()));
117  $this->assertSame('head_text', $transformer->invokeArgs($this->form, array())->getTitle());
118  $this->assertSame('header_text', $transformer->invokeArgs($this->form, array())->getPostVar());
119  }

◆ testBuildJavascriptDelayForm()

ilPhantomJSRendererUiTest::testBuildJavascriptDelayForm ( )

Definition at line 73 of file ilPhantomJSRendererUiTest.php.

74  {
75  $transformer = self::getMethod('buildJavascriptDelayForm');
76  $this->assertInstanceOf('ilTextInputGUI', $transformer->invokeArgs($this->form, array()));
77  $this->assertSame('javascript_delay', $transformer->invokeArgs($this->form, array())->getTitle());
78  $this->assertSame('javascript_delay', $transformer->invokeArgs($this->form, array())->getPostVar());
79  }

◆ testBuildMarginForm()

ilPhantomJSRendererUiTest::testBuildMarginForm ( )

Definition at line 81 of file ilPhantomJSRendererUiTest.php.

82  {
83  $transformer = self::getMethod('buildMarginForm');
84  $this->assertInstanceOf('ilTextInputGUI', $transformer->invokeArgs($this->form, array()));
85  $this->assertSame('margin', $transformer->invokeArgs($this->form, array())->getTitle());
86  $this->assertSame('margin', $transformer->invokeArgs($this->form, array())->getPostVar());
87  }

◆ testBuildOrientationForm()

ilPhantomJSRendererUiTest::testBuildOrientationForm ( )

Definition at line 153 of file ilPhantomJSRendererUiTest.php.

154  {
155  $transformer = self::getMethod('buildOrientationForm');
156  $this->assertInstanceOf('ilSelectInputGUI', $transformer->invokeArgs($this->form, array()));
157  $this->assertSame('orientation', $transformer->invokeArgs($this->form, array())->getTitle());
158  $this->assertSame('orientation', $transformer->invokeArgs($this->form, array())->getPostVar());
159  }

◆ testBuildPageSizesForm()

ilPhantomJSRendererUiTest::testBuildPageSizesForm ( )

Definition at line 145 of file ilPhantomJSRendererUiTest.php.

146  {
147  $transformer = self::getMethod('buildPageSizesForm');
148  $this->assertInstanceOf('ilSelectInputGUI', $transformer->invokeArgs($this->form, array()));
149  $this->assertSame('page_size', $transformer->invokeArgs($this->form, array())->getTitle());
150  $this->assertSame('page_size', $transformer->invokeArgs($this->form, array())->getPostVar());
151  }

◆ testBuildViewPortForm()

ilPhantomJSRendererUiTest::testBuildViewPortForm ( )

Definition at line 137 of file ilPhantomJSRendererUiTest.php.

138  {
139  $transformer = self::getMethod('buildViewPortForm');
140  $this->assertInstanceOf('ilTextInputGUI', $transformer->invokeArgs($this->form, array()));
141  $this->assertSame('viewport', $transformer->invokeArgs($this->form, array())->getTitle());
142  $this->assertSame('viewport', $transformer->invokeArgs($this->form, array())->getPostVar());
143  }

Field Documentation

◆ $form

ilPhantomJSRendererUiTest::$form
protected

Definition at line 21 of file ilPhantomJSRendererUiTest.php.

◆ $lng

ilPhantomJSRendererUiTest::$lng
protected

Definition at line 19 of file ilPhantomJSRendererUiTest.php.


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