diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9054a694..7c100977 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -165,7 +165,7 @@ jobs: coverage: "none" - name: "Test alt-autoload" - run: "php tests/AltAutoloadTest.php" + run: "php tests/AltAutoloading/AltAutoloadCheck.php" phpunit-lowest: name: "PHPUnit lowest deps (PHP ${{ matrix.php }})" diff --git a/.gitignore b/.gitignore index 241a7ed2..841b7199 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ debug* composer.lock /.php-cs-fixer.cache +/.phpunit.cache /.phpunit.result.cache diff --git a/composer.json b/composer.json index c91fab8c..e9f425fd 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ }, "autoload-dev": { "psr-4": { - "Tests\\Smalot\\PdfParser\\": "tests/" + "PerformanceTests\\": "tests/Performance/", + "PHPUnitTests\\": "tests/PHPUnit/" } }, "config": { diff --git a/phpunit-windows.xml b/phpunit-windows.xml index bddf09d4..c64623c4 100644 --- a/phpunit-windows.xml +++ b/phpunit-windows.xml @@ -25,7 +25,7 @@ <testsuites> <testsuite name="all"> - <directory>tests</directory> + <directory>tests/PHPUnit</directory> </testsuite> </testsuites> <filter> diff --git a/phpunit.xml b/phpunit.xml index c7dadfa5..3feaa53c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,35 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> - <!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --> -<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd" - backupGlobals="false" - backupStaticAttributes="false" - bootstrap="vendor/autoload.php" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false" - verbose="true" -> - <php> - <ini name="error_reporting" value="-1" /> - <ini name="zend.enable_gc" value="0"/> - <ini name="error_reporting" value="-1"/> - <ini name="intl.error_level" value="0"/> - <ini name="display_errors" value="On"/> - </php> - - <testsuites> - <testsuite name="all"> - <directory>tests</directory> - </testsuite> - </testsuites> - <filter> - <whitelist> - <directory>src</directory> - </whitelist> - </filter> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false"> + <coverage> + <include> + <directory>src</directory> + </include> + </coverage> + <php> + <ini name="error_reporting" value="-1"/> + <ini name="zend.enable_gc" value="0"/> + <ini name="error_reporting" value="-1"/> + <ini name="intl.error_level" value="0"/> + <ini name="display_errors" value="On"/> + </php> + <testsuites> + <testsuite name="all"> + <directory>tests/PHPUnit</directory> + </testsuite> + </testsuites> </phpunit> diff --git a/tests/AltAutoloadTest.php b/tests/AltAutoloading/AltAutoloadCheck.php similarity index 96% rename from tests/AltAutoloadTest.php rename to tests/AltAutoloading/AltAutoloadCheck.php index ec73b45d..d89c2b67 100644 --- a/tests/AltAutoloadTest.php +++ b/tests/AltAutoloading/AltAutoloadCheck.php @@ -28,7 +28,7 @@ * along with this program. * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -require __DIR__.'/../alt_autoload.php-dist'; +require __DIR__.'/../../alt_autoload.php-dist'; $parser = new Smalot\PdfParser\Parser(); diff --git a/tests/Integration/ConfigTest.php b/tests/PHPUnit/Integration/ConfigTest.php similarity index 95% rename from tests/Integration/ConfigTest.php rename to tests/PHPUnit/Integration/ConfigTest.php index 0f6d1bc8..7b0ecc8e 100644 --- a/tests/Integration/ConfigTest.php +++ b/tests/PHPUnit/Integration/ConfigTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Config; -use Tests\Smalot\PdfParser\TestCase; class ConfigTest extends TestCase { diff --git a/tests/Integration/DocumentTest.php b/tests/PHPUnit/Integration/DocumentTest.php similarity index 99% rename from tests/Integration/DocumentTest.php rename to tests/PHPUnit/Integration/DocumentTest.php index 7cfeec26..8ab48e30 100644 --- a/tests/Integration/DocumentTest.php +++ b/tests/PHPUnit/Integration/DocumentTest.php @@ -33,15 +33,15 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Document; use Smalot\PdfParser\Header; use Smalot\PdfParser\Page; use Smalot\PdfParser\Pages; use Smalot\PdfParser\Parser; use Smalot\PdfParser\PDFObject; -use Tests\Smalot\PdfParser\TestCase; class DocumentTest extends TestCase { diff --git a/tests/Integration/Element/ElementArrayTest.php b/tests/PHPUnit/Integration/Element/ElementArrayTest.php similarity index 98% rename from tests/Integration/Element/ElementArrayTest.php rename to tests/PHPUnit/Integration/Element/ElementArrayTest.php index 33145242..0b095a41 100644 --- a/tests/Integration/Element/ElementArrayTest.php +++ b/tests/PHPUnit/Integration/Element/ElementArrayTest.php @@ -33,14 +33,14 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Document; use Smalot\PdfParser\Element\ElementArray; use Smalot\PdfParser\Element\ElementNumeric; use Smalot\PdfParser\Header; use Smalot\PdfParser\Page; -use Tests\Smalot\PdfParser\TestCase; class ElementArrayTest extends TestCase { diff --git a/tests/Integration/Element/ElementBooleanTest.php b/tests/PHPUnit/Integration/Element/ElementBooleanTest.php similarity index 98% rename from tests/Integration/Element/ElementBooleanTest.php rename to tests/PHPUnit/Integration/Element/ElementBooleanTest.php index 3598b639..84d83cd8 100644 --- a/tests/Integration/Element/ElementBooleanTest.php +++ b/tests/PHPUnit/Integration/Element/ElementBooleanTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementBoolean; -use Tests\Smalot\PdfParser\TestCase; class ElementBooleanTest extends TestCase { diff --git a/tests/Integration/Element/ElementDateTest.php b/tests/PHPUnit/Integration/Element/ElementDateTest.php similarity index 98% rename from tests/Integration/Element/ElementDateTest.php rename to tests/PHPUnit/Integration/Element/ElementDateTest.php index fd03c34b..3f0d5e4e 100644 --- a/tests/Integration/Element/ElementDateTest.php +++ b/tests/PHPUnit/Integration/Element/ElementDateTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementDate; -use Tests\Smalot\PdfParser\TestCase; class ElementDateTest extends TestCase { diff --git a/tests/Integration/Element/ElementHexaTest.php b/tests/PHPUnit/Integration/Element/ElementHexaTest.php similarity index 97% rename from tests/Integration/Element/ElementHexaTest.php rename to tests/PHPUnit/Integration/Element/ElementHexaTest.php index 1f84ae96..fe990eba 100644 --- a/tests/Integration/Element/ElementHexaTest.php +++ b/tests/PHPUnit/Integration/Element/ElementHexaTest.php @@ -33,12 +33,12 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementDate; use Smalot\PdfParser\Element\ElementHexa; use Smalot\PdfParser\Element\ElementString; -use Tests\Smalot\PdfParser\TestCase; class ElementHexaTest extends TestCase { diff --git a/tests/Integration/Element/ElementMissingTest.php b/tests/PHPUnit/Integration/Element/ElementMissingTest.php similarity index 95% rename from tests/Integration/Element/ElementMissingTest.php rename to tests/PHPUnit/Integration/Element/ElementMissingTest.php index 9b8cfabf..0930cf5a 100644 --- a/tests/Integration/Element/ElementMissingTest.php +++ b/tests/PHPUnit/Integration/Element/ElementMissingTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementMissing; -use Tests\Smalot\PdfParser\TestCase; class ElementMissingTest extends TestCase { diff --git a/tests/Integration/Element/ElementNameTest.php b/tests/PHPUnit/Integration/Element/ElementNameTest.php similarity index 98% rename from tests/Integration/Element/ElementNameTest.php rename to tests/PHPUnit/Integration/Element/ElementNameTest.php index 7d8b6a3d..0f390836 100644 --- a/tests/Integration/Element/ElementNameTest.php +++ b/tests/PHPUnit/Integration/Element/ElementNameTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementName; -use Tests\Smalot\PdfParser\TestCase; class ElementNameTest extends TestCase { diff --git a/tests/Integration/Element/ElementNullTest.php b/tests/PHPUnit/Integration/Element/ElementNullTest.php similarity index 97% rename from tests/Integration/Element/ElementNullTest.php rename to tests/PHPUnit/Integration/Element/ElementNullTest.php index f07060f1..4a70a81c 100644 --- a/tests/Integration/Element/ElementNullTest.php +++ b/tests/PHPUnit/Integration/Element/ElementNullTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementNull; -use Tests\Smalot\PdfParser\TestCase; class ElementNullTest extends TestCase { diff --git a/tests/Integration/Element/ElementNumericTest.php b/tests/PHPUnit/Integration/Element/ElementNumericTest.php similarity index 98% rename from tests/Integration/Element/ElementNumericTest.php rename to tests/PHPUnit/Integration/Element/ElementNumericTest.php index fec45ca4..c9b4e7ab 100644 --- a/tests/Integration/Element/ElementNumericTest.php +++ b/tests/PHPUnit/Integration/Element/ElementNumericTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementNumeric; -use Tests\Smalot\PdfParser\TestCase; class ElementNumericTest extends TestCase { diff --git a/tests/Integration/Element/ElementStringTest.php b/tests/PHPUnit/Integration/Element/ElementStringTest.php similarity index 98% rename from tests/Integration/Element/ElementStringTest.php rename to tests/PHPUnit/Integration/Element/ElementStringTest.php index 36d83eae..61d3ad6b 100644 --- a/tests/Integration/Element/ElementStringTest.php +++ b/tests/PHPUnit/Integration/Element/ElementStringTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementString; -use Tests\Smalot\PdfParser\TestCase; class ElementStringTest extends TestCase { diff --git a/tests/Integration/Element/ElementStructTest.php b/tests/PHPUnit/Integration/Element/ElementStructTest.php similarity index 97% rename from tests/Integration/Element/ElementStructTest.php rename to tests/PHPUnit/Integration/Element/ElementStructTest.php index a3b4a0f9..aa5c994b 100644 --- a/tests/Integration/Element/ElementStructTest.php +++ b/tests/PHPUnit/Integration/Element/ElementStructTest.php @@ -33,11 +33,11 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementStruct; use Smalot\PdfParser\Header; -use Tests\Smalot\PdfParser\TestCase; class ElementStructTest extends TestCase { diff --git a/tests/Integration/Element/ElementXRefTest.php b/tests/PHPUnit/Integration/Element/ElementXRefTest.php similarity index 97% rename from tests/Integration/Element/ElementXRefTest.php rename to tests/PHPUnit/Integration/Element/ElementXRefTest.php index 978c901c..b420ad9d 100644 --- a/tests/Integration/Element/ElementXRefTest.php +++ b/tests/PHPUnit/Integration/Element/ElementXRefTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\Element; +namespace PHPUnitTests\Integration\Element; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element\ElementXRef; -use Tests\Smalot\PdfParser\TestCase; class ElementXRefTest extends TestCase { diff --git a/tests/Integration/ElementTest.php b/tests/PHPUnit/Integration/ElementTest.php similarity index 98% rename from tests/Integration/ElementTest.php rename to tests/PHPUnit/Integration/ElementTest.php index 72aa8e49..2b40b7e7 100644 --- a/tests/Integration/ElementTest.php +++ b/tests/PHPUnit/Integration/ElementTest.php @@ -33,8 +33,9 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element; use Smalot\PdfParser\Element\ElementArray; use Smalot\PdfParser\Element\ElementBoolean; @@ -45,7 +46,6 @@ use Smalot\PdfParser\Element\ElementString; use Smalot\PdfParser\Element\ElementXRef; use Smalot\PdfParser\Header; -use Tests\Smalot\PdfParser\TestCase; class ElementTest extends TestCase { diff --git a/tests/Integration/EncodingTest.php b/tests/PHPUnit/Integration/EncodingTest.php similarity index 97% rename from tests/Integration/EncodingTest.php rename to tests/PHPUnit/Integration/EncodingTest.php index 8a61def8..07411790 100644 --- a/tests/Integration/EncodingTest.php +++ b/tests/PHPUnit/Integration/EncodingTest.php @@ -33,16 +33,16 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; use Exception; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Document; use Smalot\PdfParser\Element; use Smalot\PdfParser\Encoding; use Smalot\PdfParser\Encoding\StandardEncoding; use Smalot\PdfParser\Exception\EncodingNotFoundException; use Smalot\PdfParser\Header; -use Tests\Smalot\PdfParser\TestCase; class EncodingTest extends TestCase { diff --git a/tests/Integration/FontTest.php b/tests/PHPUnit/Integration/FontTest.php similarity index 99% rename from tests/Integration/FontTest.php rename to tests/PHPUnit/Integration/FontTest.php index 4dcfd9ae..cc5a3f86 100644 --- a/tests/Integration/FontTest.php +++ b/tests/PHPUnit/Integration/FontTest.php @@ -33,8 +33,9 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Config; use Smalot\PdfParser\Document; use Smalot\PdfParser\Element; @@ -42,7 +43,6 @@ use Smalot\PdfParser\Font; use Smalot\PdfParser\Header; use Smalot\PdfParser\PDFObject; -use Tests\Smalot\PdfParser\TestCase; class FontTest extends TestCase { diff --git a/tests/Integration/HeaderTest.php b/tests/PHPUnit/Integration/HeaderTest.php similarity index 98% rename from tests/Integration/HeaderTest.php rename to tests/PHPUnit/Integration/HeaderTest.php index 0fb3fc33..c18e7a35 100644 --- a/tests/Integration/HeaderTest.php +++ b/tests/PHPUnit/Integration/HeaderTest.php @@ -33,15 +33,15 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Element; use Smalot\PdfParser\Element\ElementMissing; use Smalot\PdfParser\Element\ElementName; use Smalot\PdfParser\Header; use Smalot\PdfParser\Page; use Smalot\PdfParser\PDFObject; -use Tests\Smalot\PdfParser\TestCase; /** * Class Header diff --git a/tests/Integration/PDFObjectTest.php b/tests/PHPUnit/Integration/PDFObjectTest.php similarity index 98% rename from tests/Integration/PDFObjectTest.php rename to tests/PHPUnit/Integration/PDFObjectTest.php index 2bb75284..97741675 100644 --- a/tests/Integration/PDFObjectTest.php +++ b/tests/PHPUnit/Integration/PDFObjectTest.php @@ -33,11 +33,11 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Document; use Smalot\PdfParser\PDFObject; -use Tests\Smalot\PdfParser\TestCase; class PDFObjectTest extends TestCase { diff --git a/tests/Integration/PageTest.php b/tests/PHPUnit/Integration/PageTest.php similarity index 99% rename from tests/Integration/PageTest.php rename to tests/PHPUnit/Integration/PageTest.php index f5619c42..e94723d4 100644 --- a/tests/Integration/PageTest.php +++ b/tests/PHPUnit/Integration/PageTest.php @@ -33,14 +33,14 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Config; use Smalot\PdfParser\Document; use Smalot\PdfParser\Element\ElementMissing; use Smalot\PdfParser\Font; use Smalot\PdfParser\Page; -use Tests\Smalot\PdfParser\TestCase; class PageTest extends TestCase { diff --git a/tests/Integration/ParserTest.php b/tests/PHPUnit/Integration/ParserTest.php similarity index 99% rename from tests/Integration/ParserTest.php rename to tests/PHPUnit/Integration/ParserTest.php index cca3aa3b..45a97f52 100644 --- a/tests/Integration/ParserTest.php +++ b/tests/PHPUnit/Integration/ParserTest.php @@ -33,13 +33,13 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration; +namespace PHPUnitTests\Integration; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Config; use Smalot\PdfParser\Document; use Smalot\PdfParser\Parser; use Smalot\PdfParser\XObject\Image; -use Tests\Smalot\PdfParser\TestCase; class ParserTest extends TestCase { diff --git a/tests/Integration/RawData/FilterHelperTest.php b/tests/PHPUnit/Integration/RawData/FilterHelperTest.php similarity index 98% rename from tests/Integration/RawData/FilterHelperTest.php rename to tests/PHPUnit/Integration/RawData/FilterHelperTest.php index caa5eeae..81c71309 100644 --- a/tests/Integration/RawData/FilterHelperTest.php +++ b/tests/PHPUnit/Integration/RawData/FilterHelperTest.php @@ -33,10 +33,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\RawData; +namespace PHPUnitTests\Integration\RawData; +use PHPUnitTests\TestCase; use Smalot\PdfParser\RawData\FilterHelper; -use Tests\Smalot\PdfParser\TestCase; class FilterHelperTest extends TestCase { diff --git a/tests/Integration/RawData/RawDataParserTest.php b/tests/PHPUnit/Integration/RawData/RawDataParserTest.php similarity index 98% rename from tests/Integration/RawData/RawDataParserTest.php rename to tests/PHPUnit/Integration/RawData/RawDataParserTest.php index c3987dfe..17c64d30 100644 --- a/tests/Integration/RawData/RawDataParserTest.php +++ b/tests/PHPUnit/Integration/RawData/RawDataParserTest.php @@ -33,11 +33,11 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Integration\RawData; +namespace PHPUnitTests\Integration\RawData; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Config; use Smalot\PdfParser\RawData\RawDataParser; -use Tests\Smalot\PdfParser\TestCase; class RawDataParserHelper extends RawDataParser { diff --git a/tests/TestCase.php b/tests/PHPUnit/TestCase.php similarity index 96% rename from tests/TestCase.php rename to tests/PHPUnit/TestCase.php index 34d0fab5..08d4739a 100644 --- a/tests/TestCase.php +++ b/tests/PHPUnit/TestCase.php @@ -33,7 +33,7 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser; +namespace PHPUnitTests; use PHPUnit\Framework\TestCase as PHPTestCase; use Smalot\PdfParser\Config; @@ -54,7 +54,7 @@ protected function setUp(): void { parent::setUp(); - $this->rootDir = __DIR__.'/..'; + $this->rootDir = __DIR__.'/../..'; } protected function getDocumentInstance(): Document diff --git a/tests/Unit/ConfigTest.php b/tests/PHPUnit/Unit/ConfigTest.php similarity index 96% rename from tests/Unit/ConfigTest.php rename to tests/PHPUnit/Unit/ConfigTest.php index 8cbbf321..133c7eb1 100644 --- a/tests/Unit/ConfigTest.php +++ b/tests/PHPUnit/Unit/ConfigTest.php @@ -29,10 +29,10 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Unit; +namespace PHPUnitTests\Unit; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Config; -use Tests\Smalot\PdfParser\TestCase; class ConfigTest extends TestCase { diff --git a/tests/Unit/DocumentTest.php b/tests/PHPUnit/Unit/DocumentTest.php similarity index 78% rename from tests/Unit/DocumentTest.php rename to tests/PHPUnit/Unit/DocumentTest.php index 80f7a8a3..e28ee9c7 100644 --- a/tests/Unit/DocumentTest.php +++ b/tests/PHPUnit/Unit/DocumentTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Tests\Smalot\PdfParser\Unit; +namespace PHPUnitTests\Unit; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Document; -use Tests\Smalot\PdfParser\TestCase; class DocumentTest extends TestCase { diff --git a/tests/Unit/EncodingTest.php b/tests/PHPUnit/Unit/EncodingTest.php similarity index 80% rename from tests/Unit/EncodingTest.php rename to tests/PHPUnit/Unit/EncodingTest.php index 36566a2a..7116b5dc 100644 --- a/tests/Unit/EncodingTest.php +++ b/tests/PHPUnit/Unit/EncodingTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Tests\Smalot\PdfParser\Unit; +namespace PHPUnitTests\Unit; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Document; use Smalot\PdfParser\Encoding; -use Tests\Smalot\PdfParser\TestCase; class EncodingTest extends TestCase { diff --git a/tests/Unit/PDFObjectTest.php b/tests/PHPUnit/Unit/PDFObjectTest.php similarity index 87% rename from tests/Unit/PDFObjectTest.php rename to tests/PHPUnit/Unit/PDFObjectTest.php index 593f3ec9..9d1abdde 100644 --- a/tests/Unit/PDFObjectTest.php +++ b/tests/PHPUnit/Unit/PDFObjectTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Tests\Smalot\PdfParser\Unit; +namespace PHPUnitTests\Unit; +use PHPUnitTests\TestCase; use Smalot\PdfParser\Document; use Smalot\PdfParser\Page; use Smalot\PdfParser\PDFObject; -use Tests\Smalot\PdfParser\TestCase; class PDFObjectTest extends TestCase { diff --git a/tests/Performance/Test/AbstractPerformanceTest.php b/tests/Performance/AbstractPerformanceTestClass.php similarity index 79% rename from tests/Performance/Test/AbstractPerformanceTest.php rename to tests/Performance/AbstractPerformanceTestClass.php index 51a3907e..a7b04d7f 100644 --- a/tests/Performance/Test/AbstractPerformanceTest.php +++ b/tests/Performance/AbstractPerformanceTestClass.php @@ -1,8 +1,8 @@ <?php -namespace Tests\Smalot\PdfParser\Performance\Test; +namespace PerformanceTests; -abstract class AbstractPerformanceTest +abstract class AbstractPerformanceTestClass { /** * Initializes the test (eg, fetches the files etc). diff --git a/tests/Performance/Exception/PerformanceFailException.php b/tests/Performance/Exception/PerformanceFailException.php index 298e200d..7b794497 100644 --- a/tests/Performance/Exception/PerformanceFailException.php +++ b/tests/Performance/Exception/PerformanceFailException.php @@ -1,6 +1,6 @@ <?php -namespace Tests\Smalot\PdfParser\Performance\Exception; +namespace PerformanceTests\Exception; class PerformanceFailException extends \Exception { diff --git a/tests/Performance/Test/DocumentDictionaryCacheTest.php b/tests/Performance/Test/DocumentDictionaryCacheTest.php index 8b03223a..ec9791cf 100644 --- a/tests/Performance/Test/DocumentDictionaryCacheTest.php +++ b/tests/Performance/Test/DocumentDictionaryCacheTest.php @@ -33,9 +33,9 @@ * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ -namespace Tests\Smalot\PdfParser\Performance\Test; +namespace PerformanceTests\Test; -use Smalot\PdfParser\Page; +use PerformanceTests\AbstractPerformanceTestClass; use Smalot\PdfParser\Parser; /** @@ -44,7 +44,7 @@ * to cache the objects inside the PDF file, then the parsing should be quick. * If it does not, the parsing can be extensively slow or even crash. */ -class DocumentDictionaryCacheTest extends AbstractPerformanceTest +class DocumentDictionaryCacheTest extends AbstractPerformanceTestClass { /** * @var Parser diff --git a/tests/Performance/runPerformanceTests.php b/tests/Performance/runPerformanceTests.php index e91b5193..7f34b60a 100644 --- a/tests/Performance/runPerformanceTests.php +++ b/tests/Performance/runPerformanceTests.php @@ -2,15 +2,14 @@ require __DIR__.'/../../vendor/autoload.php'; -use Tests\Smalot\PdfParser\Performance\Exception\PerformanceFailException; -use Tests\Smalot\PdfParser\Performance\Test\AbstractPerformanceTest; -use Tests\Smalot\PdfParser\Performance\Test\DocumentDictionaryCacheTest; +use PerformanceTests\Exception\PerformanceFailException; +use PerformanceTests\Test\DocumentDictionaryCacheTest; $tests = [ new DocumentDictionaryCacheTest(), ]; -foreach ($tests as $test) { /* @var $test AbstractPerformanceTest */ +foreach ($tests as $test) { $test->init(); $startTime = microtime(true);