ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
CodePageTest.php
Go to the documentation of this file.
1
<?
php
2
3
4
require_once
'testDataFileIterator.php'
;
5
6
class
CodePageTest
extends
PHPUnit_Framework_TestCase
7
{
8
9
public
function
setUp
()
10
{
11
if
(!
defined
(
'PHPEXCEL_ROOT'
)) {
12
define(
'PHPEXCEL_ROOT'
, APPLICATION_PATH .
'/'
);
13
}
14
require_once(PHPEXCEL_ROOT .
'PHPExcel/Autoloader.php'
);
15
}
16
20
public
function
testCodePageNumberToName
()
21
{
22
$args = func_get_args();
23
$expectedResult = array_pop($args);
24
$result
= call_user_func_array(
array
(
'PHPExcel_Shared_CodePage'
,
'NumberToName'
),$args);
25
$this->assertEquals($expectedResult,
$result
);
26
}
27
28
public
function
providerCodePage
()
29
{
30
return
new
testDataFileIterator
(
'rawTestData/Shared/CodePage.data'
);
31
}
32
33
public
function
testNumberToNameWithInvalidCodePage
()
34
{
35
$invalidCodePage = 12345;
36
try
{
37
$result
= call_user_func(
array
(
'PHPExcel_Shared_CodePage'
,
'NumberToName'
),$invalidCodePage);
38
}
catch
(
Exception
$e) {
39
$this->assertEquals($e->getMessage(),
'Unknown codepage: 12345'
);
40
return
;
41
}
42
$this->fail(
'An expected exception has not been raised.'
);
43
}
44
45
public
function
testNumberToNameWithUnsupportedCodePage
()
46
{
47
$unsupportedCodePage = 720;
48
try
{
49
$result
= call_user_func(
array
(
'PHPExcel_Shared_CodePage'
,
'NumberToName'
),$unsupportedCodePage);
50
}
catch
(
Exception
$e) {
51
$this->assertEquals($e->getMessage(),
'Code page 720 not supported.'
);
52
return
;
53
}
54
$this->fail(
'An expected exception has not been raised.'
);
55
}
56
57
}
$result
$result
Definition:
CleanUpTest.php:407
CodePageTest\testCodePageNumberToName
testCodePageNumberToName()
providerCodePage
Definition:
CodePageTest.php:20
testDataFileIterator
Definition:
testDataFileIterator.php:3
PHPUnit_Framework_TestCase
CodePageTest\testNumberToNameWithUnsupportedCodePage
testNumberToNameWithUnsupportedCodePage()
Definition:
CodePageTest.php:45
CodePageTest
Definition:
CodePageTest.php:6
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
CodePageTest\testNumberToNameWithInvalidCodePage
testNumberToNameWithInvalidCodePage()
Definition:
CodePageTest.php:33
CodePageTest\setUp
setUp()
Definition:
CodePageTest.php:9
php
CodePageTest\providerCodePage
providerCodePage()
Definition:
CodePageTest.php:28
defined
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition:
bootstrap.php:27
Exception
libs
composer
vendor
phpoffice
phpexcel
unitTests
Classes
PHPExcel
Shared
CodePageTest.php
Generated on Fri Jan 24 2025 19:00:53 for ILIAS by
1.8.13 (using
Doxyfile
)