Skip to content

Commit

Permalink
Update tests coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Aug 7, 2020
1 parent 0744cbf commit 249503f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion phpspec.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ extensions:
output:
html: build/coverage
clover: build/logs/clover.xml
php: build/coverage.php
php: build/coverage.php
47 changes: 47 additions & 0 deletions spec/EcPhp/EuLoginBundle/Security/Core/User/EuLoginUserSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,34 @@ public function it_can_get_the_attributes_only(CasUserInterface $user)
public function it_is_initializable()
{
$this->shouldHaveType(EuLoginUser::class);

$this
->getPassword()
->shouldBeNull();

$this
->getPgt()
->shouldReturn('proxyGrantingTicket');

$this
->getSalt()
->shouldBeNull();

$this
->getAttribute('user')
->shouldReturn('username');

$this
->getUser()
->shouldReturn('username');

$this
->get('foo', 'bar')
->shouldReturn('bar');

$this
->eraseCredentials()
->shouldBeNull();
}

public function let(CasUserInterface $user)
Expand All @@ -165,6 +193,9 @@ public function let(CasUserInterface $user)
<cas:proxies>
<cas:proxy>foo</cas:proxy>
</cas:proxies>
<cas:proxyGrantingTicket>
proxyGrantingTicket
</cas:proxyGrantingTicket>
<cas:attributes>
<cas:authenticationFactors>
<cas:moniker number="1">
Expand Down Expand Up @@ -207,6 +238,22 @@ public function let(CasUserInterface $user)
],
]);

$user
->get('foo', 'bar')
->willReturn('bar');

$user
->getUsername()
->willReturn('username');

$user
->getAttribute('user', null)
->willReturn('username');

$user
->getPgt()
->willReturn('proxyGrantingTicket');

$user
->getAttribute('assuranceLevel')
->willReturn($data['attributes']['assuranceLevel']);
Expand Down

0 comments on commit 249503f

Please sign in to comment.