https://github.com/PHPOffice/PHPWord/issues/58 - fix for tests #2.
This commit is contained in:
parent
6b17492383
commit
4261f5a9f2
|
|
@ -147,7 +147,7 @@ class PhpWordTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$templateFqfn = \join(
|
$templateFqfn = \join(
|
||||||
\DIRECTORY_SEPARATOR,
|
\DIRECTORY_SEPARATOR,
|
||||||
array(\PHPWORD_TESTS_BASE_DIR, 'data', 'templates', 'blanks.docx')
|
array(\PHPWORD_TESTS_BASE_DIR, 'Tests', 'data', 'templates', 'blanks.docx')
|
||||||
);
|
);
|
||||||
$phpWord = new PhpWord();
|
$phpWord = new PhpWord();
|
||||||
$phpWord->loadTemplate($templateFqfn);
|
$phpWord->loadTemplate($templateFqfn);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
||||||
$object = new Word2007();
|
$object = new Word2007();
|
||||||
$fqFilename = join(
|
$fqFilename = join(
|
||||||
DIRECTORY_SEPARATOR,
|
DIRECTORY_SEPARATOR,
|
||||||
array(PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'reader.docx')
|
array(PHPWORD_TESTS_BASE_DIR, 'Tests', '_files', 'documents', 'reader.docx')
|
||||||
);
|
);
|
||||||
$this->assertTrue($object->canRead($fqFilename));
|
$this->assertTrue($object->canRead($fqFilename));
|
||||||
}
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
||||||
$object = new Word2007();
|
$object = new Word2007();
|
||||||
$fqFilename = join(
|
$fqFilename = join(
|
||||||
DIRECTORY_SEPARATOR,
|
DIRECTORY_SEPARATOR,
|
||||||
array(PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'foo.docx')
|
array(PHPWORD_TESTS_BASE_DIR, 'Tests', '_files', 'documents', 'foo.docx')
|
||||||
);
|
);
|
||||||
$this->assertFalse($object->canRead($fqFilename));
|
$this->assertFalse($object->canRead($fqFilename));
|
||||||
$object = IOFactory::load($fqFilename);
|
$object = IOFactory::load($fqFilename);
|
||||||
|
|
@ -44,7 +44,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$fqFilename = join(
|
$fqFilename = join(
|
||||||
DIRECTORY_SEPARATOR,
|
DIRECTORY_SEPARATOR,
|
||||||
array(PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'reader.docx')
|
array(PHPWORD_TESTS_BASE_DIR, 'Tests', '_files', 'documents', 'reader.docx')
|
||||||
);
|
);
|
||||||
$object = IOFactory::load($fqFilename);
|
$object = IOFactory::load($fqFilename);
|
||||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object);
|
$this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ date_default_timezone_set('UTC');
|
||||||
|
|
||||||
// defining base dir for tests
|
// defining base dir for tests
|
||||||
if (!defined('PHPWORD_TESTS_BASE_DIR')) {
|
if (!defined('PHPWORD_TESTS_BASE_DIR')) {
|
||||||
define('PHPWORD_TESTS_BASE_DIR', realpath(__DIR__ . '/..'));
|
define('PHPWORD_TESTS_BASE_DIR', realpath(__DIR__ . '/PhpWord'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$vendor = realpath(__DIR__ . '/../vendor');
|
$vendor = realpath(__DIR__ . '/../vendor');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue