-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from greg0ire/improve-travis-build
Fix the build
- Loading branch information
Showing
28 changed files
with
524 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\DiExtraBundle\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
abstract class BaseTestCase extends TestCase | ||
{ | ||
final protected function createMock($class) | ||
{ | ||
if (method_exists('PHPUnit\Framework\TestCase', 'createMock')) { | ||
return parent::createMock($class); | ||
} | ||
return $this->getMock($class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Tests/Functional/Bundle/LegacyTestBundle/Controller/AnotherSecuredController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\DiExtraBundle\Tests\Functional\Bundle\LegacyTestBundle\Controller; | ||
|
||
use JMS\SecurityExtraBundle\Annotation\Secure; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
|
||
/** | ||
* Secured Controller. | ||
* | ||
* @author Johannes M. Schmitt <schmittjoh@gmail.com> | ||
*/ | ||
class AnotherSecuredController | ||
{ | ||
/** | ||
* @Route("/secure-action") | ||
* @Secure("ROLE_FOO") | ||
*/ | ||
public function secureAction() | ||
{ | ||
throw new \Exception('Should never be called'); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
Tests/Functional/Bundle/LegacyTestBundle/Controller/AutomaticallyInjectedController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\DiExtraBundle\Tests\Functional\Bundle\LegacyTestBundle\Controller; | ||
|
||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\RouterInterface; | ||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; | ||
use Symfony\Component\Security\Core\SecurityContextInterface; | ||
use Symfony\Component\Templating\EngineInterface; | ||
|
||
class AutomaticallyInjectedController | ||
{ | ||
private $context; | ||
private $templating; | ||
private $router; | ||
private $foo; | ||
|
||
public function setRouter(RouterInterface $router) | ||
{ | ||
$this->router = $router; | ||
} | ||
|
||
/** | ||
* @Route("/automatic-controller-injection-test") | ||
*/ | ||
public function testAction() | ||
{ | ||
$content = ''; | ||
|
||
$content .= sprintf("\$context injection: %s\n", $this->context instanceof SecurityContextInterface || $this->context instanceof AuthorizationCheckerInterface ? 'OK' : 'FAILED'); | ||
$content .= sprintf("\$templating injection: %s\n", $this->templating instanceof EngineInterface ? 'OK' : 'FAILED'); | ||
$content .= sprintf("\$router injection: %s\n", $this->router instanceof RouterInterface ? 'OK' : 'FAILED'); | ||
$content .= sprintf("\$foo injection: %s\n", 'bar' === $this->foo ? 'OK' : 'FAILED'); | ||
|
||
return new Response($content); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
Tests/Functional/Bundle/LegacyTestBundle/Controller/ExtendedServiceController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\DiExtraBundle\Tests\Functional\Bundle\LegacyTestBundle\Controller; | ||
|
||
use JMS\DiExtraBundle\Annotation as DI; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
/** | ||
* @DI\Service("controller.extended_hello", parent = "controller.hello") | ||
*/ | ||
class ExtendedServiceController extends ServiceController | ||
{ | ||
public function helloAction() | ||
{ | ||
return new Response('hello'); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
Tests/Functional/Bundle/LegacyTestBundle/Controller/InvokableServiceController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\DiExtraBundle\Tests\Functional\Bundle\LegacyTestBundle\Controller; | ||
|
||
use JMS\DiExtraBundle\Annotation as DI; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
/** | ||
* @DI\Service("controller.invokable") | ||
*/ | ||
class InvokableServiceController | ||
{ | ||
public function __invoke() | ||
{ | ||
return new Response('invoked'); | ||
} | ||
} |
Oops, something went wrong.