Skip to content

Commit 060f40d

Browse files
authored
Merge pull request #176 from mikehaertl/refine-test-config
Test against newer PHP versions and use require/autoload-dev
2 parents 4329df4 + 35d976d commit 060f40d

10 files changed

+75
-44
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
language: php
22
dist: trusty
33
php:
4+
- "7.4"
5+
- "7.3"
6+
- "7.2"
47
- "7.1"
58
- "7.0"
69
- "5.6"

composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@
1515
"mikehaertl/php-shellcommand": "^1.5.0",
1616
"mikehaertl/php-tmpfile": "^1.1.0"
1717
},
18+
"require-dev": {
19+
"phpunit/phpunit": ">4.0 <8"
20+
},
1821
"autoload": {
1922
"psr-4": {
2023
"mikehaertl\\pdftk\\": "src/"
2124
}
25+
},
26+
"autoload-dev": {
27+
"psr-4": {
28+
"tests\\": "tests"
29+
}
2230
}
2331
}

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="./tests/bootstrap.php"
1312
>
1413
<testsuites>

tests/CommandTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
2+
namespace tests;
3+
4+
use PHPUnit\Framework\TestCase;
25
use mikehaertl\pdftk\Command;
36

4-
class CommandTest extends \PHPUnit\Framework\TestCase
7+
class CommandTest extends TestCase
58
{
69
public function setUp()
710
{
@@ -26,7 +29,7 @@ public function testCanAddFiles()
2629
$this->assertTrue($command->execute($file));
2730
$this->assertFileExists($file);
2831

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

3235
public function testCanAddOptions()
@@ -42,7 +45,7 @@ public function testCanAddOptions()
4245
$this->assertTrue($command->execute($file));
4346
$this->assertFileExists($file);
4447

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

4851
public function testCanSetAndGetOperationAndArgument()
@@ -59,7 +62,7 @@ public function testCanSetAndGetOperationAndArgument()
5962

6063
$this->assertEquals('cat', $command->getOperation());
6164
$this->assertEquals('A', $command->getOperationArgument());
62-
$this->assertEquals("pdftk A='$document1' cat A output '$file'", (string) $command);
65+
$this->assertEquals("pdftk 'A'='$document1' cat A 'output' '$file'", (string) $command);
6366
}
6467

6568
public function testCanAddPageRanges()
@@ -86,7 +89,7 @@ public function testCanAddPageRanges()
8689
$this->assertTrue($command->execute($file));
8790
$this->assertFileExists($file);
8891

89-
$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);
92+
$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);
9093
}
9194

9295
protected function getDocument1()

tests/DataFieldsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
2+
namespace tests;
3+
4+
use PHPUnit\Framework\TestCase;
25
use mikehaertl\pdftk\DataFields;
36

4-
class DataFieldsTest extends \PHPUnit\Framework\TestCase
7+
class DataFieldsTest extends TestCase
58
{
69
public function testDataFieldParsing()
710
{

tests/FdfFileTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
2+
namespace tests;
3+
4+
use PHPUnit\Framework\TestCase;
25
use mikehaertl\pdftk\FdfFile;
36

4-
class FdfFileTest extends \PHPUnit\Framework\TestCase
7+
class FdfFileTest extends TestCase
58
{
69
public function testFdfFileCreation()
710
{

tests/InfoFieldsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
2+
namespace tests;
3+
4+
use PHPUnit\Framework\TestCase;
25
use mikehaertl\pdftk\InfoFields;
36

4-
class InfoFieldsTest extends \PHPUnit\Framework\TestCase
7+
class InfoFieldsTest extends TestCase
58
{
69
public function testInfoFieldParsing()
710
{

tests/InfoFileTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
2+
namespace tests;
3+
4+
use PHPUnit\Framework\TestCase;
25
use mikehaertl\pdftk\InfoFile;
36

4-
class InfoFileTest extends \PHPUnit\Framework\TestCase
7+
class InfoFileTest extends TestCase
58
{
69
public function testInfoFileCreation()
710
{

0 commit comments

Comments
 (0)