Skip to content

Commit 01ce620

Browse files
committed
Fix bad merge for IterableAPICollection, fix tests to move to expectExceptionMessage
1 parent 6be466f commit 01ce620

File tree

3 files changed

+8
-42
lines changed

3 files changed

+8
-42
lines changed

src/Entity/IterableAPICollection.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,6 @@ class IterableAPICollection implements ClientAwareInterface, Iterator, Countable
7373
*/
7474
protected int $current = 0;
7575

76-
/**
77-
* This allows for override if the endpoint API uses a different query key
78-
*/
79-
protected string $pageIndexKey = 'page_index';
80-
81-
/**
82-
* This allows for override if the endpoint API uses a different query key
83-
*/
84-
protected string $pageSizeKey = 'page_size';
85-
8676
/**
8777
* Count the items in the response instead of returning the count parameter
8878
*
@@ -181,30 +171,6 @@ public function hydrateEntity($data, $id = null)
181171
return $data;
182172
}
183173

184-
public function getPageIndexKey(): string
185-
{
186-
return $this->pageIndexKey;
187-
}
188-
189-
public function setPageIndexKey(string $pageIndexKey): IterableAPICollection
190-
{
191-
$this->pageIndexKey = $pageIndexKey;
192-
193-
return $this;
194-
}
195-
196-
public function getPageSizeKey(): string
197-
{
198-
return $this->pageSizeKey;
199-
}
200-
201-
public function setPageSizeKey(string $pageSizeKey): IterableAPICollection
202-
{
203-
$this->pageSizeKey = $pageSizeKey;
204-
205-
return $this;
206-
}
207-
208174
public function getResourceRoot(): array
209175
{
210176
// Handles issues where an API returns empty for no results, as opposed

test/Meetings/ClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function testClientWillHandleUnauthorizedRequests(): void
137137
}))->willReturn($this->getResponse('empty', 403));
138138

139139
$this->expectException(Client\Exception\Credentials::class);
140-
$this->expectErrorMessage('You are not authorised to perform this request');
140+
$this->expectExceptionMessage('You are not authorised to perform this request');
141141
$response = $this->meetingsClient->createRoom('test-room');
142142
}
143143

@@ -154,7 +154,7 @@ public function testClientWillHandleNotFoundResponse(): void
154154
return true;
155155
}))->willReturn($this->getResponse('empty', 404));
156156
$this->expectException(NotFound::class);
157-
$this->expectErrorMessage('No resource found');
157+
$this->expectExceptionMessage('No resource found');
158158
$response = $this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
159159
}
160160

@@ -171,7 +171,7 @@ public function testClientWillHandleValidationError(): void
171171
}))->willReturn($this->getResponse('empty', 400));
172172

173173
$this->expectException(Validation::class);
174-
$this->expectErrorMessage('The request data was invalid');
174+
$this->expectExceptionMessage('The request data was invalid');
175175

176176
$response = $this->meetingsClient->createRoom('test-room');
177177
}
@@ -368,7 +368,7 @@ public function testWillHandleConflictErrorOnThemeCreation(): void
368368
}))->willReturn($this->getResponse('empty', 409));
369369

370370
$this->expectException(Conflict::class);
371-
$this->expectErrorMessage('Entity conflict');
371+
$this->expectExceptionMessage('Entity conflict');
372372
$response = $this->meetingsClient->createApplicationTheme('My-Theme');
373373
}
374374

test/Voice/NCCO/Action/PayTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testCanAddToNCCO(): void
4242
public function testThrowsErrorWithNoAmount(): void
4343
{
4444
$this->expectException(InvalidArgumentException::class);
45-
$this->expectErrorMessage('Amount is required for this action.');
45+
$this->expectExceptionMessage('Amount is required for this action.');
4646
$payAction = Pay::factory(['currency' => 'eur']);
4747
}
4848

@@ -76,7 +76,7 @@ public function testCannotAddCurrencyAsFloat(): void
7676
public function testCannotAddInvalidVoiceSetting()
7777
{
7878
$this->expectException(InvalidArgumentException::class);
79-
$this->expectErrorMessage('type did not fall under permitted voice settings');
79+
$this->expectExceptionMessage('type did not fall under permitted voice settings');
8080

8181
$payAction = Pay::factory([
8282
'amount' => 9.99,
@@ -131,7 +131,7 @@ public function testCanAddPrompts(): void
131131
public function testCannotAddPromptsWithWrongType(): void
132132
{
133133
$this->expectException(InvalidArgumentException::class);
134-
$this->expectErrorMessage('invalid prompt type');
134+
$this->expectExceptionMessage('invalid prompt type');
135135

136136
$payAction = Pay::factory([
137137
'amount' => 9.99,
@@ -151,7 +151,7 @@ public function testCannotAddPromptsWithWrongType(): void
151151
public function testCannotAddPromptWithoutText(): void
152152
{
153153
$this->expectException(InvalidArgumentException::class);
154-
$this->expectErrorMessage('text is required when setting error text prompts.');
154+
$this->expectExceptionMessage('text is required when setting error text prompts.');
155155

156156
$payAction = Pay::factory([
157157
'amount' => 9.99,

0 commit comments

Comments
 (0)