Skip to content

Commit

Permalink
Merge a87f43c into 17c99de
Browse files Browse the repository at this point in the history
  • Loading branch information
svycka committed Oct 21, 2020
2 parents 17c99de + a87f43c commit 327b9d4
Show file tree
Hide file tree
Showing 44 changed files with 131 additions and 120 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/laminas-mkdoc-theme/
/phpunit.xml
/vendor/
.phpunit.result.cache
27 changes: 9 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,29 @@ cache:

env:
global:
- COMPOSER_ARGS="--no-interaction"
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- COVERAGE_DEPS="php-coveralls/php-coveralls"

matrix:
fast_finish: true
include:
- php: 5.6
- php: 7.3
env:
- DEPS=lowest
- REMOVE_DEV_DEPS="psr/http-factory"
- php: 5.6
- php: 7.3
env:
- DEPS=latest
- CS_CHECK=true
- TEST_COVERAGE=true
- REMOVE_DEV_DEPS="psr/http-factory"
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- DEPS=latest
- php: 7.1
- php: 7.4
env:
- DEPS=lowest
- php: 7.1
- php: 7.4
env:
- DEPS=latest
- CS_CHECK=true
- TEST_COVERAGE=true
- php: 7.2
env:
- DEPS=lowest
- php: 7.2
- php: 'nightly'
env:
- DEPS=latest

Expand All @@ -46,7 +37,7 @@ before_install:
- if [[ $REMOVE_DEV_DEPS != '' ]]; then travis_retry composer remove $COMPOSER_ARGS --dev --no-update $REMOVE_DEV_DEPS ; fi

