https://github.com/PHPOffice/PHPWord/issues/58 - fix for unit tests.
This commit is contained in:
parent
a0e8b43193
commit
6b17492383
@ -18,10 +18,12 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCanRead()
|
public function testCanRead()
|
||||||
{
|
{
|
||||||
$dir = __DIR__ . "/../_files/documents";
|
$object = new Word2007();
|
||||||
$object = new Word2007;
|
$fqFilename = join(
|
||||||
$file = $dir . \DIRECTORY_SEPARATOR . 'reader.docx';
|
DIRECTORY_SEPARATOR,
|
||||||
$this->assertTrue($object->canRead($file));
|
array(PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'reader.docx')
|
||||||
|
);
|
||||||
|
$this->assertTrue($object->canRead($fqFilename));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,21 +31,22 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCanReadFailed()
|
public function testCanReadFailed()
|
||||||
{
|
{
|
||||||
$dir = __DIR__ . "/../_files/documents";
|
$object = new Word2007();
|
||||||
$object = new Word2007;
|
$fqFilename = join(
|
||||||
$file = $dir . \DIRECTORY_SEPARATOR . 'foo.docx';
|
DIRECTORY_SEPARATOR,
|
||||||
$this->assertFalse($object->canRead($file));
|
array(PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'foo.docx')
|
||||||
$object = IOFactory::load($file);
|
);
|
||||||
|
$this->assertFalse($object->canRead($fqFilename));
|
||||||
|
$object = IOFactory::load($fqFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Test load document
|
|
||||||
*/
|
|
||||||
public function testLoad()
|
public function testLoad()
|
||||||
{
|
{
|
||||||
$dir = __DIR__ . "/../_files/documents";
|
$fqFilename = join(
|
||||||
$file = $dir . \DIRECTORY_SEPARATOR . 'reader.docx';
|
DIRECTORY_SEPARATOR,
|
||||||
$object = IOFactory::load($file);
|
array(PHPWORD_TESTS_BASE_DIR, '_files', 'documents', 'reader.docx')
|
||||||
|
);
|
||||||
|
$object = IOFactory::load($fqFilename);
|
||||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object);
|
$this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user