Fix failed test

This commit is contained in:
Ivan Lanin 2014-04-05 01:41:48 +07:00
parent dd9faaee06
commit 6aa73544a6
7 changed files with 24 additions and 4 deletions

View File

@ -170,6 +170,8 @@ class ZipArchive
$list = $this->zip->listContent();
$listCount = count($list);
$listIndex = -1;
$contents = null;
for ($i = 0; $i < $listCount; ++$i) {
if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {

View File

@ -39,6 +39,10 @@ class Content extends WriterPart
*/
public function writeContent(PhpWord $phpWord = null)
{
if (is_null($phpWord)) {
throw new Exception("No PhpWord assigned.");
}
// Create XML writer
$xmlWriter = $this->getXmlWriter();

View File

@ -24,6 +24,10 @@ class Meta extends WriterPart
*/
public function writeMeta(PhpWord $phpWord = null)
{
if (is_null($phpWord)) {
throw new Exception("No PhpWord assigned.");
}
// Create XML writer
$xmlWriter = $this->getXmlWriter();

View File

@ -28,6 +28,10 @@ class Styles extends WriterPart
*/
public function writeStyles(PhpWord $phpWord = null)
{
if (is_null($phpWord)) {
throw new Exception("No PhpWord assigned.");
}
// Create XML writer
$xmlWriter = $this->getXmlWriter();

View File

@ -66,12 +66,10 @@ class ContentTypes extends WriterPart
$xmlWriter->startDocument('1.0', 'UTF-8', 'yes');
$xmlWriter->startElement('Types');
$xmlWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types');
foreach ($defaults as $key => $value)
{
foreach ($defaults as $key => $value) {
$this->writeContentType($xmlWriter, true, $key, $value);
}
foreach ($overrides as $key => $value)
{
foreach ($overrides as $key => $value) {
$this->writeContentType($xmlWriter, false, $key, $value);
}
$xmlWriter->endElement();

View File

@ -21,6 +21,10 @@ class DocProps extends WriterPart
*/
public function writeDocPropsApp(PhpWord $phpWord = null)
{
if (is_null($phpWord)) {
throw new Exception("No PhpWord assigned.");
}
// Create XML writer
$xmlWriter = $this->getXmlWriter();

View File

@ -28,6 +28,10 @@ class Document extends Base
*/
public function writeDocument(PhpWord $phpWord = null)
{
if (is_null($phpWord)) {
throw new Exception("No PhpWord assigned.");
}
// Create XML writer
$xmlWriter = $this->getXmlWriter();