@@ 12-34 (lines=23) @@ | ||
9 | use PhpSpec\ObjectBehavior; |
|
10 | use Prophecy\Argument; |
|
11 | ||
12 | class InfoSpec extends ObjectBehavior |
|
13 | { |
|
14 | public function let(Client $client, HttpClient $http, Request $request, Response $response) |
|
15 | { |
|
16 | $client->getHttpClient()->willReturn($http); |
|
17 | $client->getProjectIdentifier()->willReturn('akeneo'); |
|
18 | $client->getProjectApiKey()->willReturn('1234'); |
|
19 | $http->get('project/akeneo/info?key=1234')->willReturn($request); |
|
20 | $request->send()->willReturn($response); |
|
21 | $response->getBody(true)->willReturn('<xml></xml>'); |
|
22 | $this->beConstructedWith($client); |
|
23 | } |
|
24 | ||
25 | public function it_should_be_an_api() |
|
26 | { |
|
27 | $this->shouldBeAnInstanceOf('Akeneo\Crowdin\Api\AbstractApi'); |
|
28 | } |
|
29 | ||
30 | public function it_gets_project_info() |
|
31 | { |
|
32 | $this->execute()->shouldBe('<xml></xml>'); |
|
33 | } |
|
34 | } |
|
35 |
@@ 12-34 (lines=23) @@ | ||
9 | use PhpSpec\ObjectBehavior; |
|
10 | use Prophecy\Argument; |
|
11 | ||
12 | class StatusSpec extends ObjectBehavior |
|
13 | { |
|
14 | public function let(Client $client, HttpClient $http, Request $request, Response $response) |
|
15 | { |
|
16 | $client->getHttpClient()->willReturn($http); |
|
17 | $client->getProjectIdentifier()->willReturn('akeneo'); |
|
18 | $client->getProjectApiKey()->willReturn('1234'); |
|
19 | $http->get('project/akeneo/status?key=1234')->willReturn($request); |
|
20 | $request->send()->willReturn($response); |
|
21 | $response->getBody(true)->willReturn('<xml></xml>'); |
|
22 | $this->beConstructedWith($client); |
|
23 | } |
|
24 | ||
25 | public function it_should_be_an_api() |
|
26 | { |
|
27 | $this->shouldBeAnInstanceOf('Akeneo\Crowdin\Api\AbstractApi'); |
|
28 | } |
|
29 | ||
30 | public function it_gets_project_translations_status() |
|
31 | { |
|
32 | $this->execute()->shouldBe('<xml></xml>'); |
|
33 | } |
|
34 | } |
|
35 |