Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
php8 (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles-g authored Apr 12, 2021
1 parent 74e7e59 commit 5ba5755
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 61 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "CI Tests"

on:
pull_request:
push:

env:
fail-fast: true
PHPUNIT_FLAGS: "-v"
SYMFONY_DEPRECATIONS_HELPER: 40

jobs:
build:
runs-on: ${{ matrix.os }}
name: PHP v${{ matrix.php }} with Mongo v${{ matrix.mongodb }}
strategy:
matrix:
include:
- { os: ubuntu-latest, php: 7.3, mongodb: 3.6, symfony: "4.4.*"}
- { os: ubuntu-latest, php: 7.3, mongodb: 3.6, symfony: "5.1.*"}
- { os: ubuntu-latest, php: 7.4, mongodb: 3.6, symfony: "5.2.*"}
- { os: ubuntu-latest, php: 8.0, mongodb: 3.6, symfony: "5.x-dev"}
services:
mongo:
image: mongo:${{ matrix.mongodb }}
ports:
- 27017:27017

steps:
- uses: actions/checkout@v2
- name: "Installing php"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl,mbstring,xdebug,mongodb
ini-values: date.timezone="Europe/Paris"
coverage: xdebug
tools: composer
- name: Show PHP version
run: php -v && composer -V
- name: Download Composer cache dependencies from cache
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Install Symfony ${{ matrix.symfony }}
run: composer require symfony/symfony:${{ matrix.symfony }} --no-update
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-composer-
- name: Install dependencies
run: |
perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json
composer config platform.ext-mongo 1.6.16
composer require alcaeus/mongo-php-adapter --no-update
composer install --no-interaction
- name: "Run PHPUnit Tests"
run: "composer test"
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions Event/Listener/PrepareListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ class PrepareListener
*/
protected $encoding;

/**
* @param boolean $value
* @return PrepareListener $this
* @throws \InvalidArgumentException
*/
public function setForceCaseInsensitivity($value)
{
if (!is_bool($value)) {
Expand Down
5 changes: 2 additions & 3 deletions Tests/Event/Listenener/PrepareListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

class PrepareListenerTest extends TestCase
{
/**
* @expectedException \InvalidArgumentException
*/
public function testGetForceCaseInsensitivity()
{
$listener = new PrepareListener();
Expand Down Expand Up @@ -72,6 +69,8 @@ public function testGetForceCaseInsensitivity()
$this->assertSame($listener, $listener->setForceCaseInsensitivity(false));
$this->assertFalse($listener->getForceCaseInsensitivity('should not matter here'));

self::expectException(\InvalidArgumentException::class);

$listener->setForceCaseInsensitivity('some string');
}
}
2 changes: 1 addition & 1 deletion Tests/Filter/Doctrine/DoctrineQueryBuilderUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class DoctrineQueryBuilderUpdater extends TestCase
*/
protected $conn;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion Tests/Filter/Doctrine/MongodbQueryBuilderUpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MongodbQueryBuilderUpdaterTest extends TestCase
*/
protected $dm;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion Tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
*/
protected $formFactory;

public function setUp()
public function setUp(): void
{
$this->formFactory = $this->getFormFactory();
}
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
}
],
"require": {
"php": ">=7.0",
"php": ">=7.1",
"doctrine/orm": "^2.7",
"symfony/form": "^4.0|^5.0",
"symfony/framework-bundle": "^4.0|^5.0"
"symfony/form": "^4.4|^5.1",
"symfony/framework-bundle": "^4.4|^5.1"
},
"require-dev": {
"doctrine/doctrine-bundle": "^1.8 || ^2.0",
"doctrine/mongodb-odm-bundle": "^4.1",
"symfony/phpunit-bridge": "^4.0|^5.0",
"symfony/var-dumper": "^4.0|^5.0"
"symfony/phpunit-bridge": "^4.4|^5.1",
"symfony/var-dumper": "^4.4|^5.1"
},
"autoload": {
"psr-4": { "Lexik\\Bundle\\FormFilterBundle\\": "" }
Expand Down
4 changes: 0 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
</whitelist>
</filter>

<php>
<server name="SYMFONY_PHPUNIT_VERSION" value="7.5"/>
</php>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
Expand Down

0 comments on commit 5ba5755

Please sign in to comment.