| @@ 40-55 (lines=16) @@ | ||
| 37 | $this->filter->shouldBe('la la la'); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function it_can_be_counted(Client $almaClient, UriInterface $url) |
|
| 41 | { |
|
| 42 | $almaClient->buildUrl('/analytics/reports', [ |
|
| 43 | 'path' => '/test/path', |
|
| 44 | 'limit' => 1000, |
|
| 45 | 'token' => null, |
|
| 46 | 'filter' => null, |
|
| 47 | ])->shouldBeCalled()->willReturn($url); |
|
| 48 | ||
| 49 | $almaClient->getXML($url) |
|
| 50 | ->shouldBeCalledTimes(1) |
|
| 51 | ->willReturn(SpecHelper::getDummyData('analytics_response.xml')); |
|
| 52 | ||
| 53 | $this->exists()->shouldReturn(true); |
|
| 54 | $this->shouldHaveCount(25); |
|
| 55 | } |
|
| 56 | ||
| 57 | public function it_parses_column_headers(Client $almaClient, UriInterface $url) |
|
| 58 | { |
|
| @@ 119-133 (lines=15) @@ | ||
| 116 | $this->shouldHaveCount(150 + 150 + 88); |
|
| 117 | } |
|
| 118 | ||
| 119 | public function it_might_not_exist(Client $almaClient, UriInterface $url) |
|
| 120 | { |
|
| 121 | $almaClient->buildUrl('/analytics/reports', [ |
|
| 122 | 'path' => '/test/path', |
|
| 123 | 'limit' => 1000, |
|
| 124 | 'token' => null, |
|
| 125 | 'filter' => null, |
|
| 126 | ])->shouldBeCalled()->willReturn($url); |
|
| 127 | ||
| 128 | $almaClient->getXML($url) |
|
| 129 | ->shouldBeCalledTimes(1) |
|
| 130 | ->willThrow(new ResourceNotFound('Path not found (/test/path)')); |
|
| 131 | ||
| 132 | $this->exists()->shouldReturn(false); |
|
| 133 | } |
|
| 134 | } |
|
| 135 | ||