Skip to content
Open
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
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ cache:
directories:
- "$HOME/.composer/cache/files"

env:
- SYMFONY_DEPRECATIONS_HELPER=weak

php:
- 5.6
- 7.0
Expand All @@ -14,13 +17,16 @@ php:
matrix:
include:
- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest"
dist: precise
env:
- COMPOSER_FLAGS="--prefer-lowest"
- SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.1
env: SYMFONY_VERSION="2.7.*"
- php: 7.1
env: SYMFONY_VERSION="2.8.*"
- php: 7.1
env: SYMFONY_VERSION="3.1.*"
env: SYMFONY_VERSION="3.4.*"

before_install:
- if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

namespace JMS\SecurityExtraBundle\Tests\DependencyInjection\Compiler;

use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Definition;
use JMS\SecurityExtraBundle\DependencyInjection\Compiler\AddAfterInvocationProvidersPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class AddAfterInvocationProvidersPassTest extends \PHPUnit_Framework_TestCase
class AddAfterInvocationProvidersPassTest extends TestCase
{
public function testProcessStopsWhenNoAfterInvocationManager()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

namespace JMS\SecurityExtraBundle\Tests\DependencyInjection\Compiler;

use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;

use JMS\SecurityExtraBundle\DependencyInjection\Compiler\CollectSecuredServicesPass;

class CollectSecuredServicesPassTest extends \PHPUnit_Framework_TestCase
class CollectSecuredServicesPassTest extends TestCase
{
public function testProcess()
{
Expand Down
3 changes: 2 additions & 1 deletion Tests/DependencyInjection/JMSSecurityExtraExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

namespace JMS\SecurityExtraBundle\Tests\DependencyInjection;

use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use JMS\SecurityExtraBundle\DependencyInjection\JMSSecurityExtraExtension;

class JMSSecurityExtraExtensionTest extends \PHPUnit_Framework_TestCase
class JMSSecurityExtraExtensionTest extends TestCase
{
private $extension;

Expand Down
15 changes: 13 additions & 2 deletions Tests/Functional/VoterDisablingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

namespace JMS\SecurityExtraBundle\Tests\Functional;

use Symfony\Component\HttpKernel\Kernel;

class VoterDisablingTest extends BaseTestCase
{
/**
* @runInSeparateProcess
*/
public function testDisableAllVoters()
{
if(Kernel::MAJOR_VERSION >= 3) {
return $this->markTestSkipped('Voter tests do not work on Symfony 3 and higher');
}
$client = $this->createClient(array('config' => 'all_voters_disabled.yml'));
$client->insulate();

Expand All @@ -23,21 +28,27 @@ public function testDisableAllVoters()
*/
public function testDefault()
{
if(Kernel::MAJOR_VERSION >= 3) {
return $this->markTestSkipped('Voter tests do not work on Symfony 3 and higher');
}
$client = $this->createClient(array('config' => 'default.yml'));
$client->insulate();

$adm = self::$kernel->getContainer()->get('security.access.decision_manager');

$this->assertEquals(2, count($voters = $this->getVoters($adm)));
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\Voter\RoleVoter', $voters[0]);
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter', $voters[1]);
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\Voter\RoleVoter', $voters[1]);
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter', $voters[0]);
}

/**
* @runInSeparateProcess
*/
public function testSomeVotersDisabled()
{
if(Kernel::MAJOR_VERSION >= 3) {
return $this->markTestSkipped('Voter tests do not work on Symfony 3 and higher');
}
$client = $this->createClient(array('config' => 'some_voters_disabled.yml'));
$client->insulate();

Expand Down
3 changes: 2 additions & 1 deletion Tests/Metadata/ClassMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
use JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver;

use Metadata\MetadataFactory;
use PHPUnit\Framework\TestCase;

class ClassMetadataTest extends \PHPUnit_Framework_TestCase
class ClassMetadataTest extends TestCase
{
/**
* @expectedException \RuntimeException
Expand Down
3 changes: 2 additions & 1 deletion Tests/Metadata/Driver/AnnotationDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
use Doctrine\Common\Annotations\AnnotationReader;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression;
use JMS\SecurityExtraBundle\Metadata\Driver\AnnotationDriver;
use PHPUnit\Framework\TestCase;

require_once __DIR__.'/Fixtures/services.php';

class AnnotationDriverTest extends \PHPUnit_Framework_TestCase
class AnnotationDriverTest extends TestCase
{
public function testLoadMetadataWithClassPreAuthorize()
{
Expand Down
3 changes: 2 additions & 1 deletion Tests/Metadata/Driver/ConfigDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression;
use JMS\SecurityExtraBundle\Metadata\MethodMetadata;
use JMS\SecurityExtraBundle\Metadata\Driver\ConfigDriver;
use PHPUnit\Framework\TestCase;

class ConfigDriverTest extends \PHPUnit_Framework_TestCase
class ConfigDriverTest extends TestCase
{
public function testLoadMetadata()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;
use PHPUnit\Framework\TestCase;

class HasClassPermissionFunctionCompilerTest extends \PHPUnit_Framework_TestCase
class HasClassPermissionFunctionCompilerTest extends TestCase
{
private $compiler;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace JMS\SecurityExtraBundle\Tests\Security\Acl\Expression;

use JMS\SecurityExtraBundle\Security\Acl\Expression\HasPermissionFunctionCompiler;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;

class HasPermissionFunctionCompilerTest extends \PHPUnit_Framework_TestCase
use JMS\SecurityExtraBundle\Security\Acl\Expression\HasPermissionFunctionCompiler;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\ConstantExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;
use PHPUnit\Framework\TestCase;

class HasPermissionFunctionCompilerTest extends TestCase
{
private $compiler;

Expand Down
3 changes: 2 additions & 1 deletion Tests/Security/Acl/Expression/PermissionEvaluatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace JMS\SecurityExtraBundle\Tests\Security\Acl\Expression;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Acl\Exception\NoAceFoundException;

use Symfony\Component\Security\Acl\Exception\AclNotFoundException;

use JMS\SecurityExtraBundle\Security\Acl\Expression\PermissionEvaluator;

class PermissionEvaluatorTest extends \PHPUnit_Framework_TestCase
class PermissionEvaluatorTest extends TestCase
{
private $token;
private $object;
Expand Down
3 changes: 2 additions & 1 deletion Tests/Security/Acl/Voter/AclVoterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace JMS\SecurityExtraBundle\Tests\Security\Acl\Voter;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Acl\Exception\NoAceFoundException;
use Symfony\Component\Security\Acl\Voter\FieldVote;
use Symfony\Component\Security\Acl\Exception\AclNotFoundException;
Expand All @@ -11,7 +12,7 @@
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use JMS\SecurityExtraBundle\Security\Acl\Voter\AclVoter;

class AclVoterTest extends \PHPUnit_Framework_TestCase
class AclVoterTest extends TestCase
{
/**
* @dataProvider getSupportsAttributeTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken;

use JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider;
use PHPUnit\Framework\TestCase;

class RunAsAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
class RunAsAuthenticationProviderTest extends TestCase
{
public function testAuthenticateReturnsNullIfTokenISUnsupported()
{
Expand Down
3 changes: 2 additions & 1 deletion Tests/Security/Authentication/Token/RunAsUserTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

namespace JMS\SecurityExtraBundle\Tests\Security\Authentication\Token;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;

use Symfony\Component\Security\Core\Role\Role;
use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken;

class RunAsUserTokenTest extends \PHPUnit_Framework_TestCase
class RunAsUserTokenTest extends TestCase
{
public function testConstructor()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@

namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\AfterInvocation;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Acl\Exception\NoAceFoundException;

use Symfony\Component\Security\Acl\Exception\AclNotFoundException;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
use JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider;

class AclAfterInvocationProviderTest extends \PHPUnit_Framework_TestCase
class AclAfterInvocationProviderTest extends TestCase
{
public function testDecideReturnsNullWhenObjectIsNull()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\AfterInvocation;

use JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager;
use PHPUnit\Framework\TestCase;

class AfterInvocationManagerTest extends \PHPUnit_Framework_TestCase
class AfterInvocationManagerTest extends TestCase
{
public function testDecide()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

use JMS\SecurityExtraBundle\Tests\Security\Authorization\Expression\Fixture\Issue22\SecuredObject;
use CG\Proxy\MethodInvocation;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Role\Role;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;

class ExpressionCompilerTest extends \PHPUnit_Framework_TestCase
class ExpressionCompilerTest extends TestCase
{
private $compiler;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\Expression;

use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionLexer;
use PHPUnit\Framework\TestCase;

class ExpressionLexerTest extends \PHPUnit_Framework_TestCase
class ExpressionLexerTest extends TestCase
{
private $lexer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\AndExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\FunctionExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionParser;
use PHPUnit\Framework\TestCase;

class ExpressionParserTest extends \PHPUnit_Framework_TestCase
class ExpressionParserTest extends TestCase
{
private $parser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\Expression;

use JMS\SecurityExtraBundle\Security\Authorization\Expression\DefaultExpressionHandler;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Role\Role;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
Expand All @@ -11,7 +12,7 @@
use Symfony\Component\Filesystem\Filesystem;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionVoter;

class ExpressionVoterTest extends \PHPUnit_Framework_TestCase
class ExpressionVoterTest extends TestCase
{
private $voter;
private $cacheDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Compiler\ParameterExpressionCompiler;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;
use PHPUnit\Framework\TestCase;

class ParameterExpressionCompilerTest extends \PHPUnit_Framework_TestCase
class ParameterExpressionCompilerTest extends TestCase
{
private $compiler;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\OrExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Ast\VariableExpression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Role\RoleInterface;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ReverseInterpreter;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;

class ReverseInterpreterTest extends \PHPUnit_Framework_TestCase
class ReverseInterpreterTest extends TestCase
{
private $compiler;
private $reverseInterpreter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

use JMS\SecurityExtraBundle\Security\Authorization\Expression\Expression;
use JMS\SecurityExtraBundle\Security\Authorization\Expression\ExpressionCompiler;
use PHPUnit\Framework\TestCase;

class VariableExpressionCompilerTest extends \PHPUnit_Framework_TestCase
class VariableExpressionCompilerTest extends TestCase
{
private $compiler;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
use Metadata\MetadataFactoryInterface;

use JMS\SecurityExtraBundle\Security\Authentication\Token\RunAsUserToken;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor;
use CG\Proxy\MethodInvocation;

class MethodSecurityInterceptorTest extends \PHPUnit_Framework_TestCase
class MethodSecurityInterceptorTest extends TestCase
{
/**
* @expectedException Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace JMS\SecurityExtraBundle\Tests\Security\Authorization\Interception;

use JMS\SecurityExtraBundle\Security\Authorization\Interception\SecurityPointcut;
use PHPUnit\Framework\TestCase;

class SecurityPointcutTest extends \PHPUnit_Framework_TestCase
class SecurityPointcutTest extends TestCase
{
private $metadataFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace JMS\SecurityExtraBundle\Tests\Security\Authorization;

use JMS\SecurityExtraBundle\Security\Authorization\RememberingAccessDecisionManager;
use PHPUnit\Framework\TestCase;

class RememberingAccessDecisionManagerTest extends \PHPUnit_Framework_TestCase
class RememberingAccessDecisionManagerTest extends TestCase
{
private $adm;
private $delegate;
Expand Down
Loading