diff --git a/.travis.yml b/.travis.yml index 01da256..5f8d8ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ env: cache: directories: - - $HOME/.composer/cache + - $HOME/.composer/cache before_install: - composer self-update @@ -33,6 +33,6 @@ script: - ant test matrix: - allow_failures: - - env: SYMFONY_VERSION=dev-master - - php: nightly + allow_failures: + - env: SYMFONY_VERSION=dev-master + - php: nightly \ No newline at end of file diff --git a/DependencyInjection/Security/Factory/Factory.php b/DependencyInjection/Security/Factory/Factory.php index 00fc5c4..84b1006 100644 --- a/DependencyInjection/Security/Factory/Factory.php +++ b/DependencyInjection/Security/Factory/Factory.php @@ -4,7 +4,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface; @@ -17,7 +17,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProviderI { $this->encoderId = 'escape_wsse_authentication.encoder.'.$id; - $container->setDefinition($this->encoderId, new DefinitionDecorator('escape_wsse_authentication.encoder')); + $container->setDefinition($this->encoderId, new ChildDefinition('escape_wsse_authentication.encoder')); if(isset($config['encoder']['algorithm'])) { @@ -42,13 +42,13 @@ public function create(ContainerBuilder $container, $id, $config, $userProviderI { $this->nonceCacheId = 'escape_wsse_authentication.nonce_cache.'.$id; - $container->setDefinition($this->nonceCacheId, new DefinitionDecorator('escape_wsse_authentication.nonce_cache')); + $container->setDefinition($this->nonceCacheId, new ChildDefinition('escape_wsse_authentication.nonce_cache')); } $providerId = 'escape_wsse_authentication.provider.'.$id; $container - ->setDefinition($providerId, new DefinitionDecorator('escape_wsse_authentication.provider')) + ->setDefinition($providerId, new ChildDefinition('escape_wsse_authentication.provider')) ->replaceArgument(1, new Reference($userProviderId)) ->replaceArgument(2, $id) ->replaceArgument(3, new Reference($this->encoderId)) @@ -61,7 +61,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProviderI $listenerId = 'escape_wsse_authentication.listener.'.$id; $container - ->setDefinition($listenerId, new DefinitionDecorator('escape_wsse_authentication.listener')) + ->setDefinition($listenerId, new ChildDefinition('escape_wsse_authentication.listener')) ->addArgument($id) ->addArgument(new Reference($entryPointId)); @@ -115,7 +115,7 @@ protected function createEntryPoint($container, $id, $config, $defaultEntryPoint $entryPointId = 'escape_wsse_authentication.entry_point.'.$id; $container - ->setDefinition($entryPointId, new DefinitionDecorator('escape_wsse_authentication.entry_point')) + ->setDefinition($entryPointId, new ChildDefinition('escape_wsse_authentication.entry_point')) ->replaceArgument(1, $config['realm']) ->replaceArgument(2, $config['profile']); diff --git a/Tests/Security/Core/Authentication/Provider/ProviderTest.php b/Tests/Security/Core/Authentication/Provider/ProviderTest.php index d451f0a..949f5a0 100644 --- a/Tests/Security/Core/Authentication/Provider/ProviderTest.php +++ b/Tests/Security/Core/Authentication/Provider/ProviderTest.php @@ -70,12 +70,12 @@ private function clearDir() protected function setUp() { - $this->userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface'); - $this->userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface'); + $this->userChecker = $this->createMock('Symfony\Component\Security\Core\User\UserCheckerInterface'); + $this->userProvider = $this->createMock('Symfony\Component\Security\Core\User\UserProviderInterface'); $this->providerKey = 'someproviderkey'; $this->encoder = new MessageDigestPasswordEncoder('sha1', true, 1); $this->nonceCache = new PhpFileCache(self::$nonceDir); - $this->user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface'); + $this->user = $this->createMock('Symfony\Component\Security\Core\User\UserInterface'); $this->clearDir(); } @@ -104,7 +104,7 @@ public function providerSupports() return array( array($tokenWithoutAttributes, false), array($tokenWithAttributes, true), - array($this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'), false) + array($this->createMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'), false) ); } diff --git a/Tests/Security/Http/EntryPoint/EntryPointTest.php b/Tests/Security/Http/EntryPoint/EntryPointTest.php index b1e19f1..9917d12 100644 --- a/Tests/Security/Http/EntryPoint/EntryPointTest.php +++ b/Tests/Security/Http/EntryPoint/EntryPointTest.php @@ -23,8 +23,8 @@ protected function setUp() public function testStart() { - $logger = $this->getMock('Psr\Log\LoggerInterface'); - $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); + $logger = $this->createMock('Psr\Log\LoggerInterface'); + $request = $this->createMock('Symfony\Component\HttpFoundation\Request'); $realm = 'TheRealm'; $profile = 'TheProfile'; @@ -47,8 +47,8 @@ public function testStart() public function testStartWithNoException() { - $logger = $this->getMock('Psr\Log\LoggerInterface'); - $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); + $logger = $this->createMock('Psr\Log\LoggerInterface'); + $request = $this->createMock('Symfony\Component\HttpFoundation\Request'); $realm = 'TheRealm'; $profile = 'TheProfile'; diff --git a/Tests/Security/Http/Firewall/ListenerTest.php b/Tests/Security/Http/Firewall/ListenerTest.php index d23057b..17fd33e 100644 --- a/Tests/Security/Http/Firewall/ListenerTest.php +++ b/Tests/Security/Http/Firewall/ListenerTest.php @@ -42,14 +42,14 @@ protected function setUp() if (interface_exists('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')) { // TokenStorageInterface for SF >=2.7 - $this->securityContext = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'); + $this->securityContext = $this->createMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'); } else { // SecurityContextInterface for SF <2.6 - $this->securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); + $this->securityContext = $this->createMock('Symfony\Component\Security\Core\SecurityContextInterface'); } - $this->authenticationManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'); - $this->authenticationEntryPoint = $this->getMock('Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface'); + $this->authenticationManager = $this->createMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'); + $this->authenticationEntryPoint = $this->createMock('Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface'); } /** @@ -61,7 +61,7 @@ public function handleReturnToken() $token->setAttribute('nonce','somenonce'); $token->setAttribute('created','2010-12-12 20:00:00'); - $tokenMock2 = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + $tokenMock2 = $this->createMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); $this->authenticationManager->expects($this->once())->method('authenticate')->with($token)->will($this->returnValue($tokenMock2)); $this->securityContext->expects($this->once())->method('setToken')->with($tokenMock2); $this->request->headers->add(array('X-WSSE'=>'UsernameToken Username="someuser", PasswordDigest="somedigest", Nonce="somenonce", Created="2010-12-12 20:00:00"')); diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index b92ef2b..d588795 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -10,4 +10,4 @@ require_once $file; // disable the deprecation warnings -PHPUnit_Framework_Error_Deprecated::$enabled = FALSE; +//PHPUnit_Framework_Error_Deprecated::$enabled = FALSE; diff --git a/composer.json b/composer.json index ef861cc..70ea076 100644 --- a/composer.json +++ b/composer.json @@ -17,14 +17,14 @@ ], "minimum-stability": "dev", "require": { - "php": ">=5.3.9", - "symfony/framework-bundle": "~2.3|~3.0", - "symfony/security-bundle": "~2.3|~3.0", + "php": ">=5.3.9 || ^7.0", + "symfony/framework-bundle": "~2.3 || ~3.0 || ^4.0", + "symfony/security-bundle": "~2.3 || ~3.0 || ^4.0", "doctrine/common": "~2.2" }, "require-dev": { - "symfony/finder": "~2.3|~3.0", - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/finder": "~2.3 || ~3.0", + "symfony/phpunit-bridge": "~2.7 || ~3.0 || ^4.0" }, "autoload": { "psr-0": { "Escape\\WSSEAuthenticationBundle": "" }