[Tests] Silenced all deprecations in tests for 2.3
This commit is contained in:
parent
2f53d69fa4
commit
ef4ae63e8a
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="Tests/bootstrap.php"
|
bootstrap="Tests/bootstrap.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Doctrine Bridge Test Suite">
|
<testsuite name="Symfony Doctrine Bridge Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Monolog Bridge Test Suite">
|
<testsuite name="Symfony Monolog Bridge Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Propel1 Bridge Test Suite">
|
<testsuite name="Symfony Propel1 Bridge Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony ProxyManager Bridge Test Suite">
|
<testsuite name="Symfony ProxyManager Bridge Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Twig Bridge Test Suite">
|
<testsuite name="Symfony Twig Bridge Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony FrameworkBundle Test Suite">
|
<testsuite name="Symfony FrameworkBundle Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony SecurityBundle Test Suite">
|
<testsuite name="Symfony SecurityBundle Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony TwigBundle Test Suite">
|
<testsuite name="Symfony TwigBundle Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony WebProfilerBundle Test Suite">
|
<testsuite name="Symfony WebProfilerBundle Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony BrowserKit Component Test Suite">
|
<testsuite name="Symfony BrowserKit Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony ClassLoader Component Test Suite">
|
<testsuite name="Symfony ClassLoader Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Config Component Test Suite">
|
<testsuite name="Symfony Config Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Console Component Test Suite">
|
<testsuite name="Symfony Console Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony CssSelector Component Test Suite">
|
<testsuite name="Symfony CssSelector Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Debug Component Test Suite">
|
<testsuite name="Symfony Debug Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony DependencyInjection Component Test Suite">
|
<testsuite name="Symfony DependencyInjection Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,11 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
|
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony DomCrawler Component Test Suite">
|
<testsuite name="Symfony DomCrawler Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony EventDispatcher Component Test Suite">
|
<testsuite name="Symfony EventDispatcher Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Filesystem Component Test Suite">
|
<testsuite name="Symfony Filesystem Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Finder Component Test Suite">
|
<testsuite name="Symfony Finder Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Form Component Test Suite">
|
<testsuite name="Symfony Form Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony HttpFoundation Component Test Suite">
|
<testsuite name="Symfony HttpFoundation Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony HttpKernel Component Test Suite">
|
<testsuite name="Symfony HttpKernel Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Intl Component Test Suite">
|
<testsuite name="Symfony Intl Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Locale Component Test Suite">
|
<testsuite name="Symfony Locale Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony OptionsResolver Component Test Suite">
|
<testsuite name="Symfony OptionsResolver Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Process Component Test Suite">
|
<testsuite name="Symfony Process Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony PropertyAccess Component Test Suite">
|
<testsuite name="Symfony PropertyAccess Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Routing Component Test Suite">
|
<testsuite name="Symfony Routing Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -1,168 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of the Symfony package.
|
|
||||||
*
|
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Symfony\Component\Security\Core\Tests\Validator\Constraints;
|
|
||||||
|
|
||||||
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
|
|
||||||
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
|
|
||||||
use Symfony\Component\Security\Core\SecurityContextInterface;
|
|
||||||
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
|
|
||||||
use Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator;
|
|
||||||
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
|
||||||
*/
|
|
||||||
class UserPasswordValidatorTest extends AbstractConstraintValidatorTest
|
|
||||||
{
|
|
||||||
const PASSWORD = 's3Cr3t';
|
|
||||||
|
|
||||||
const SALT = '^S4lt$';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var SecurityContextInterface
|
|
||||||
*/
|
|
||||||
protected $securityContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var PasswordEncoderInterface
|
|
||||||
*/
|
|
||||||
protected $encoder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var EncoderFactoryInterface
|
|
||||||
*/
|
|
||||||
protected $encoderFactory;
|
|
||||||
|
|
||||||
protected function createValidator()
|
|
||||||
{
|
|
||||||
return new UserPasswordValidator($this->securityContext, $this->encoderFactory);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function setUp()
|
|
||||||
{
|
|
||||||
$user = $this->createUser();
|
|
||||||
$this->securityContext = $this->createSecurityContext($user);
|
|
||||||
$this->encoder = $this->createPasswordEncoder();
|
|
||||||
$this->encoderFactory = $this->createEncoderFactory($this->encoder);
|
|
||||||
|
|
||||||
parent::setUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testPasswordIsValid()
|
|
||||||
{
|
|
||||||
$constraint = new UserPassword(array(
|
|
||||||
'message' => 'myMessage',
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->encoder->expects($this->once())
|
|
||||||
->method('isPasswordValid')
|
|
||||||
->with(static::PASSWORD, 'secret', static::SALT)
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
|
|
||||||
$this->validator->validate('secret', $constraint);
|
|
||||||
|
|
||||||
$this->assertNoViolation();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testPasswordIsNotValid()
|
|
||||||
{
|
|
||||||
$constraint = new UserPassword(array(
|
|
||||||
'message' => 'myMessage',
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->encoder->expects($this->once())
|
|
||||||
->method('isPasswordValid')
|
|
||||||
->with(static::PASSWORD, 'secret', static::SALT)
|
|
||||||
->will($this->returnValue(false));
|
|
||||||
|
|
||||||
$this->validator->validate('secret', $constraint);
|
|
||||||
|
|
||||||
$this->assertViolation('myMessage');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
|
|
||||||
*/
|
|
||||||
public function testUserIsNotValid()
|
|
||||||
{
|
|
||||||
$user = $this->getMock('Foo\Bar\User');
|
|
||||||
|
|
||||||
$this->securityContext = $this->createSecurityContext($user);
|
|
||||||
$this->validator = $this->createValidator();
|
|
||||||
$this->validator->initialize($this->context);
|
|
||||||
|
|
||||||
$this->validator->validate('secret', new UserPassword());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function createUser()
|
|
||||||
{
|
|
||||||
$mock = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
|
|
||||||
|
|
||||||
$mock
|
|
||||||
->expects($this->any())
|
|
||||||
->method('getPassword')
|
|
||||||
->will($this->returnValue(static::PASSWORD))
|
|
||||||
;
|
|
||||||
|
|
||||||
$mock
|
|
||||||
->expects($this->any())
|
|
||||||
->method('getSalt')
|
|
||||||
->will($this->returnValue(static::SALT))
|
|
||||||
;
|
|
||||||
|
|
||||||
return $mock;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function createPasswordEncoder($isPasswordValid = true)
|
|
||||||
{
|
|
||||||
return $this->getMock('Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface');
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function createEncoderFactory($encoder = null)
|
|
||||||
{
|
|
||||||
$mock = $this->getMock('Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface');
|
|
||||||
|
|
||||||
$mock
|
|
||||||
->expects($this->any())
|
|
||||||
->method('getEncoder')
|
|
||||||
->will($this->returnValue($encoder))
|
|
||||||
;
|
|
||||||
|
|
||||||
return $mock;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function createSecurityContext($user = null)
|
|
||||||
{
|
|
||||||
$token = $this->createAuthenticationToken($user);
|
|
||||||
|
|
||||||
$mock = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
|
|
||||||
$mock
|
|
||||||
->expects($this->any())
|
|
||||||
->method('getToken')
|
|
||||||
->will($this->returnValue($token))
|
|
||||||
;
|
|
||||||
|
|
||||||
return $mock;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function createAuthenticationToken($user = null)
|
|
||||||
{
|
|
||||||
$mock = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
|
|
||||||
$mock
|
|
||||||
->expects($this->any())
|
|
||||||
->method('getUser')
|
|
||||||
->will($this->returnValue($user))
|
|
||||||
;
|
|
||||||
|
|
||||||
return $mock;
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Security Component Test Suite">
|
<testsuite name="Symfony Security Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Serializer Component Test Suite">
|
<testsuite name="Symfony Serializer Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Stopwatch Component Test Suite">
|
<testsuite name="Symfony Stopwatch Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Templating Component Test Suite">
|
<testsuite name="Symfony Templating Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Translation Component Test Suite">
|
<testsuite name="Symfony Translation Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Validator Component Test Suite">
|
<testsuite name="Symfony Validator Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
>
|
>
|
||||||
|
<php>
|
||||||
|
<!-- php -r 'echo -1 & ~E_USER_DEPRECATED;' -->
|
||||||
|
<ini name="error_reporting" value="-16385"/>
|
||||||
|
</php>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Symfony Yaml Component Test Suite">
|
<testsuite name="Symfony Yaml Component Test Suite">
|
||||||
<directory>./Tests/</directory>
|
<directory>./Tests/</directory>
|
||||||
|
Reference in New Issue
Block a user