Use PSR autoload mechanism for tests

This commit is contained in:
Adrien Crivelli 2022-09-16 14:09:17 +02:00
parent 2bc75771cc
commit c8d360e095
No known key found for this signature in database
GPG Key ID: 16D79B903B4B5874
163 changed files with 330 additions and 201 deletions

View File

@ -68,6 +68,7 @@
"require-dev": {
"ext-zip": "*",
"ext-gd": "*",
"ext-libxml": "*",
"dompdf/dompdf": "^2.0",
"friendsofphp/php-cs-fixer": "^3.11",
"mpdf/mpdf": "^8.1",
@ -90,6 +91,11 @@
"PhpOffice\\PhpWord\\": "src/PhpWord"
}
},
"autoload-dev": {
"psr-4": {
"PhpOffice\\PhpWordTests\\": "tests/PhpWordTests"
}
},
"extra": {
"branch-alias": {
"dev-develop": "0.19-dev"

View File

@ -9,14 +9,14 @@
stopOnFailure="false">
<testsuites>
<testsuite name="PhpWord Test Suite">
<directory>./tests/PhpWord</directory>
<directory>./tests/PhpWordTests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">./src/PhpWord/Shared/PCLZip</directory>
<directory suffix=".php">./src/PhpWordTests/Shared/PCLZip</directory>
</exclude>
</whitelist>
</filter>

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use PhpOffice\PhpWord\PhpWord;
use ZipArchive;
/**
@ -39,9 +40,9 @@ abstract class AbstractTestReader extends \PHPUnit\Framework\TestCase
*/
protected function getDocumentFromString(array $partXmls = [])
{
$file = __DIR__ . '/../_files/temp.docx';
$file = __DIR__ . '/_files/temp.docx';
$zip = new ZipArchive();
$zip->open($file, ZipArchive::CREATE);
$zip->open($file, ZipArchive::CREATE | ZipArchive::OVERWRITE);
foreach ($this->parts as $partName => $part) {
if (array_key_exists($partName, $partXmls)) {
$zip->addFromString("{$partName}.xml", str_replace('{toReplace}', $partXmls[$partName], $this->parts[$partName]['xml']));

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use Symfony\Component\Process\Process;
@ -25,7 +25,7 @@ abstract class AbstractWebServerEmbeddedTest extends \PHPUnit\Framework\TestCase
public static function setUpBeforeClass(): void
{
$commandLine = 'php -S localhost:8080 -t tests/PhpWord/_files';
$commandLine = 'php -S localhost:8080 -t tests/PhpWordTests/_files';
self::$httpServer = Process::fromShellCommandline($commandLine);
self::$httpServer->start();

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Collection;
namespace PhpOffice\PhpWordTests\Collection;
use PhpOffice\PhpWord\Element\Footnote;
use PhpOffice\PhpWord\Collection\Footnotes;
/**
* Test class for PhpOffice\PhpWord\Collection subnamespace.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\ComplexType;
namespace PhpOffice\PhpWordTests\ComplexType;
use InvalidArgumentException;
use PhpOffice\PhpWord\ComplexType\FootnoteProperties;
use PhpOffice\PhpWord\SimpleType\NumberFormat;
/**

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\ComplexType;
namespace PhpOffice\PhpWordTests\ComplexType;
use InvalidArgumentException;
use PhpOffice\PhpWord\ComplexType\ProofState;
/**
* Test class for PhpOffice\PhpWord\ComplexType\ProofState.

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
/**
* Test class for PhpOffice\PhpWord\Element\AbstractElement.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Bookmark;
/**
* Test class for PhpOffice\PhpWord\Element\Footer.

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use BadMethodCallException;
use PhpOffice\PhpWord\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\Element\Cell;
use PhpOffice\PhpWordTests\AbstractWebServerEmbeddedTest;
/**
* Test class for PhpOffice\PhpWord\Element\Cell.

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\CheckBox;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\Style\Font;

View File

@ -15,10 +15,12 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use DateTime;
use InvalidArgumentException;
use PhpOffice\PhpWord\Element\Comment;
use PhpOffice\PhpWord\Element\Text;
/**
* Test class for PhpOffice\PhpWord\Element\Header.

View File

@ -15,9 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use InvalidArgumentException;
use PhpOffice\PhpWord\Element\Field;
use PhpOffice\PhpWord\Element\TextRun;
/**
* Test class for PhpOffice\PhpWord\Element\Field.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\Element\Footer;
use PhpOffice\PhpWordTests\AbstractWebServerEmbeddedTest;
/**
* Test class for PhpOffice\PhpWord\Element\Footer.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Footnote;
/**
* Test class for PhpOffice\PhpWord\Element\Footnote.

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use BadMethodCallException;
use PhpOffice\PhpWord\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\Element\Header;
use PhpOffice\PhpWordTests\AbstractWebServerEmbeddedTest;
/**
* Test class for PhpOffice\PhpWord\Element\Header.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\Element\Image;
use PhpOffice\PhpWordTests\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\SimpleType\Jc;
/**

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Line;
/**
* Test class for PhpOffice\PhpWord\Element\Line.

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Link;
use PhpOffice\PhpWord\Style\Font;
/**

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\ListItemRun;
/**
* Test class for PhpOffice\PhpWord\Element\ListItemRun.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\ListItem;
/**
* Test class for PhpOffice\PhpWord\Element\ListItem.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\OLEObject;
/**
* Test class for PhpOffice\PhpWord\Element\OLEObject.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\PageBreak;
/**
* Test class for PhpOffice\PhpWord\Element\PageBreak.

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\PreserveText;
use PhpOffice\PhpWord\SimpleType\Jc;
/**

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Row;
/**
* Test class for PhpOffice\PhpWord\Element\Row.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use InvalidArgumentException;
use PhpOffice\PhpWord\Element\SDT;
/**
* Test class for PhpOffice\PhpWord\Element\SDT.

View File

@ -15,11 +15,13 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use Exception;
use PhpOffice\PhpWord\Element\Header;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Style;
use PhpOffice\PhpWord\Element\Section;
use PhpOffice\PhpWord\Style\Section as SectionStyle;
/**

View File

@ -15,8 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Title;
use PhpOffice\PhpWord\Element\TOC;
use PhpOffice\PhpWord\PhpWord;
/**

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Table;
/**
* Test class for PhpOffice\PhpWord\Element\Table.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\TextBox;
/**
* Test class for PhpOffice\PhpWord\Element\TextBox.

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\TextBreak;
use PhpOffice\PhpWord\Style\Font;
use PhpOffice\PhpWord\Style\Paragraph;

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\TextRun;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\Style\Paragraph;

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use PhpOffice\PhpWord\Element\Text;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\Style\Font;

View File

@ -15,9 +15,12 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use InvalidArgumentException;
use PhpOffice\PhpWord\Element\PageBreak;
use PhpOffice\PhpWord\Element\TextRun;
use PhpOffice\PhpWord\Element\Title;
/**
* Test class for PhpOffice\PhpWord\Element\Title.

View File

@ -15,9 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Element;
namespace PhpOffice\PhpWordTests\Element;
use DateTime;
use PhpOffice\PhpWord\Element\Text;
use PhpOffice\PhpWord\Element\TrackChange;
/**
* Test class for PhpOffice\PhpWord\Element\TrackChange.

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Escaper;
namespace PhpOffice\PhpWordTests\Escaper;
/**
* Test class for PhpOffice\PhpWord\Escaper\RTF.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Exception;
namespace PhpOffice\PhpWordTests\Exception;
use PhpOffice\PhpWord\Exception\CopyFileException;
/**
* @covers \PhpOffice\PhpWord\Exception\CopyFileException

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Exception;
namespace PhpOffice\PhpWordTests\Exception;
use PhpOffice\PhpWord\Exception\CreateTemporaryFileException;
/**
* @covers \PhpOffice\PhpWord\Exception\CreateTemporaryFileException

View File

@ -15,16 +15,19 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Exception;
namespace PhpOffice\PhpWordTests\Exception;
use PhpOffice\PhpWord\Exception\Exception;
use PHPUnit\Framework\TestCase;
/**
* Test class for PhpOffice\PhpWord\Exception\Exception.
*
* @coversDefaultClass \PhpOffice\PhpWord\Exception\Exception
* @coversDefaultClass Exception
*
* @runTestsInSeparateProcesses
*/
class ExceptionTest extends \PHPUnit\Framework\TestCase
class ExceptionTest extends TestCase
{
/**
* Throw new exception.
@ -33,7 +36,7 @@ class ExceptionTest extends \PHPUnit\Framework\TestCase
*/
public function testThrowException(): void
{
$this->expectException(\PhpOffice\PhpWord\Exception\Exception::class);
$this->expectException(Exception::class);
throw new Exception();
}

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Exception;
namespace PhpOffice\PhpWordTests\Exception;
use PhpOffice\PhpWord\Exception\InvalidImageException;
/**
* Test class for PhpOffice\PhpWord\Exception\InvalidImageException.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Exception;
namespace PhpOffice\PhpWordTests\Exception;
use PhpOffice\PhpWord\Exception\InvalidStyleException;
/**
* Test class for PhpOffice\PhpWord\Exception\InvalidStyleException.

View File

@ -15,13 +15,13 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Exception;
namespace PhpOffice\PhpWordTests\Exception;
use PhpOffice\PhpWord\Exception\UnsupportedImageTypeException;
/**
* Test class for PhpOffice\PhpWord\Exception\UnsupportedImageTypeExceptionTest.
*
* @coversDefaultClass \PhpOffice\PhpWord\Exception\UnsupportedImageTypeExceptionTest
*
* @runTestsInSeparateProcesses
*/
class UnsupportedImageTypeExceptionTest extends \PHPUnit\Framework\TestCase

View File

@ -15,7 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\PhpWord;
/**
* Test class for PhpOffice\PhpWord\IOFactory.

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use Exception;
use PhpOffice\PhpWord\Element\Image;
use PhpOffice\PhpWord\Media;
/**
* Test class for PhpOffice\PhpWord\Media.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Metadata;
namespace PhpOffice\PhpWordTests\Metadata;
use PhpOffice\PhpWord\Metadata\DocInfo;
/**
* Test class for PhpOffice\PhpWord\Metadata\DocInfo.

View File

@ -15,10 +15,12 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Metadata;
namespace PhpOffice\PhpWordTests\Metadata;
use InvalidArgumentException;
use PhpOffice\PhpWord\ComplexType\ProofState;
use PhpOffice\PhpWord\Metadata\Protection;
use PhpOffice\PhpWord\Metadata\Settings;
use PhpOffice\PhpWord\SimpleType\Zoom;
/**

View File

@ -15,10 +15,13 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use BadMethodCallException;
use PhpOffice\PhpWord\Metadata\DocInfo;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Settings;
use PhpOffice\PhpWord\Style;
/**
* Test class for PhpOffice\PhpWord\PhpWord.

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader;
namespace PhpOffice\PhpWordTests\Reader;
use Exception;
use PhpOffice\PhpWord\IOFactory;

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader;
namespace PhpOffice\PhpWordTests\Reader;
use Exception;
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\Reader\MsDoc;
/**
* Test class for PhpOffice\PhpWord\Reader\MsDoc.

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader;
namespace PhpOffice\PhpWordTests\Reader;
use PhpOffice\PhpWord\IOFactory;

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader;
namespace PhpOffice\PhpWordTests\Reader;
use Exception;
use PhpOffice\PhpWord\IOFactory;

View File

@ -15,9 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader\Word2007;
namespace PhpOffice\PhpWordTests\Reader\Word2007;
use PhpOffice\PhpWord\AbstractTestReader;
use PhpOffice\PhpWordTests\AbstractTestReader;
use PhpOffice\PhpWord\Element\TrackChange;
/**

View File

@ -15,9 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader\Word2007;
namespace PhpOffice\PhpWordTests\Reader\Word2007;
use PhpOffice\PhpWord\AbstractTestReader;
use PhpOffice\PhpWordTests\AbstractTestReader;
/**
* Test class for PhpOffice\PhpWord\Reader\Word2007 subnamespace.

View File

@ -15,9 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader\Word2007;
namespace PhpOffice\PhpWordTests\Reader\Word2007;
use PhpOffice\PhpWord\AbstractTestReader;
use PhpOffice\PhpWordTests\AbstractTestReader;
use PhpOffice\PhpWord\SimpleType\TblWidth;
use PhpOffice\PhpWord\SimpleType\VerticalJc;
use PhpOffice\PhpWord\Style;

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Reader;
namespace PhpOffice\PhpWordTests\Reader;
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWord\Reader\Word2007;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Reader\Word2007.

View File

@ -15,7 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Settings;
/**
* Test class for PhpOffice\PhpWord\Settings.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared;
namespace PhpOffice\PhpWordTests\Shared;
use PhpOffice\PhpWord\Shared\Converter;
/**
* Test class for PhpOffice\PhpWord\Shared\Converter.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared;
namespace PhpOffice\PhpWordTests\Shared;
use PhpOffice\PhpWord\Shared\Drawing;
/**
* Test class for PhpOffice\PhpWord\Shared\Drawing.

View File

@ -15,15 +15,16 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared;
namespace PhpOffice\PhpWordTests\Shared;
use Exception;
use PhpOffice\PhpWord\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\Shared\Html;
use PhpOffice\PhpWordTests\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\Element\Section;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\SimpleType\LineSpacingRule;
use PhpOffice\PhpWord\Style\Paragraph;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Shared\Html.

View File

@ -15,12 +15,12 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared\Microsoft;
namespace PhpOffice\PhpWordTests\Shared\Microsoft;
use PhpOffice\PhpWord\Shared\Microsoft\PasswordEncoder;
/**
* Test class for \PhpOffice\PhpWord\Shared\Microsoft.
*
* @coversDefaultClass \PhpOffice\PhpWord\Shared\Microsoft
*/
class PasswordEncoderTest extends \PHPUnit\Framework\TestCase
{

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared;
namespace PhpOffice\PhpWordTests\Shared;
use PhpOffice\PhpWord\Shared\Text;
/**
* Test class for Text.

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared;
namespace PhpOffice\PhpWordTests\Shared;
use Exception;
use InvalidArgumentException;
use PhpOffice\PhpWord\Shared\XMLReader;
/**
* Test class for XMLReader.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared;
namespace PhpOffice\PhpWordTests\Shared;
use PhpOffice\PhpWord\Shared\XMLWriter;
/**
* Test class for XMLWriter.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Shared;
namespace PhpOffice\PhpWordTests\Shared;
use PhpOffice\PhpWord\Settings;
use PhpOffice\PhpWord\Shared\ZipArchive;
/**
* Test class for PhpOffice\PhpWord\Shared\ZipArchive.

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use InvalidArgumentException;
use ReflectionClass;

View File

@ -15,8 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Cell;
use PhpOffice\PhpWord\SimpleType\VerticalJc;
/**

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Chart;
/**
* Test class for PhpOffice\PhpWord\Style\Chart.

View File

@ -15,11 +15,13 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWord\Style\Font;
use PhpOffice\PhpWord\Style\Language;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Style\Font.

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use InvalidArgumentException;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\Style\Image;
/**
* Test class for PhpOffice\PhpWord\Style\Image.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Indentation;
/**
* Test class for PhpOffice\PhpWord\Style\Indentation.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use InvalidArgumentException;
use PhpOffice\PhpWord\Style\Language;
use PHPUnit\Framework\Assert;
/**

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\LineNumbering;
/**
* Test class for PhpOffice\PhpWord\Style\LineNumbering.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Line;
/**
* Test class for PhpOffice\PhpWord\Style\Image.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\ListItem;
/**
* Test class for PhpOffice\PhpWord\Style\ListItem.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\Style\NumberingLevel;
/**
* Test class for PhpOffice\PhpWord\Style\NumberingLevel.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Numbering;
/**
* Test class for PhpOffice\PhpWord\Style\Numbering.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWord\Style\Paper;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Style\Paper.

View File

@ -15,11 +15,13 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\SimpleType\LineSpacingRule;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWord\Style\Paragraph;
use PhpOffice\PhpWord\Style\Tab;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Style\Paragraph.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Row;
/**
* Test class for PhpOffice\PhpWord\Style\Row.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\SimpleType\VerticalJc;
use PhpOffice\PhpWord\Style\Section;
/**
* Test class for PhpOffice\PhpWord\Style\Section.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Shading;
/**
* Test class for PhpOffice\PhpWord\Style\Shading.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Spacing;
/**
* Test class for PhpOffice\PhpWord\Style\Spacing.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\TOC;
/**
* Test class for PhpOffice\PhpWord\Style\TOC.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\Tab;
/**
* Test class for PhpOffice\PhpWord\Style\Tab.

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\Style\TablePosition;
/**
* Test class for PhpOffice\PhpWord\Style\Table.

View File

@ -15,11 +15,13 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use PhpOffice\PhpWord\ComplexType\TblWidth as TblWidthComplexType;
use PhpOffice\PhpWord\SimpleType\JcTable;
use PhpOffice\PhpWord\SimpleType\TblWidth;
use PhpOffice\PhpWord\Style\Table;
use PhpOffice\PhpWord\Style\TablePosition;
/**
* Test class for PhpOffice\PhpWord\Style\Table.

View File

@ -15,10 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Style;
namespace PhpOffice\PhpWordTests\Style;
use InvalidArgumentException;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\Style\TextBox;
/**
* Test class for PhpOffice\PhpWord\Style\Image.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\Style;
/**
* Test class for PhpOffice\PhpWord\Style.

View File

@ -15,12 +15,16 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use DOMDocument;
use Exception;
use PhpOffice\PhpWord\Element\Text;
use PhpOffice\PhpWord\Element\TextRun;
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Settings;
use PhpOffice\PhpWord\TemplateProcessor;
use ZipArchive;
/**

View File

@ -15,9 +15,12 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use PhpOffice\PhpWord\Exception\CreateTemporaryFileException;
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Settings;
use ZipArchive;
/**
@ -40,7 +43,7 @@ class TestHelperDOCX
* @param \PhpOffice\PhpWord\PhpWord $phpWord
* @param string $writerName
*
* @return \PhpOffice\PhpWord\XmlDocument
* @return \PhpOffice\PhpWordTests\XmlDocument
*/
public static function getDocument(PhpWord $phpWord, $writerName = 'Word2007')
{

View File

@ -15,7 +15,9 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord;
namespace PhpOffice\PhpWordTests;
use PhpOffice\PhpWord\TemplateProcessor;
/**
* This class is used to expose publicly methods that are otherwise private or protected.

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\HTML;
namespace PhpOffice\PhpWordTests\Writer\HTML;
use DateTime;
use DOMDocument;

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\HTML;
namespace PhpOffice\PhpWordTests\Writer\HTML;
use PhpOffice\PhpWord\Writer\HTML\Part\Body;

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\HTML;
namespace PhpOffice\PhpWordTests\Writer\HTML;
/**
* Test class for PhpOffice\PhpWord\Writer\HTML\Style subnamespace.

View File

@ -15,9 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer;
namespace PhpOffice\PhpWordTests\Writer;
use PhpOffice\PhpWord\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\Writer\HTML;
use PhpOffice\PhpWordTests\AbstractWebServerEmbeddedTest;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Settings;
use PhpOffice\PhpWord\SimpleType\Jc;

View File

@ -15,10 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\ODText\Style;
namespace PhpOffice\PhpWordTests\Writer\ODText\Style;
use PhpOffice\PhpWord\Style\Image;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Writer\ODText\Element\Image.

View File

@ -15,13 +15,13 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\ODText;
namespace PhpOffice\PhpWordTests\Writer\ODText;
use DateTime;
use PhpOffice\PhpWord\Element\TrackChange;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Shared\XMLWriter;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Writer\ODText\Element subnamespace.

View File

@ -15,7 +15,7 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\ODText\Part;
namespace PhpOffice\PhpWordTests\Writer\ODText\Part;
use Exception;
use PhpOffice\PhpWord\Writer\ODText;
@ -33,7 +33,7 @@ class AbstractPartTest extends \PHPUnit\Framework\TestCase
*/
public function testSetGetParentWriter(): void
{
$object = $this->getMockForAbstractClass('PhpOffice\\PhpWord\\Writer\\ODText\\Part\\AbstractPart');
$object = $this->getMockForAbstractClass(\PhpOffice\PhpWord\Writer\ODText\Part\AbstractPart::class);
$object->setParentWriter(new ODText());
self::assertEquals(new ODText(), $object->getParentWriter());
}
@ -45,7 +45,7 @@ class AbstractPartTest extends \PHPUnit\Framework\TestCase
{
$this->expectException(Exception::class);
$this->expectExceptionMessage('No parent WriterInterface assigned.');
$object = $this->getMockForAbstractClass('PhpOffice\\PhpWord\\Writer\\ODText\\Part\\AbstractPart');
$object = $this->getMockForAbstractClass(\PhpOffice\PhpWord\Writer\ODText\Part\AbstractPart::class);
$object->getParentWriter();
}
}

View File

@ -15,11 +15,11 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\ODText\Part;
namespace PhpOffice\PhpWordTests\Writer\ODText\Part;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Writer\ODText\Part\Content.

View File

@ -15,10 +15,10 @@
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
namespace PhpOffice\PhpWord\Writer\ODText\Style;
namespace PhpOffice\PhpWordTests\Writer\ODText\Style;
use PhpOffice\PhpWord\Style\Font;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWordTests\TestHelperDOCX;
/**
* Test class for Headers, Footers, Tabs in ODT.

Some files were not shown because too many files have changed in this diff Show More