Skip to content

Commit

Permalink
#317 Use symfony/phpunit-bridge for testing
Browse files Browse the repository at this point in the history
Btw stop testing on unmaintained Symfony versions (3.0 and 3.1)
  • Loading branch information
chalasr authored Mar 29, 2017
2 parents 8b8a0f8 + e12d110 commit 6055e90
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
13 changes: 1 addition & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,15 @@ language: php

sudo: false

env:
global:
- COMPOSER_FLAGS="--prefer-dist"

matrix:
fast_finish: true
include:
- php: 5.5
env: SYMFONY_VERSION=2.8.*
- php: 5.5
env: SYMFONY_VERSION=3.0.*
- php: 5.5
env: SYMFONY_VERSION=3.1.*
- php: 5.5
env: SYMFONY_VERSION=3.2.*
- php: 5.6
env: SYMFONY_VERSION=3.2.*
- php: 7.0
- php: 7.1
- php: 7.1
env: COMPOSER_FLAGS="--prefer-lowest"
- php: hhvm-stable
sudo: required
dist: trusty
Expand Down
8 changes: 5 additions & 3 deletions Tests/Functional/Utils/CallableEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ public static function getSubscribedEvents()
$subscriberMap = [];

foreach (self::$eventClassMap as $name => $className) {
if (self::hasListener($name)) {
$subscriberMap[$name] = 'handleEvent';
}
$subscriberMap[$name] = 'handleEvent';
}

return $subscriberMap;
Expand All @@ -55,6 +53,10 @@ public function handleEvent(Event $event)

$listener = self::getListener($eventName);

if (!$listener) {
return;
}

if ($listener instanceof \Closure) {
return $listener($event);
}
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0",
"symfony/phpunit-bridge": "^2.8|^3.0",
"symfony/phpunit-bridge": "~3.2",
"symfony/browser-kit": "^2.8|^3.0",
"symfony/dom-crawler": "^2.8|^3.0",
"symfony/yaml": "^2.8|^3.0",
Expand All @@ -70,10 +70,9 @@
},
"scripts": {
"test": [
"vendor/bin/phpunit --testsuite unit",
"vendor/bin/phpunit --testsuite functional",
"ENCODER=lcobucci vendor/bin/phpunit --testsuite functional",
"PROVIDER=lexik_jwt vendor/bin/phpunit --testsuite functional"
"vendor/bin/simple-phpunit",
"ENCODER=lcobucci vendor/bin/simple-phpunit",
"PROVIDER=lexik_jwt vendor/bin/simple-phpunit"
]
}
}
6 changes: 1 addition & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
>

<testsuites>
<testsuite name="unit">
<testsuite name="LexikJWTAuthenticationBundle Test Suite">
<directory>./Tests/</directory>
<exclude>./Tests/Functional/</exclude>
</testsuite>
<testsuite name="functional">
<directory>./Tests/Functional/</directory>
</testsuite>
</testsuites>

Expand Down

0 comments on commit 6055e90

Please sign in to comment.