Skip to content

Commit

Permalink
refactor: Autofix code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed May 10, 2021
1 parent ce3df60 commit d245d4e
Show file tree
Hide file tree
Showing 27 changed files with 271 additions and 196 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2020, ECPHP
Copyright (c) 2019-2021, ECPHP.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
190 changes: 103 additions & 87 deletions spec/EcPhp/CasBundle/Cas.php
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle;
Expand All @@ -25,23 +30,25 @@ public static function getHttpClientMock()
case 'http://local/cas/serviceValidate?ticket=PT-ticket&service=http%3A%2F%2Flocal%2Fcas%2FproxyValidate%3Fservice%3Dservice':
case 'http://local/cas/serviceValidate?ticket=PT-ticket&service=http%3A%2F%2Ffrom':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/serviceValidate?service=service&ticket=ticket-failure':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationFailure>
</cas:authenticationFailure>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationFailure>
</cas:authenticationFailure>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/proxyValidate?service=service&ticket=ticket':
case 'http://local/cas/proxyValidate?ticket=PT-ticket&service=http%3A%2F%2Ffrom':
case 'http://local/cas/proxyValidate?ticket=ST-ticket&service=http%3A%2F%2Ffrom':
Expand All @@ -50,118 +57,127 @@ public static function getHttpClientMock()
case 'http://local/cas/proxyValidate?service=http%3A%2F%2Flocal%2Fcas%2FserviceValidate%3Fservice%3Dservice&ticket=ticket':
case 'http://local/cas/proxyValidate?service=http%3A%2F%2Flocal%2Fcas%2FserviceValidate%3Fservice%3Dservice%26renew%3Dtrue&ticket=ticket&renew=true':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxies>
<cas:proxy>http://app/proxyCallback.php</cas:proxy>
</cas:proxies>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxies>
<cas:proxy>http://app/proxyCallback.php</cas:proxy>
</cas:proxies>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/serviceValidate?ticket=ST-ticket-pgt&service=http%3A%2F%2Ffrom':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIou</cas:proxyGrantingTicket>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIou</cas:proxyGrantingTicket>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/serviceValidate?ticket=ST-ticket-pgt-pgtiou-not-found&service=http%3A%2F%2Ffrom':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>unknownPgtIou</cas:proxyGrantingTicket>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>unknownPgtIou</cas:proxyGrantingTicket>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/proxyValidate?ticket=ST-ticket-pgt-pgtiou-pgtid-null&service=http%3A%2F%2Ffrom':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIouWithPgtIdNull</cas:proxyGrantingTicket>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIouWithPgtIdNull</cas:proxyGrantingTicket>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/proxyValidate?service=service&ticket=ST-ticket-pgt':
case 'http://local/cas/proxyValidate?ticket=ST-ticket-pgt&service=http%3A%2F%2Ffrom':
case 'http://local/cas/proxyValidate?service=http%3A%2F%2Flocal%2Fcas%2FproxyValidate%3Fservice%3Dhttp%253A%252F%252Ffrom&ticket=PT-ticket-pgt':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIou</cas:proxyGrantingTicket>
<cas:proxies>
<cas:proxy>http://app/proxyCallback.php</cas:proxy>
</cas:proxies>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIou</cas:proxyGrantingTicket>
<cas:proxies>
<cas:proxy>http://app/proxyCallback.php</cas:proxy>
</cas:proxies>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/serviceValidate?service=http%3A%2F%2Flocal%2Fcas%2FserviceValidate%3Fservice%3Dservice%26format%3DJSON&ticket=ticket&format=JSON':
$body = <<< 'EOF'
{
"serviceResponse": {
"authenticationSuccess": {
"user": "username"
}
}
}
EOF;
{
"serviceResponse": {
"authenticationSuccess": {
"user": "username"
}
}
}
EOF;

break;

