Skip to content

Commit

Permalink
Merge pull request #24 from natmchugh/update-ci-php-build-versions
Browse files Browse the repository at this point in the history
Drop support of PHP 7.1 add up to 8.0
  • Loading branch information
martinmca authored Jan 6, 2021
2 parents de607ee + db6b451 commit 3357f1f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ sudo: false
language: php

php:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0

cache:
directories:
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"bin": ["bin/dbsampler"],
"require": {
"doctrine/dbal": "^2.5",
"fzaninotto/faker": "^1.6",
"fakerphp/faker": "^1.13",
"monolog/monolog": "^1.22",
"pimple/pimple": "^3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.16.0",
"phpunit/phpunit": "^5.7",
"friendsofphp/php-cs-fixer": "^2.16",
"phpunit/phpunit": "^8.5",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^2.7"
"squizlabs/php_codesniffer": "^3.5"
},
"authors": [
{
Expand All @@ -38,9 +38,9 @@
"scripts": {
"phpcs": "./vendor/bin/phpcs src/ --standard=PSR2 --warning-severity=8",
"phpcbf": "./vendor/bin/phpcbf src/ --standard=PSR2 --warning-severity=8",
"php-cs-fixer-lint": "./vendor/bin/php-cs-fixer --verbose --dry-run fix --rules=@PSR2,no_unused_imports src/",
"php-cs-fixer-fix": "./vendor/bin/php-cs-fixer --verbose fix --rules=@PSR2,no_unused_imports src/",
"phpunit": "./vendor/bin/phpunit --coverage-clover=phpcov.xml --coverage-text",
"php-cs-fixer-lint": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer --verbose --dry-run fix --rules=@PSR2,no_unused_imports src/",
"php-cs-fixer-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer --verbose fix --rules=@PSR2,no_unused_imports src/",
"phpunit": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=phpcov.xml --coverage-text",
"lint": [
"@phpcs",
"@php-cs-fixer-lint"
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
strict="true"
verbose="false">
<testsuites>
<testsuite name="Tests">
Expand Down
2 changes: 1 addition & 1 deletion tests/AppSetupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public function testSampleMigration()
* Check that sqlite credential files handle missing directory field correctly
*
* @return void
* @expectedException \RuntimeException
*/
public function testSqliteCredentialMissingDirectoryHandling()
{
$app = new App();
$app->loadCredentialsFile($this->fixturesDir . '/sqlite-credentials-no-dir.json');
$app->loadDatabaseConfigFile($this->fixturesDir . '/small_sqlite_migration.json');
$this->expectException(\RuntimeException::class);
$app->createDestConnectionByDbName('small-sqlite-source'); // directory tested at connection time now
}

Expand Down
5 changes: 3 additions & 2 deletions tests/FieldCleanerProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
namespace Quidco\DbSampler\Tests;

use Quidco\DbSampler\FieldCleanerProvider;
use PHPUnit\Framework\TestCase;

class FieldCleanerProviderTest extends \PHPUnit_Framework_TestCase
class FieldCleanerProviderTest extends TestCase
{
/**
* @var FieldCleanerProvider
*/
private $fieldCleaner;

public function setUp()
public function setUp(): void
{
$this->fieldCleaner = new FieldCleanerProvider();
}
Expand Down
3 changes: 2 additions & 1 deletion tests/ReferenceStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Quidco\DbSampler\Tests;

use Quidco\DbSampler\ReferenceStore;
use PHPUnit\Framework\TestCase;

class ReferenceStoreTest extends \PHPUnit_Framework_TestCase
class ReferenceStoreTest extends TestCase
{
public function testBasicFunctions()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/SamplerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ public function testMatchedWhereNoConstraints()
];
$sampler->loadConfig((object)$config);
$sampler->execute();
$this->assertInstanceOf(Matched::class, $sampler);
}

/**
* @expectedException \RuntimeException
*/
public function testMatchedNoConfigThrows()
{
$sampler = $this->generateMatched();
$this->expectException(\RuntimeException::class);
$sampler->loadConfig((object)[]);
$sampler->execute();
}
Expand Down
7 changes: 4 additions & 3 deletions tests/SqliteBasedTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DriverManager;
use PHPUnit\Framework\TestCase;

abstract class SqliteBasedTestCase extends \PHPUnit_Framework_TestCase
abstract class SqliteBasedTestCase extends TestCase
{
/**
* @var string
Expand All @@ -25,7 +26,7 @@ abstract class SqliteBasedTestCase extends \PHPUnit_Framework_TestCase
*
* @return void
*/
protected function setUp()
protected function setUp(): void
{
$this->fixturesDir = __DIR__ . '/fixtures';
$sqliteConfig = ['driver' => 'pdo_sqlite', 'directory' => $this->fixturesDir . '/sqlite-dbs'];
Expand All @@ -44,7 +45,7 @@ protected function setUp()
*
* @return void
*/
protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();
unlink($this->fixturesDir . '/sqlite-credentials.json');
Expand Down

0 comments on commit 3357f1f

Please sign in to comment.