summaryrefslogtreecommitdiffstats
path: root/tests/Plugin/BasePluginTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Plugin/BasePluginTest.php')
-rw-r--r--tests/Plugin/BasePluginTest.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/Plugin/BasePluginTest.php b/tests/Plugin/BasePluginTest.php
new file mode 100644
index 0000000..0686eb4
--- /dev/null
+++ b/tests/Plugin/BasePluginTest.php
@@ -0,0 +1,49 @@
+<?php
+
+
+namespace PHPExcel\StyleFixer\Plugin;
+
+
+abstract class BasePluginTest extends \PHPUnit_Framework_TestCase
+{
+ private $basePath;
+
+ public function setUp()
+ {
+ $this->basePath = __DIR__.'/../xml';
+ }
+
+ public function getOutputXml($path)
+ {
+ return file_get_contents($this->basePath.'/output/'.$path);
+ }
+
+ public function getTemplateXml($path)
+ {
+ return file_get_contents($this->basePath.'/template/'.$path);
+ }
+
+ /**
+ * @param int $count
+ * @param array $map
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
+ protected function createBookUtil($count, $map)
+ {
+ $bookUtil = $this->getMock('PHPExcel\StyleFixer\Util\Book');
+ $bookUtil
+ ->expects($this->exactly($count))
+ ->method('makeSheetMap')
+ ->with($this->isInstanceOf('\ZipArchive'))
+ ->will($this->returnValue($map))
+ ;
+
+ return $bookUtil;
+ }
+
+ public function tearDown()
+ {
+ $this->output_stylesXml = '';
+ $this->template_stylesXml = '';
+ }
+}