PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 2.2.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v2.2.0
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
visualizer / vendor / phpoffice / phpexcel / unitTests / Classes / PHPExcel / Reader / XEEValidatorTest.php

XEEValidatorTest.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 2.2.0, at vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Reader/XEEValidatorTest.php

56 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 class XEEValidatorTest extends PHPUnit_Framework_TestCase
5 {
6
7 public function setUp()
8 {
9 if (!defined('PHPEXCEL_ROOT')) {
10 define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
11 }
12 require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
13 }
14
15 /**
16 * @dataProvider providerInvalidXML
17 * @expectedException PHPExcel_Reader_Exception
18 */
19 public function testInvalidXML($filename)
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 }
26
27 public function providerInvalidXML()
28 {
29 $tests = [];
30 foreach(glob('rawTestData/Reader/XEETestInvalid*.xml') as $file) {
31 $tests[] = [realpath($file), true];
32 }
33 return $tests;
34 }
35
36 /**
37 * @dataProvider providerValidXML
38 */
39 public function testValidXML($filename, $expectedResult)
40 {
41 $reader = $this->getMockForAbstractClass('PHPExcel_Reader_Abstract');
42 $result = $reader->securityScanFile($filename);
43 $this->assertEquals($expectedResult, $result);
44 }
45
46 public function providerValidXML()
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 }
54
55 }
56