bankiru /
rpc-server-bundle
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Bankiru\Api\Rpc\Test\Tests; |
||
| 4 | |||
| 5 | use Bankiru\Api\Rpc\Test\Kernel; |
||
| 6 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
||
| 7 | |||
| 8 | final class SecurityControllerTest extends WebTestCase |
||
| 9 | { |
||
| 10 | 1 | View Code Duplication | public function testPublicAction() |
|
0 ignored issues
–
show
|
|||
| 11 | { |
||
| 12 | 1 | $client = self::createClient(); |
|
| 13 | 1 | $client->request('POST', '/test/', ['method' => 'security/public']); |
|
| 14 | |||
| 15 | 1 | self::assertTrue($client->getResponse()->isSuccessful()); |
|
| 16 | 1 | } |
|
| 17 | |||
| 18 | /** |
||
| 19 | * @expectedException \Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException |
||
| 20 | * @expectedExceptionMessage Full authentication is required to access this resource. |
||
| 21 | */ |
||
| 22 | 1 | public function testPrivateAction() |
|
| 23 | { |
||
| 24 | 1 | self::createClient()->request('POST', '/test/', ['method' => 'security/private']); |
|
| 25 | } |
||
| 26 | |||
| 27 | protected static function getKernelClass() |
||
| 28 | { |
||
| 29 | return Kernel::class; |
||
| 30 | } |
||
| 31 | } |
||
| 32 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.