case 'http://local/cas/proxyValidate?service=http%3A%2F%2Ffrom&ticket=PT-ticket':
$body = <<< 'EOF'
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIou</cas:proxyGrantingTicket>
<cas:proxies>
<cas:proxy>http://app/proxyCallback.php</cas:proxy>
</cas:proxies>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
<cas:proxyGrantingTicket>pgtIou</cas:proxyGrantingTicket>
<cas:proxies>
<cas:proxy>http://app/proxyCallback.php</cas:proxy>
</cas:proxies>
</cas:authenticationSuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/proxy?targetService=targetService&pgt=pgt':
$body = <<< 'EOF'
<?xml version="1.0" encoding="utf-8"?>
<cas:serviceResponse xmlns:cas="https://ecas.ec.europa.eu/cas/schemas"
server="ECAS MOCKUP version 4.6.0.20924 - 09/02/2016 - 14:37"
date="2019-10-18T12:17:53.069+02:00" version="4.5">
<cas:proxySuccess>
<cas:proxyTicket>PT-214-A3OoEPNr4Q9kNNuYzmfN8azU31aDUsuW8nk380k7wDExT5PFJpxR1TrNI3q3VGzyDdi0DpZ1LKb8IhPKZKQvavW-8hnfexYjmLCx7qWNsLib1W-DCzzoLVTosAUFzP3XDn5dNzoNtxIXV9KSztF9fYhwHvU0</cas:proxyTicket>
</cas:proxySuccess>
</cas:serviceResponse>
EOF;
<?xml version="1.0" encoding="utf-8"?>
<cas:serviceResponse xmlns:cas="https://ecas.ec.europa.eu/cas/schemas"
server="ECAS MOCKUP version 4.6.0.20924 - 09/02/2016 - 14:37"
date="2019-10-18T12:17:53.069+02:00" version="4.5">
<cas:proxySuccess>
<cas:proxyTicket>PT-214-A3OoEPNr4Q9kNNuYzmfN8azU31aDUsuW8nk380k7wDExT5PFJpxR1TrNI3q3VGzyDdi0DpZ1LKb8IhPKZKQvavW-8hnfexYjmLCx7qWNsLib1W-DCzzoLVTosAUFzP3XDn5dNzoNtxIXV9KSztF9fYhwHvU0</cas:proxyTicket>
</cas:proxySuccess>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/proxy?targetService=targetService&pgt=pgt-error-in-getCredentials':
$body = <<< 'EOF'
<?xml version="1.0" encoding="utf-8"?>
<cas:serviceResponse xmlns:cas="https://ecas.ec.europa.eu/cas/schemas"
server="ECAS MOCKUP version 4.6.0.20924 - 09/02/2016 - 14:37"
date="2019-10-18T12:17:53.069+02:00" version="4.5">
<cas:proxyFailure>
TODO: Find something to put here.
</cas:proxyFailure>
</cas:serviceResponse>
EOF;
<?xml version="1.0" encoding="utf-8"?>
<cas:serviceResponse xmlns:cas="https://ecas.ec.europa.eu/cas/schemas"
server="ECAS MOCKUP version 4.6.0.20924 - 09/02/2016 - 14:37"
date="2019-10-18T12:17:53.069+02:00" version="4.5">
<cas:proxyFailure>
TODO: Find something to put here.
</cas:proxyFailure>
</cas:serviceResponse>
EOF;

break;

case 'http://local/cas/serviceValidate?service=http%3A%2F%2Ffrom&ticket=BAD-http-query':
case 'http://local/cas/proxyValidate?service=http%3A%2F%2Ffrom&ticket=BAD-http-query':
case 'http://local/cas/proxyValidate?service=http%3A%2F%2Flocal%2Fcas%2FproxyValidate%3Fservice%3Dservice%26error%3DTestClientException&ticket=ticket&error=TestClientException':
Expand Down
5 changes: 5 additions & 0 deletions spec/EcPhp/CasBundle/Configuration/SymfonySpec.php
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle\Configuration;
Expand Down
5 changes: 5 additions & 0 deletions spec/EcPhp/CasBundle/Controller/HomepageSpec.php
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle\Controller;
Expand Down
5 changes: 5 additions & 0 deletions spec/EcPhp/CasBundle/Controller/LoginSpec.php
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle\Controller;
Expand Down
5 changes: 5 additions & 0 deletions spec/EcPhp/CasBundle/Controller/LogoutSpec.php
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle\Controller;
Expand Down
5 changes: 5 additions & 0 deletions spec/EcPhp/CasBundle/Controller/ProxyCallbackSpec.php
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle\Controller;
Expand Down
5 changes: 5 additions & 0 deletions spec/EcPhp/CasBundle/DependencyInjection/CasExtensionSpec.php
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle\DependencyInjection;
Expand Down
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace spec\EcPhp\CasBundle\DependencyInjection;
Expand Down

0 comments on commit d245d4e

Please sign in to comment.