Skip to content

Commit

Permalink
Merge pull request #230 from NiR-/drop-unsupported-php-versions
Browse files Browse the repository at this point in the history
Drop unsupported PHP versions from Travis builds
  • Loading branch information
Albin Kerouanton committed Dec 7, 2018
2 parents fc8c4b9 + cb14466 commit 7f1bbce
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 55 deletions.
20 changes: 7 additions & 13 deletions .travis.yml
@@ -1,27 +1,21 @@
language: php
dist: trusty

sudo: false

cache:
directories:
- $HOME/.composer/cache

php:
- 5.6
- 7.0
- 7.1
- hhvm

- 7.2
- 7.3

matrix:
include:
- php: 5.6
env: SYMFONY_VERSION="3.4.*@dev"
- php: 7.0
env: SYMFONY_VERSION="2.8.*@dev symfony/phpunit-bridge:~2.7"
- php: 7.1
env: SYMFONY_VERSION="2.7.*@dev"
- php: 7.1
env: SYMFONY_VERSION="4.3.*@dev"
- php: 7.3
env: SYMFONY_VERSION="3.4.*@dev"
- php: 7.2
env: DEPENDENCIES=beta
fast_finish: true

Expand Down
28 changes: 14 additions & 14 deletions Tests/Snappy/Generator/LoggableGeneratorTest.php
Expand Up @@ -12,7 +12,7 @@ class LoggableGeneratorTest extends TestCase
{
public function testGenerate()
{
$internal = $this->getMock('Knp\Snappy\GeneratorInterface');
$internal = $this->createMock('Knp\Snappy\GeneratorInterface');
$internal
->expects($this->once())
->method('generate')
Expand All @@ -23,7 +23,7 @@ public function testGenerate()
$this->equalTo(true)
);

$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger
->expects($this->once())
->method('debug')
Expand All @@ -35,7 +35,7 @@ public function testGenerate()

public function testGenerateFromHtml()
{
$internal = $this->getMock('Knp\Snappy\GeneratorInterface');
$internal = $this->createMock('Knp\Snappy\GeneratorInterface');
$internal
->expects($this->once())
->method('generateFromHtml')
Expand All @@ -46,7 +46,7 @@ public function testGenerateFromHtml()
$this->equalTo(true)
);

$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger
->expects($this->once())
->method('debug')
Expand All @@ -58,7 +58,7 @@ public function testGenerateFromHtml()

public function testGenerateFromHtmlWithHtmlArray()
{
$internal = $this->getMock('Knp\Snappy\GeneratorInterface');
$internal = $this->createMock('Knp\Snappy\GeneratorInterface');
$internal
->expects($this->once())
->method('generateFromHtml')
Expand All @@ -69,7 +69,7 @@ public function testGenerateFromHtmlWithHtmlArray()
$this->equalTo(true)
);

$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger
->expects($this->once())
->method('debug')
Expand All @@ -81,7 +81,7 @@ public function testGenerateFromHtmlWithHtmlArray()

public function testOutput()
{
$internal = $this->getMock('Knp\Snappy\GeneratorInterface');
$internal = $this->createMock('Knp\Snappy\GeneratorInterface');
$internal
->expects($this->once())
->method('getOutput')
Expand All @@ -90,7 +90,7 @@ public function testOutput()
$this->equalTo(['foo' => 'bar'])
);

$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger
->expects($this->once())
->method('debug')
Expand All @@ -102,7 +102,7 @@ public function testOutput()

public function testOutputFromHtml()
{
$internal = $this->getMock('Knp\Snappy\GeneratorInterface');
$internal = $this->createMock('Knp\Snappy\GeneratorInterface');
$internal
->expects($this->once())
->method('getOutputFromHtml')
Expand All @@ -111,7 +111,7 @@ public function testOutputFromHtml()
$this->equalTo(['foo' => 'bar'])
);

$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger
->expects($this->once())
->method('debug')
Expand All @@ -123,7 +123,7 @@ public function testOutputFromHtml()

public function testOutputFromHtmlWithHtmlArray()
{
$internal = $this->getMock('Knp\Snappy\GeneratorInterface');
$internal = $this->createMock('Knp\Snappy\GeneratorInterface');
$internal
->expects($this->once())
->method('getOutputFromHtml')
Expand All @@ -132,7 +132,7 @@ public function testOutputFromHtmlWithHtmlArray()
$this->equalTo(['foo' => 'bar'])
);

$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger
->expects($this->once())
->method('debug')
Expand All @@ -144,7 +144,7 @@ public function testOutputFromHtmlWithHtmlArray()

public function testSetOption()
{
$internal = $this->getMock('Knp\Snappy\Image');
$internal = $this->createMock('Knp\Snappy\Image');
$internal
->expects($this->at(0))
->method('setOption')
Expand All @@ -160,7 +160,7 @@ public function testSetOption()
$this->equalTo(['bar'=>'baz'])
);

$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger
->expects($this->at(0))
->method('debug')
Expand Down
6 changes: 3 additions & 3 deletions Tests/Snappy/Response/JpegResponseTest.php
Expand Up @@ -14,7 +14,7 @@ public function testDefaultParameters()
$this->assertSame(200, $response->getStatusCode());
$this->assertSame('some_binary_output', $response->getContent());
$this->assertSame('image/jpg', $response->headers->get('Content-Type'));
$this->assertSame('inline; filename="output.jpg"', $response->headers->get('Content-Disposition'));
$this->assertSame('inline; filename=output.jpg', str_replace('"', '', $response->headers->get('Content-Disposition')));
}

