Skip to content

Commit

Permalink
Added sf5 compat (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
karser committed Nov 28, 2019
1 parent aca23dc commit eb557ae
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
31 changes: 17 additions & 14 deletions .travis.yml
Expand Up @@ -6,29 +6,32 @@ cache:

matrix:
include:
# Symfony 4
- php: 7.1
- php: 7.2
- php: 7.3
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-clover=coverage.clover"
# Symfony LTS
- php: 7.2
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
- php: 7.3
env: SYMFONY_REQUIRE="4.4.*"
- php: 7.3
env: DEPENDENCIES="symfony/lts:^3"
# development dependencies
# - php: 7.3
# env: STABILITY="dev"
env: SYMFONY_REQUIRE="5.0.*"
- php: 7.4snapshot
env: SYMFONY_REQUIRE="4.4.*"
- php: 7.4snapshot
env: SYMFONY_REQUIRE="5.0.*"
fast_finish: true

allow_failures:
- php: 7.3
env: STABILITY="dev"
#allow_failures:
# - php: 7.3
# env: SYMFONY_REQUIRE="5.1.*@dev"
# - php: nightly
# env: SYMFONY_REQUIRE="5.0.*"

before_install:
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; echo ${DEPENDENCIES}; fi;

install: composer update --prefer-dist
install:
- composer global require --no-scripts --no-plugins symfony/flex
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction

script:
- vendor/bin/phpunit $PHPUNIT_FLAGS
Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTest.php
Expand Up @@ -16,7 +16,7 @@ class FunctionalTest extends TestCase
/** @var TestKernel */
private $kernel;

public function setUp()
public function setUp(): void
{
$this->kernel = new TestKernel(uniqid(), false);
}
Expand Down
7 changes: 3 additions & 4 deletions Tests/Validator/Constraints/Recaptcha3ValidatorTest.php
Expand Up @@ -7,6 +7,7 @@
use Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3;
use Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3Validator;
use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class Recaptcha3ValidatorTest extends ConstraintValidatorTestCase
Expand All @@ -16,7 +17,7 @@ class Recaptcha3ValidatorTest extends ConstraintValidatorTestCase
/** @var RecaptchaMock */
private $recaptcha;

public function setUp()
public function setUp(): void
{
$this->resolver = $this->getMockBuilder(IpResolverInterface::class)->getMock();
parent::setUp();
Expand Down Expand Up @@ -49,11 +50,9 @@ public function testValidIfNotEnabled()
$this->assertNoViolation();
}

/**
* @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException
*/
public function testExpectsStringCompatibleType()
{
$this->expectException(UnexpectedTypeException::class);
$this->validator->validate(new \stdClass(), new Recaptcha3());
}

Expand Down
1 change: 0 additions & 1 deletion Tests/fixtures/config/base.yml
@@ -1,7 +1,6 @@
framework:
secret: ThisIsNotReallyASecretSoPleaseChangeIt
validation: { enabled: true }
templating: { engines: ['twig'] }
test: true
session:
storage_id: session.storage.mock_file
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Expand Up @@ -16,16 +16,16 @@
"require": {
"php": ">=7.1",
"google/recaptcha": "^1.2",
"symfony/form": "~2.7|~3.0|~4.0",
"symfony/framework-bundle": "~2.7|~3.0|~4.0",
"symfony/templating": "~2.7|~3.0|~4.0",
"symfony/yaml": "~2.7|~3.0|~4.0",
"symfony/validator": "~2.7|~3.0|~4.0",
"symfony/twig-bundle": "~2.7|~3.0|~4.0",
"twig/twig": "^2.9"
"symfony/form": "^3.4|^4.0|^5.0",
"symfony/framework-bundle": "^3.4|^4.0|^5.0",
"symfony/templating": "^3.4|^4.0|^5.0",
"symfony/yaml": "^3.4|^4.0|^5.0",
"symfony/validator": "^3.4|^4.0|^5.0",
"symfony/twig-bundle": "^3.4|^4.0|^5.0",
"twig/twig": "^2.9|^3.0"
},
"require-dev": {
"phpunit/phpunit": "~7.4"
"phpunit/phpunit": "~6.5.0|~7.5.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit eb557ae

Please sign in to comment.