ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPhantomJSRendererTest Class Reference
+ Inheritance diagram for ilPhantomJSRendererTest:
+ Collaboration diagram for ilPhantomJSRendererTest:

Public Member Functions

 testInstanceCanBeCreated ()
 
 testGetSettings ()
 
 testBeckerscheSettingsText ()
 
 testHeaderSettingsWithoutPageNumber ()
 
 testFooterSettingsText ()
 
 testFooterSettingsTextWithoutPageNumber ()
 

Static Protected Member Functions

static getMethod ($name)
 

Protected Attributes

 $default_config
 
 $beckersche_config
 

Detailed Description

Definition at line 10 of file ilPhantomJSRendererTest.php.

Member Function Documentation

◆ getMethod()

static ilPhantomJSRendererTest::getMethod (   $name)
staticprotected

Definition at line 45 of file ilPhantomJSRendererTest.php.

References $name.

46  {
47  $class = new ReflectionClass('ilPhantomJSRenderer');
48  $method = $class->getMethod($name);
49  $method->setAccessible(true);
50  return $method;
51  }
if($format !==null) $name
Definition: metadata.php:146

◆ testBeckerscheSettingsText()

ilPhantomJSRendererTest::testBeckerscheSettingsText ( )

Definition at line 67 of file ilPhantomJSRendererTest.php.

References $beckersche_config, $config, and array.

68  {
69  $transformer = self::getMethod('getCommandLineConfig');
70  $obj = new ilPhantomJSRenderer(true);
72  $this->assertSame('"{\"page_size\":\"A4\",\"orientation\":\"Portrait\",\"margin\":\"1cm\",\"delay\":200,\"viewport\":\"\",\"header\":null,\"footer\":null,\"page_type\":0}"', $transformer->invokeArgs($obj, array($config)));
73  }
Create styles array
The data for the language used.

◆ testFooterSettingsText()

ilPhantomJSRendererTest::testFooterSettingsText ( )

Definition at line 89 of file ilPhantomJSRendererTest.php.

References $beckersche_config, $config, and array.

90  {
91  $transformer = self::getMethod('getCommandLineConfig');
92  $obj = new ilPhantomJSRenderer(true);
94  $config['pagesize'] = 'A4';
95  $config['footer_text'] = 'Hello';
96  $config['footer_height'] = '1cm';
97  $config['footer_type'] = '1';
98  $config['footer_show_pages'] = true;
99 
100  $this->assertSame('"{\"page_size\":\"A4\",\"orientation\":\"Portrait\",\"margin\":\"1cm\",\"delay\":200,\"viewport\":\"\",\"header\":null,\"footer\":{\"text\":\"Hello\",\"height\":\"1cm\",\"show_pages\":true},\"page_type\":0}"', $transformer->invokeArgs($obj, array($config)));
101  }
Create styles array
The data for the language used.

◆ testFooterSettingsTextWithoutPageNumber()

ilPhantomJSRendererTest::testFooterSettingsTextWithoutPageNumber ( )

Definition at line 103 of file ilPhantomJSRendererTest.php.

References $beckersche_config, $config, and array.

104  {
105  $transformer = self::getMethod('getCommandLineConfig');
106  $obj = new ilPhantomJSRenderer(true);
108  $config['pagesize'] = 'A4';
109  $config['footer_text'] = 'Hello';
110  $config['footer_height'] = '1cm';
111  $config['footer_type'] = '1';
112  $config['footer_show_pages'] = false;
113 
114  $this->assertSame('"{\"page_size\":\"A4\",\"orientation\":\"Portrait\",\"margin\":\"1cm\",\"delay\":200,\"viewport\":\"\",\"header\":null,\"footer\":{\"text\":\"Hello\",\"height\":\"1cm\",\"show_pages\":false},\"page_type\":0}"', $transformer->invokeArgs($obj, array($config)));
115  }
Create styles array
The data for the language used.

◆ testGetSettings()

ilPhantomJSRendererTest::testGetSettings ( )

Definition at line 60 of file ilPhantomJSRendererTest.php.

References $config.

61  {
62  $obj = new ilPhantomJSRenderer(true);
63  $config = $obj->getDefaultConfig('Bla', 'Blubb');
64  $this->assertSame($this->default_config, $config);
65  }

◆ testHeaderSettingsWithoutPageNumber()

ilPhantomJSRendererTest::testHeaderSettingsWithoutPageNumber ( )

Definition at line 75 of file ilPhantomJSRendererTest.php.

References $beckersche_config, $config, and array.

76  {
77  $transformer = self::getMethod('getCommandLineConfig');
78  $obj = new ilPhantomJSRenderer(true);
80  $config['pagesize'] = 'A4';
81  $config['header_text'] = 'Hello';
82  $config['header_height'] = '1cm';
83  $config['header_type'] = '1';
84  $config['header_show_pages'] = false;
85 
86  $this->assertSame('"{\"page_size\":\"A4\",\"orientation\":\"Portrait\",\"margin\":\"1cm\",\"delay\":200,\"viewport\":\"\",\"header\":{\"text\":\"Hello\",\"height\":\"1cm\",\"show_pages\":false},\"footer\":null,\"page_type\":0}"', $transformer->invokeArgs($obj, array($config)));
87  }
Create styles array
The data for the language used.

◆ testInstanceCanBeCreated()

ilPhantomJSRendererTest::testInstanceCanBeCreated ( )

Definition at line 53 of file ilPhantomJSRendererTest.php.

54  {
55  $transformer = new ilPhantomJSRenderer(true);
56  $this->assertInstanceOf('ilPhantomJSRenderer', $transformer);
57  }

Field Documentation

◆ $beckersche_config

ilPhantomJSRendererTest::$beckersche_config
protected
Initial value:
= array('path' => '/usr/local/bin/phantomjs',
'page_size' => 'A4',
'margin' => '1cm',
'javascript_delay' => 200,
'orientation' => 'Portrait',
'viewport' => '',
'header_type' => 0,
'header_text' => '',
'header_height' => '0cm',
'header_show_pages' => 0,
'footer_type' => 0,
'footer_text' => '',
'footer_height' => '0cm',
'footer_show_pages' => 0,
'page_type' => 0)

Definition at line 29 of file ilPhantomJSRendererTest.php.

Referenced by testBeckerscheSettingsText(), testFooterSettingsText(), testFooterSettingsTextWithoutPageNumber(), and testHeaderSettingsWithoutPageNumber().

◆ $default_config

ilPhantomJSRendererTest::$default_config
protected
Initial value:
= array('path' => '/usr/local/bin/phantomjs',
'page_size' => 'A4',
'margin' => '1cm',
'javascript_delay' => 200,
'viewport' => '',
'orientation' => 'Portrait',
'header_type' => 0,
'header_text' => '',
'header_height' => '0cm',
'header_show_pages' => 0,
'footer_type' => 0,
'footer_text' => '',
'footer_height' => '0cm',
'footer_show_pages' => 0,
'page_type' => 0)

Definition at line 12 of file ilPhantomJSRendererTest.php.


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