install:
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
- travis_retry composer install $COMPOSER_ARGS
- if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.3 || ~8.0.0",
"laminas/laminas-stdlib": "^2.7.7 || ^3.1",
"laminas/laminas-zendframework-bridge": "^1.0"
},
Expand All @@ -35,7 +35,8 @@
"laminas/laminas-servicemanager": "^2.7.8 || ^3.3",
"laminas/laminas-uri": "^2.6",
"pear/archive_tar": "^1.4.3",
"phpunit/phpunit": "^5.7.23 || ^6.4.3",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.3",
"psr/http-factory": "^1.0"
},
"conflict": {
Expand Down
4 changes: 2 additions & 2 deletions test/Compress/Bz2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Bz2Test extends TestCase
{
public $target;

public function setUp()
public function setUp(): void
{
if (! extension_loaded('bz2')) {
$this->markTestSkipped('This adapter needs the bz2 extension');
Expand All @@ -25,7 +25,7 @@ public function setUp()
$this->target = sprintf('%s/%s.bz2', sys_get_temp_dir(), uniqid('laminasilter'));
}

public function tearDown()
public function tearDown(): void
{
if (file_exists($this->target)) {
unlink($this->target);
Expand Down
4 changes: 2 additions & 2 deletions test/Compress/GzTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GzTest extends TestCase
{
public $target;

public function setUp()
public function setUp(): void
{
if (! extension_loaded('zlib')) {
$this->markTestSkipped('This adapter needs the zlib extension');
Expand All @@ -25,7 +25,7 @@ public function setUp()
$this->target = sprintf('%s/%s.gz', sys_get_temp_dir(), uniqid('laminasilter'));
}

public function tearDown()
public function tearDown(): void
{
if (file_exists($this->target)) {
unlink($this->target);
Expand Down
2 changes: 1 addition & 1 deletion test/Compress/LzfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class LlaminasTest extends TestCase
{
public function setUp()
public function setUp(): void
{
if (! extension_loaded('llaminas')) {
$this->markTestSkipped('This adapter needs the llaminas extension');
Expand Down
4 changes: 2 additions & 2 deletions test/Compress/RarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RarTest extends TestCase
{
public $tmp;

public function setUp()
public function setUp(): void
{
if (! extension_loaded('rar')) {
$this->markTestSkipped('This adapter needs the rar extension');
Expand Down Expand Up @@ -48,7 +48,7 @@ public function setUp()
}
}

public function tearDown()
public function tearDown(): void
{
$files = [
$this->tmp . '/zipextracted.txt',
Expand Down
2 changes: 1 addition & 1 deletion test/Compress/SnappyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class SnappyTest extends TestCase
{
public function setUp()
public function setUp(): void
{
if (! extension_loaded('snappy')) {
$this->markTestSkipped('This adapter needs the snappy extension');
Expand Down
4 changes: 2 additions & 2 deletions test/Compress/TarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class TarTest extends TestCase
{
public $tmp;

public function setUp()
public function setUp(): void
{
$this->tmp = sprintf('%s/%s', sys_get_temp_dir(), uniqid('laminasilter'));
mkdir($this->tmp, 0775, true);
}

public function tearDown()
public function tearDown(): void
{
$files = [
$this->tmp . '/zipextracted.txt',
Expand Down
4 changes: 2 additions & 2 deletions test/Compress/ZipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class ZipTest extends TestCase
{
public function setUp()
public function setUp(): void
{
if (! extension_loaded('zip')) {
$this->markTestSkipped('This adapter needs the zip extension');
Expand Down Expand Up @@ -54,7 +54,7 @@ public function setUp()
}
}

public function tearDown()
public function tearDown(): void
{
$files = [
$this->tmp . '/compressed.zip',
Expand Down
4 changes: 2 additions & 2 deletions test/CompressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CompressTest extends TestCase
{
public $tmpDir;

public function setUp()
public function setUp(): void
{
if (! extension_loaded('bz2')) {
$this->markTestSkipped('This filter is tested with the bz2 extension');
Expand All @@ -26,7 +26,7 @@ public function setUp()
mkdir($this->tmpDir, 0775, true);
}

public function tearDown()
public function tearDown(): void
{
if (is_dir($this->tmpDir)) {
if (file_exists($this->tmpDir . '/compressed.bz2')) {
Expand Down
4 changes: 1 addition & 3 deletions test/DateSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ public function provideFilter()
];
}

/**
* @expectedException \Laminas\Filter\Exception\RuntimeException
*/
public function testInvalidInput()
{
$this->expectException(\Laminas\Filter\Exception\RuntimeException::class);
$sut = new DateSelectFilter();
$sut->filter(['year' => '2120', 'month' => '07']);
}
Expand Down
4 changes: 2 additions & 2 deletions test/DateTimeFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class DateTimeFormatterTest extends TestCase
{
protected $defaultTimezone;

public function setUp()
public function setUp(): void
{
$this->defaultTimezone = date_default_timezone_get();
}

public function tearDown()
public function tearDown(): void
{
date_default_timezone_set($this->defaultTimezone);
}
Expand Down
4 changes: 1 addition & 3 deletions test/DateTimeSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ public function provideFilter()
];
}

/**
* @expectedException \Laminas\Filter\Exception\RuntimeException
*/
public function testInvalidInput()
{
$this->expectException(\Laminas\Filter\Exception\RuntimeException::class);
$sut = new DateTimeSelectFilter();
$sut->filter(['year' => '2120', 'month' => '10', 'day' => '26', 'hour' => '12']);
}
Expand Down
4 changes: 2 additions & 2 deletions test/DecompressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DecompressTest extends TestCase
{
public $tmpDir;

public function setUp()
public function setUp(): void
{
if (! extension_loaded('bz2')) {
$this->markTestSkipped('This filter is tested with the bz2 extension');
Expand All @@ -25,7 +25,7 @@ public function setUp()
mkdir($this->tmpDir, 0775, true);
}

public function tearDown()
public function tearDown(): void
{
if (is_dir($this->tmpDir)) {
if (file_exists($this->tmpDir . '/compressed.bz2')) {
Expand Down
2 changes: 1 addition & 1 deletion test/DecryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class DecryptTest extends TestCase
{
public function setUp()
public function setUp(): void
{
if (! extension_loaded('mcrypt') && ! extension_loaded('openssl')) {
$this->markTestSkipped('This filter needs the mcrypt or openssl extension');
Expand Down
2 changes: 1 addition & 1 deletion test/DigitsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DigitsTest extends TestCase
*
* @return void
*/
public function setUp()
public function setUp(): void
{
if (null === static::$_unicodeEnabled) {
static::$_unicodeEnabled = (bool) @preg_match('/\pL/u', 'a');
Expand Down
8 changes: 4 additions & 4 deletions test/Encrypt/BlockCipherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class BlockCipherTest extends TestCase
{
public function setUp()
public function setUp(): void
{
if (! extension_loaded('mcrypt') && ! extension_loaded('openssl')) {
$this->markTestSkipped('This filter needs the mcrypt or openssl extension');
Expand Down Expand Up @@ -163,20 +163,20 @@ public function testSettingEncryptionOptions()
$filter->setEncryption(1234);
$filter->fail();
} catch (\Laminas\Filter\Exception\InvalidArgumentException $e) {
$this->assertContains('Invalid options argument', $e->getMessage());
$this->assertStringContainsString('Invalid options argument', $e->getMessage());
}

try {
$filter->setEncryption(['algorithm' => 'unknown']);
$filter->fail();
} catch (\Laminas\Filter\Exception\InvalidArgumentException $e) {
$this->assertContains('The algorithm', $e->getMessage());
$this->assertStringContainsString('The algorithm', $e->getMessage());
}

try {
$filter->setEncryption(['mode' => 'unknown']);
} catch (\Laminas\Filter\Exception\InvalidArgumentException $e) {
$this->assertContains('The mode', $e->getMessage());
$this->assertStringContainsString('The mode', $e->getMessage());
}
}

Expand Down
8 changes: 4 additions & 4 deletions test/Encrypt/OpensslTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class OpensslTest extends TestCase
{
public function setUp()
public function setUp(): void
{
if (! extension_loaded('openssl')) {
$this->markTestSkipped('This filter needs the openssl extension');
Expand Down Expand Up @@ -190,23 +190,23 @@ public function testInvalidDecryption()
$filter->decrypt('unknown');
$this->fail();
} catch (\Laminas\Filter\Exception\RuntimeException $e) {
$this->assertContains('Please give a private key', $e->getMessage());
$this->assertStringContainsString('Please give a private key', $e->getMessage());
}

$filter->setPrivateKey(['public' => __DIR__ . '/../_files/privatekey.pem']);
try {
$filter->decrypt('unknown');
$this->fail();
} catch (\Laminas\Filter\Exception\RuntimeException $e) {
$this->assertContains('Please give an envelope key', $e->getMessage());
$this->assertStringContainsString('Please give an envelope key', $e->getMessage());
}

$filter->setEnvelopeKey('unknown');
try {
$filter->decrypt('unknown');
$this->fail();
} catch (\Laminas\Filter\Exception\RuntimeException $e) {
$this->assertContains('was not able to decrypt', $e->getMessage());
$this->assertStringContainsString('was not able to decrypt', $e->getMessage());
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/EncryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class EncryptTest extends TestCase
{
public function setUp()
public function setUp(): void
{
if (! extension_loaded('mcrypt') && ! extension_loaded('openssl')) {
$this->markTestSkipped('This filter needs the mcrypt or openssl extension');
Expand Down
4 changes: 2 additions & 2 deletions test/File/DecryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DecryptTest extends TestCase

public $tmpDir;

public function setUp()
public function setUp(): void
{
if (! extension_loaded('mcrypt') && ! extension_loaded('openssl')) {
$this->markTestSkipped('This filter needs the mcrypt or openssl extension');
Expand All @@ -31,7 +31,7 @@ public function setUp()
$this->fileToEncrypt = dirname(__DIR__) . '/_files/encryption.txt';
}

public function tearDown()
public function tearDown(): void
{
if (is_dir($this->tmpDir)) {
if (file_exists($this->tmpDir . '/newencryption.txt')) {
Expand Down
4 changes: 2 additions & 2 deletions test/File/EncryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EncryptTest extends TestCase
public $testDir;
public $testFile;

public function setUp()
public function setUp(): void
{
if (! extension_loaded('mcrypt') && ! extension_loaded('openssl')) {
$this->markTestSkipped('This filter needs the mcrypt or openssl extension');
Expand All @@ -29,7 +29,7 @@ public function setUp()
$this->testFile = sprintf('%s/%s.txt', sys_get_temp_dir(), uniqid('laminasilter'));
}

public function tearDown()
public function tearDown(): void
{
if (file_exists($this->testFile)) {
unlink($this->testFile);
Expand Down

0 comments on commit 327b9d4

Please sign in to comment.