Skip to content

Commit

Permalink
Remove obsolete abstract class.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Aug 4, 2020
1 parent 6f49f5c commit 6faa301
Show file tree
Hide file tree
Showing 4 changed files with 312 additions and 300 deletions.
47 changes: 40 additions & 7 deletions spec/tests/EcPhp/CasLib/CasSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@

namespace spec\tests\EcPhp\CasLib;

use EcPhp\CasLib\Cas;
use EcPhp\CasLib\Introspection\Introspector;
use Nyholm\Psr7\Factory\Psr17Factory;
use Nyholm\Psr7Server\ServerRequestCreator;
use PhpSpec\ObjectBehavior;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use spec\EcPhp\CasLib\Cas as CasSpecUtils;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\HttpClient\Psr18Client;

class CasSpec extends ObjectBehavior
{
public function it_can_test_the_proxy_mode_with_pgtUrl(CacheItemPoolInterface $cache, LoggerInterface $logger)
public function it_can_test_the_proxy_mode_with_pgtUrl()
{
$properties = CasSpecUtils::getTestPropertiesWithPgtUrl();
$client = new Psr18Client(CasSpecUtils::getHttpClientMock());
Expand All @@ -29,11 +32,26 @@ public function it_can_test_the_proxy_mode_with_pgtUrl(CacheItemPoolInterface $c
);
$serverRequest = $creator->fromGlobals();

$this->beConstructedWith($serverRequest, $properties, $client, $psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory, $cache, $logger, new Introspector());
$introspector = new Introspector();

$this->beConstructedWith(new Cas(
$serverRequest,
$properties,
$client,
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory,
new ArrayAdapter(),
new NullLogger(),
$introspector
));

$this
->proxyMode()
->shouldBe(true);
->requestTicketValidation(['service' => 'service', 'ticket' => 'ticket'], null)
->getBody()
->__toString()
->shouldReturn('{"serviceResponse":{"authenticationSuccess":{"user":"username","proxies":{"proxy":"http:\/\/app\/proxyCallback.php"}}}}');
}

public function it_can_test_the_proxy_mode_without_pgtUrl(CacheItemPoolInterface $cache, LoggerInterface $logger)
Expand All @@ -50,10 +68,25 @@ public function it_can_test_the_proxy_mode_without_pgtUrl(CacheItemPoolInterface
);
$serverRequest = $creator->fromGlobals();

$this->beConstructedWith($serverRequest, $properties, $client, $psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory, $cache, $logger, new Introspector());
$introspector = new Introspector();

$this->beConstructedWith(new Cas(
$serverRequest,
$properties,
$client,
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory,
new ArrayAdapter(),
new NullLogger(),
$introspector
));

$this
->proxyMode()
->shouldBe(false);
->requestTicketValidation(['service' => 'service', 'ticket' => 'ticket'], null)
->getBody()
->__toString()
->shouldReturn('{"serviceResponse":{"authenticationSuccess":{"user":"username"}}}');
}
}
242 changes: 0 additions & 242 deletions src/AbstractCas.php

This file was deleted.

Loading

0 comments on commit 6faa301

Please sign in to comment.