@@ 12-30 (lines=19) @@ | ||
9 | use PhpSpec\ObjectBehavior; |
|
10 | use Prophecy\Argument; |
|
11 | ||
12 | class RepoFacadeFactorySpec extends ObjectBehavior |
|
13 | { |
|
14 | public function it_is_initializable() |
|
15 | { |
|
16 | $this->shouldHaveType('DevBoardLib\GithubApiFacade\Repo\RepoFacadeFactory'); |
|
17 | } |
|
18 | ||
19 | public function let(ClientFactory $clientFactory) |
|
20 | { |
|
21 | $this->beConstructedWith($clientFactory); |
|
22 | } |
|
23 | ||
24 | public function it_will_create_repo_facade($clientFactory, GithubRepo $githubRepo, GithubAccessToken $user, Client $client) |
|
25 | { |
|
26 | $clientFactory->createTokenAuthenticatedClient($user)->willReturn($client); |
|
27 | $this->create($githubRepo, $user) |
|
28 | ->shouldReturnAnInstanceOf('DevBoardLib\GithubApiFacade\Repo\PaginatedKnpLabsRepoFacade'); |
|
29 | } |
|
30 | } |
|
31 |
@@ 11-29 (lines=19) @@ | ||
8 | use PhpSpec\ObjectBehavior; |
|
9 | use Prophecy\Argument; |
|
10 | ||
11 | class UserFacadeFactorySpec extends ObjectBehavior |
|
12 | { |
|
13 | public function let(ClientFactory $clientFactory) |
|
14 | { |
|
15 | $this->beConstructedWith($clientFactory); |
|
16 | } |
|
17 | ||
18 | public function it_is_initializable() |
|
19 | { |
|
20 | $this->shouldHaveType('DevBoardLib\GithubApiFacade\User\UserFacadeFactory'); |
|
21 | } |
|
22 | ||
23 | public function it_will_create_repo_facade($clientFactory, GithubAccessToken $user, Client $client) |
|
24 | { |
|
25 | $clientFactory->createTokenAuthenticatedClient($user)->willReturn($client); |
|
26 | $this->create($user) |
|
27 | ->shouldReturnAnInstanceOf('DevBoardLib\GithubApiFacade\User\PaginatedKnpLabsUserFacade'); |
|
28 | } |
|
29 | } |
|
30 |