1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace spec\Xabbuh\XApi\Model; |
4
|
|
|
|
5
|
|
|
use PhpSpec\ObjectBehavior; |
6
|
|
|
use Xabbuh\XApi\Model\Account; |
7
|
|
|
|
8
|
|
|
class InverseFunctionalIdentifierSpec extends ObjectBehavior |
9
|
|
|
{ |
10
|
|
|
function it_can_be_built_with_an_mbox() |
11
|
|
|
{ |
12
|
|
|
$this->beConstructedThrough( |
13
|
|
|
array('Xabbuh\XApi\Model\InverseFunctionalIdentifier', 'withMbox'), |
14
|
|
|
array('mailto:[email protected]') |
15
|
|
|
); |
16
|
|
|
|
17
|
|
|
$this->getMbox()->shouldReturn('mailto:[email protected]'); |
18
|
|
|
$this->getMboxSha1Sum()->shouldReturn(null); |
19
|
|
|
$this->getOpenId()->shouldReturn(null); |
20
|
|
|
$this->getAccount()->shouldReturn(null); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
function it_can_be_built_with_an_mbox_sha1_sum() |
24
|
|
|
{ |
25
|
|
|
$this->beConstructedThrough( |
26
|
|
|
array('Xabbuh\XApi\Model\InverseFunctionalIdentifier', 'withMboxSha1Sum'), |
27
|
|
|
array('db77b9104b531ecbb0b967f6942549d0ba80fda1') |
28
|
|
|
); |
29
|
|
|
|
30
|
|
|
$this->getMbox()->shouldReturn(null); |
31
|
|
|
$this->getMboxSha1Sum()->shouldReturn('db77b9104b531ecbb0b967f6942549d0ba80fda1'); |
32
|
|
|
$this->getOpenId()->shouldReturn(null); |
33
|
|
|
$this->getAccount()->shouldReturn(null); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
function it_can_be_built_with_an_openid() |
37
|
|
|
{ |
38
|
|
|
$this->beConstructedThrough( |
39
|
|
|
array('Xabbuh\XApi\Model\InverseFunctionalIdentifier', 'withOpenId'), |
40
|
|
|
array('http://openid.tincanapi.com') |
41
|
|
|
); |
42
|
|
|
|
43
|
|
|
$this->getMbox()->shouldReturn(null); |
44
|
|
|
$this->getMboxSha1Sum()->shouldReturn(null); |
45
|
|
|
$this->getOpenId()->shouldReturn('http://openid.tincanapi.com'); |
46
|
|
|
$this->getAccount()->shouldReturn(null); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
function it_can_be_built_with_an_account() |
50
|
|
|
{ |
51
|
|
|
$account = new Account('test', 'https://tincanapi.com'); |
52
|
|
|
$this->beConstructedThrough( |
53
|
|
|
array('Xabbuh\XApi\Model\InverseFunctionalIdentifier', 'withAccount'), |
54
|
|
|
array($account) |
55
|
|
|
); |
56
|
|
|
|
57
|
|
|
$this->getMbox()->shouldReturn(null); |
58
|
|
|
$this->getMboxSha1Sum()->shouldReturn(null); |
59
|
|
|
$this->getOpenId()->shouldReturn(null); |
60
|
|
|
$this->getAccount()->shouldReturn($account); |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|