Total Complexity | 6 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class XmlScannerTest extends TestCase |
||
9 | { |
||
10 | /** |
||
11 | * @dataProvider providerValidXML |
||
12 | * |
||
13 | * @param mixed $filename |
||
14 | * @param mixed $expectedResult |
||
15 | */ |
||
16 | public function testValidXML($filename, $expectedResult) |
||
17 | { |
||
18 | $reader = new XmlScanner(); |
||
19 | $result = $reader->scanFile($filename); |
||
20 | self::assertEquals($expectedResult, $result); |
||
21 | } |
||
22 | |||
23 | public function providerValidXML() |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @dataProvider providerInvalidXML |
||
35 | * |
||
36 | * @param mixed $filename |
||
37 | */ |
||
38 | public function testInvalidXML($filename) |
||
39 | { |
||
40 | $this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class); |
||
41 | |||
42 | $reader = new XmlScanner(); |
||
43 | $expectedResult = 'FAILURE: Should throw an Exception rather than return a value'; |
||
44 | $result = $reader->scanFile($filename); |
||
45 | self::assertEquals($expectedResult, $result); |
||
46 | } |
||
47 | |||
48 | public function providerInvalidXML() |
||
56 | } |
||
57 | } |
||
58 |