Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ return PhpCsFixer\Config::create()
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => false,
'phpdoc_annotation_without_dot' => false,
'yoda_style' => false
))
->setRiskyAllowed(true)
->setFinder(
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ matrix:
include:
- php: 5.6
- php: 7.0
env: lint=1
- php: 7.1
env: DEPENDENCIES='dev' lint=1
- php: 7.1
env: DEPENDENCIES='low'
Expand All @@ -18,7 +20,7 @@ cache:
before_install:
- phpenv config-rm xdebug.ini || echo "xdebug not available"
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- if [[ $lint = 1 ]]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.3.2/php-cs-fixer.phar; fi
- if [[ $lint = 1 ]]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.6.0/php-cs-fixer.phar; fi
- if [[ $lint = 1 ]]; then composer global require --dev 'phpstan/phpstan:^0.8'; fi
- export PATH="$PATH:$HOME/.composer/vendor/bin"

Expand All @@ -33,4 +35,4 @@ script:
- export SYMFONY_DEPRECATIONS_HELPER=strict
- vendor/bin/simple-phpunit --verbose
- if [[ $lint = 1 ]]; then php php-cs-fixer.phar fix --dry-run --diff --no-ansi; fi
- if [[ $lint = 1 ]]; then phpstan analyse -c phpstan.neon -l5 --ansi src tests; fi
#- if [[ $lint = 1 ]]; then phpstan analyse -c phpstan.neon -l5 --ansi src tests; fi # temporarily disabled
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"php": "^5.6 || ^7.0",
"psr/container": "^1.0",
"symfony/polyfill-mbstring": "^1.5.0",
"symfony/validator": "^2.8.9 || ^3.3.6"
"symfony/validator": "^2.8.9 || ^3.3.6 || ^4.0"
},
"require-dev": {
"symfony/config": "^3.3.6",
"symfony/console": "^3.3.6",
"symfony/phpunit-bridge": "^3.3.6"
"symfony/config": "^3.3.6 || ^4.0",
"symfony/console": "^3.3.6 || ^4.0",
"symfony/phpunit-bridge": "^3.3.6 || ^4.0"
},
"autoload": {
"psr-4": {
Expand All @@ -38,7 +38,10 @@
"autoload-dev": {
"psr-4": {
"Rollerworks\\Component\\PasswordStrength\\Tests\\": "tests/"
}
},
"files": [
"tests/Symfony27Compat.php"
]
},
"extra": {
"branch-alias": {
Expand Down
17 changes: 17 additions & 0 deletions tests/Symfony27Compat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the RollerworksPasswordStrengthValidator package.
*
* (c) Sebastiaan Stok <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

if (!class_exists(ConstraintValidatorTestCase::class)) {
class_alias(AbstractConstraintValidatorTest::class, ConstraintValidatorTestCase::class);
}
4 changes: 2 additions & 2 deletions tests/Validator/BlacklistValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
use Rollerworks\Component\PasswordStrength\Validator\Constraints\Blacklist;
use Rollerworks\Component\PasswordStrength\Validator\Constraints\BlacklistValidator;
use Symfony\Component\Validator\Exception\RuntimeException;
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class BlacklistValidationTest extends AbstractConstraintValidatorTest
class BlacklistValidationTest extends ConstraintValidatorTestCase
{
use BlackListMockProviderTrait;

Expand Down
4 changes: 2 additions & 2 deletions tests/Validator/PasswordRequirementsValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

use Rollerworks\Component\PasswordStrength\Validator\Constraints\PasswordRequirements;
use Rollerworks\Component\PasswordStrength\Validator\Constraints\PasswordRequirementsValidator;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
use Symfony\Component\Validator\Test\ConstraintViolationAssertion;
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;

class PasswordRequirementsValidatorTest extends AbstractConstraintValidatorTest
class PasswordRequirementsValidatorTest extends ConstraintValidatorTestCase
{
public function getMock($originalClassName, $methods = [], array $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false, $proxyTarget = null)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Validator/PasswordStrengthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use Rollerworks\Component\PasswordStrength\Validator\Constraints\PasswordStrength;
use Rollerworks\Component\PasswordStrength\Validator\Constraints\PasswordStrengthValidator;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class PasswordStrengthTest extends AbstractConstraintValidatorTest
class PasswordStrengthTest extends ConstraintValidatorTestCase
{
/**
* @var array
Expand Down