From efa77efb7abc6a70f1e768a03ddabc6d4edbdf88 Mon Sep 17 00:00:00 2001 From: Roman Syroeshko Date: Tue, 25 Mar 2014 19:58:50 +0400 Subject: [PATCH] https://github.com/PHPOffice/PHPWord/issues/58 - fix for tests #3. --- tests/PhpWord/Tests/PhpWordTest.php | 2 +- tests/PhpWord/Tests/Reader/Word2007Test.php | 8 ++++---- tests/bootstrap.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/PhpWord/Tests/PhpWordTest.php b/tests/PhpWord/Tests/PhpWordTest.php index 03ff2a1a9c..7a48155fad 100644 --- a/tests/PhpWord/Tests/PhpWordTest.php +++ b/tests/PhpWord/Tests/PhpWordTest.php @@ -147,7 +147,7 @@ public function testLoadTemplateException() { $templateFqfn = \join( \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_BASE_DIR, 'Tests', 'data', 'templates', 'blanks.docx') + array(\PHPWORD_TESTS_BASE_DIR, 'PhpWord', 'Tests', 'data', 'templates', 'blanks.docx') ); $phpWord = new PhpWord(); $phpWord->loadTemplate($templateFqfn); diff --git a/tests/PhpWord/Tests/Reader/Word2007Test.php b/tests/PhpWord/Tests/Reader/Word2007Test.php index 7cce388e49..214c6f1e66 100644 --- a/tests/PhpWord/Tests/Reader/Word2007Test.php +++ b/tests/PhpWord/Tests/Reader/Word2007Test.php @@ -21,7 +21,7 @@ public function testCanRead() $object = new Word2007(); $fqFilename = join( DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_BASE_DIR, 'Tests', '_files', 'documents', 'reader.docx') + array(PHPWORD_TESTS_BASE_DIR, 'PhpWord', 'Tests', '_files', 'documents', 'reader.docx') ); $this->assertTrue($object->canRead($fqFilename)); } @@ -34,7 +34,7 @@ public function testCanReadFailed() $object = new Word2007(); $fqFilename = join( DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_BASE_DIR, 'Tests', '_files', 'documents', 'foo.docx') + array(PHPWORD_TESTS_BASE_DIR, 'PhpWord', 'Tests', '_files', 'documents', 'foo.docx') ); $this->assertFalse($object->canRead($fqFilename)); $object = IOFactory::load($fqFilename); @@ -44,9 +44,9 @@ public function testLoad() { $fqFilename = join( DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_BASE_DIR, 'Tests', '_files', 'documents', 'reader.docx') + array(PHPWORD_TESTS_BASE_DIR, 'PhpWord', 'Tests', '_files', 'documents', 'reader.docx') ); $object = IOFactory::load($fqFilename); $this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object); } -} +} \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 5240ca079f..d33512729c 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,7 +3,7 @@ // defining base dir for tests if (!defined('PHPWORD_TESTS_BASE_DIR')) { - define('PHPWORD_TESTS_BASE_DIR', realpath(__DIR__ . '/PhpWord')); + define('PHPWORD_TESTS_BASE_DIR', realpath(__DIR__ . '/..')); } $vendor = realpath(__DIR__ . '/../vendor');