16
16
use PhpOffice \PhpPresentation \Style \Color ;
17
17
use PhpOffice \PhpPresentation \Style \Fill ;
18
18
use PhpOffice \PhpPresentation \Style \Shadow ;
19
- use PhpOffice \PhpPresentation \Tests \TestHelperDOCX ;
19
+ use PhpOffice \PhpPresentation \Tests \PhpPresentationTestCase ;
20
20
use PhpOffice \PhpPresentation \Shape \Drawing ;
21
21
use PhpOffice \PhpPresentation \Shape \Media ;
22
22
use Symfony \Component \Finder \SplFileInfo ;
23
23
24
- class SchemaTest extends \PHPUnit_Framework_TestCase
24
+ class SchemaTest extends PhpPresentationTestCase
25
25
{
26
26
private $ internalErrors ;
27
27
28
- protected function setUp ()
28
+ public function setUp ()
29
29
{
30
+ parent ::setUp ();
31
+
30
32
libxml_clear_errors ();
31
33
$ this ->internalErrors = libxml_use_internal_errors (true );
32
34
}
33
35
34
- protected function tearDown ()
36
+ public function tearDown ()
35
37
{
38
+ parent ::tearDown ();
39
+
36
40
libxml_use_internal_errors ($ this ->internalErrors );
37
- TestHelperDOCX::clear ();
38
41
}
39
42
40
43
/**
@@ -45,10 +48,10 @@ protected function tearDown()
45
48
*/
46
49
public function testSchema (PhpPresentation $ presentation )
47
50
{
48
- $ xml = TestHelperDOCX:: getDocument ($ presentation , 'PowerPoint2007 ' );
51
+ $ this -> writePresentationFile ($ presentation , 'PowerPoint2007 ' );
49
52
50
53
// validate all XML files
51
- $ path = realpath ($ xml -> getPath () . '/ppt ' );
54
+ $ path = realpath ($ this -> workDirectory . '/ppt ' );
52
55
$ iterator = new \RecursiveIteratorIterator (new \RecursiveDirectoryIterator ($ path ));
53
56
54
57
foreach ($ iterator as $ file ) {
@@ -58,7 +61,7 @@ public function testSchema(PhpPresentation $presentation)
58
61
}
59
62
60
63
$ fileName = str_replace ('\\' , '/ ' , substr ($ file ->getRealPath (), strlen ($ path ) + 1 ));
61
- $ dom = $ xml -> getFileDom ('ppt/ ' . $ fileName );
64
+ $ dom = $ this -> getXmlDom ('ppt/ ' . $ fileName );
62
65
$ xmlSource = $ dom ->saveXML ();
63
66
64
67
// In the ISO/ECMA standard the namespace has changed from
0 commit comments