Skip to content

Test against newer PHP versions and use require/autoload-dev #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: php
dist: trusty
php:
- "7.4"
- "7.3"
- "7.2"
- "7.1"
- "7.0"
- "5.6"
Expand Down
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
"mikehaertl/php-shellcommand": "^1.5.0",
"mikehaertl/php-tmpfile": "^1.1.0"
},
"require-dev": {
"phpunit/phpunit": ">4.0 <8"
},
"autoload": {
"psr-4": {
"mikehaertl\\pdftk\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"tests\\": "tests"
}
}
}
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/bootstrap.php"
>
<testsuites>
Expand Down
13 changes: 8 additions & 5 deletions tests/CommandTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
namespace tests;

use PHPUnit\Framework\TestCase;
use mikehaertl\pdftk\Command;

class CommandTest extends \PHPUnit\Framework\TestCase
class CommandTest extends TestCase
{
public function setUp()
{
Expand All @@ -26,7 +29,7 @@ public function testCanAddFiles()
$this->assertTrue($command->execute($file));
$this->assertFileExists($file);

$this->assertEquals("pdftk A='$document1' B='$document2' input_pw B='complex'\''\"password' output '$file'", (string) $command);
$this->assertEquals("pdftk 'A'='$document1' 'B'='$document2' 'input_pw' 'B'='complex'\''\"password' 'output' '$file'", (string) $command);
}

public function testCanAddOptions()
Expand All @@ -42,7 +45,7 @@ public function testCanAddOptions()
$this->assertTrue($command->execute($file));
$this->assertFileExists($file);

$this->assertEquals("pdftk A='$document1' output '$file' encrypt_40bit allow Printing owner_pw 'complex'\''\"password'", (string) $command);
$this->assertEquals("pdftk 'A'='$document1' 'output' '$file' 'encrypt_40bit' allow Printing 'owner_pw' 'complex'\''\"password'", (string) $command);
}

public function testCanSetAndGetOperationAndArgument()
Expand All @@ -59,7 +62,7 @@ public function testCanSetAndGetOperationAndArgument()

$this->assertEquals('cat', $command->getOperation());
$this->assertEquals('A', $command->getOperationArgument());
$this->assertEquals("pdftk A='$document1' cat A output '$file'", (string) $command);
$this->assertEquals("pdftk 'A'='$document1' cat A 'output' '$file'", (string) $command);
}

public function testCanAddPageRanges()
Expand All @@ -86,7 +89,7 @@ public function testCanAddPageRanges()
$this->assertTrue($command->execute($file));
$this->assertFileExists($file);

$this->assertEquals("pdftk A='$document1' cat 1 A1 1-3 1-3even 1-3evennorth 1-3north A1-3 A1-3even A1-3oddeast A1-3east 1-3east 1 3 A1 A3 output '$file'", (string) $command);
$this->assertEquals("pdftk 'A'='$document1' cat 1 A1 1-3 1-3even 1-3evennorth 1-3north A1-3 A1-3even A1-3oddeast A1-3east 1-3east 1 3 A1 A3 'output' '$file'", (string) $command);
}

protected function getDocument1()
Expand Down
5 changes: 4 additions & 1 deletion tests/DataFieldsTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
namespace tests;

use PHPUnit\Framework\TestCase;
use mikehaertl\pdftk\DataFields;

class DataFieldsTest extends \PHPUnit\Framework\TestCase
class DataFieldsTest extends TestCase
{
public function testDataFieldParsing()
{
Expand Down
5 changes: 4 additions & 1 deletion tests/FdfFileTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
namespace tests;

use PHPUnit\Framework\TestCase;
use mikehaertl\pdftk\FdfFile;

class FdfFileTest extends \PHPUnit\Framework\TestCase
class FdfFileTest extends TestCase
{
public function testFdfFileCreation()
{
Expand Down
5 changes: 4 additions & 1 deletion tests/InfoFieldsTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
namespace tests;

use PHPUnit\Framework\TestCase;
use mikehaertl\pdftk\InfoFields;

class InfoFieldsTest extends \PHPUnit\Framework\TestCase
class InfoFieldsTest extends TestCase
{
public function testInfoFieldParsing()
{
Expand Down
5 changes: 4 additions & 1 deletion tests/InfoFileTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
namespace tests;

use PHPUnit\Framework\TestCase;
use mikehaertl\pdftk\InfoFile;

class InfoFileTest extends \PHPUnit\Framework\TestCase
class InfoFileTest extends TestCase
{
public function testInfoFileCreation()
{
Expand Down
Loading