public function testSetDifferentMimeType()
Expand All @@ -28,9 +28,9 @@ public function testSetDifferentFileName()
{
$fileName = 'test.jpg';
$response = new JpegResponse('some_binary_output', $fileName);
$fileNameFromDispositionRegex = '/.*filename="([^"]+)"/';
$fileNameFromDispositionRegex = '/.*filename=([^"]+)/';

$this->assertSame(1, preg_match($fileNameFromDispositionRegex, $response->headers->get('Content-Disposition'), $matches), 1);
$this->assertSame(1, preg_match($fileNameFromDispositionRegex, str_replace('"', '', $response->headers->get('Content-Disposition')), $matches), 1);

$this->assertSame($fileName, $matches[1]);
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/Snappy/Response/PdfResponseTest.php
Expand Up @@ -14,7 +14,7 @@ public function testDefaultParameters()
$this->assertSame(200, $response->getStatusCode());
$this->assertSame('some_binary_output', $response->getContent());
$this->assertSame('application/pdf', $response->headers->get('Content-Type'));
$this->assertSame('attachment; filename="output.pdf"', $response->headers->get('Content-Disposition'));
$this->assertSame('attachment; filename=output.pdf', str_replace('"', '', $response->headers->get('Content-Disposition')));
}

public function testSetDifferentMimeType()
Expand All @@ -28,9 +28,9 @@ public function testSetDifferentFileName()
{
$fileName = 'test.pdf';
$response = new PdfResponse('some_binary_output', $fileName);
$fileNameFromDispositionRegex = '/.*filename="([^"]+)"/';
$fileNameFromDispositionRegex = '/.*filename=([^"]+)/';

$this->assertSame(1, preg_match($fileNameFromDispositionRegex, $response->headers->get('Content-Disposition'), $matches), 1);
$this->assertSame(1, preg_match($fileNameFromDispositionRegex, str_replace('"', '', $response->headers->get('Content-Disposition')), $matches), 1);

$this->assertSame($fileName, $matches[1]);
}
Expand Down
1 change: 0 additions & 1 deletion Tests/fixtures/config/base.yml
Expand Up @@ -5,4 +5,3 @@ framework:
validation: { enabled: true, enable_annotations: true }
templating: { engines: ['php'] } #assets_version: SomeVersionScheme
session: ~
translator: { fallback: en }
7 changes: 4 additions & 3 deletions composer.json
Expand Up @@ -18,7 +18,7 @@
],

"require": {
"php": ">=5.6",
"php": ">=7.1",
"symfony/framework-bundle": "~2.7|~3.0|^4.0",
"knplabs/knp-snappy": "~1.0,>=1.0.1"
},
Expand All @@ -36,11 +36,12 @@
},
"require-dev": {
"doctrine/annotations": "~1.0",
"phpunit/phpunit": "~4.8.35",
"phpunit/phpunit": "~7.4",
"symfony/asset": "~2.7|~3.0|^4.0",
"symfony/finder": "~2.7|~3.0|^4.0",
"symfony/security-csrf": "~2.7|~3.0|^4.0",
"symfony/templating": "~2.7|~3.0|^4.0",
"symfony/validator": "~2.7|~3.0|^4.0"
"symfony/validator": "~2.7|~3.0|^4.0",
"symfony/yaml": "~3.0|~4.0"
}
}
19 changes: 1 addition & 18 deletions phpunit.xml.dist
Expand Up @@ -11,28 +11,11 @@
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "./Tests/bootstrap.php.dist" >
bootstrap = "vendor/autoload.php" >

<testsuites>
<testsuite name="KnpSnappyBundle Test Suite">
<directory>./Tests</directory>
</testsuite>
</testsuites>

<php>
<server name="SYMFONY" value="./Resources/vendor/symfony/src" />
<server name="SNAPPY" value="./Resources/vendor/snappy/src" />
</php>


<filter>
<whitelist>
<directory>.</directory>
<exclude>
<directory>./Tests</directory>
</exclude>
</whitelist>
</filter>

</phpunit>

0 comments on commit 7f1bbce

Please sign in to comment.