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

Public Member Functions

 setUp ()
 
 testInvalidXML ($filename)
 providerInvalidXML PHPExcel_Reader_Exception More...
 
 providerInvalidXML ()
 
 testValidXML ($filename, $expectedResult)
 providerValidXML More...
 
 providerValidXML ()
 

Detailed Description

Definition at line 4 of file XEEValidatorTest.php.

Member Function Documentation

◆ providerInvalidXML()

XEEValidatorTest::providerInvalidXML ( )

Definition at line 27 of file XEEValidatorTest.php.

References $file.

28  {
29  $tests = [];
30  foreach(glob('rawTestData/Reader/XEETestInvalid*.xml') as $file) {
31  $tests[] = [realpath($file), true];
32  }
33  return $tests;
34  }
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file

◆ providerValidXML()

XEEValidatorTest::providerValidXML ( )

Definition at line 46 of file XEEValidatorTest.php.

References $file.

47  {
48  $tests = [];
49  foreach(glob('rawTestData/Reader/XEETestValid*.xml') as $file) {
50  $tests[] = [realpath($file), file_get_contents($file)];
51  }
52  return $tests;
53  }
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file

◆ setUp()

XEEValidatorTest::setUp ( )

Definition at line 7 of file XEEValidatorTest.php.

References defined.

8  {
9  if (!defined('PHPEXCEL_ROOT')) {
10  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
11  }
12  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
13  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ testInvalidXML()

XEEValidatorTest::testInvalidXML (   $filename)

providerInvalidXML PHPExcel_Reader_Exception

Definition at line 19 of file XEEValidatorTest.php.

References $filename, $reader, and $result.

20  {
21  $reader = $this->getMockForAbstractClass('PHPExcel_Reader_Abstract');
22  $expectedResult = 'FAILURE: Should throw an Exception rather than return a value';
23  $result = $reader->securityScanFile($filename);
24  $this->assertEquals($expectedResult, $result);
25  }
$result

◆ testValidXML()

XEEValidatorTest::testValidXML (   $filename,
  $expectedResult 
)

providerValidXML

Definition at line 39 of file XEEValidatorTest.php.

References $filename, $reader, and $result.

40  {
41  $reader = $this->getMockForAbstractClass('PHPExcel_Reader_Abstract');
42  $result = $reader->securityScanFile($filename);
43  $this->assertEquals($expectedResult, $result);
44  }
$result

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