Skip to content

Commit 111e5a5

Browse files
authored
Merge pull request #6 from interfax/5-fix-mark-endpoint
Fix endpoint for marking inbound faxes as read
2 parents 5bd86a4 + d24ae8e commit 111e5a5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Interfax/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class Client
2222
{
23-
const VERSION = '1.1.1';
23+
const VERSION = '1.1.2';
2424

2525
/**
2626
* @var GenericFactory
@@ -84,7 +84,7 @@ public function __construct($params = [], GenericFactory $factory = null)
8484

8585
$this->base_uri = rtrim($params['base_uri'], '/');
8686
}
87-
87+
8888
$this->username = $username;
8989
$this->password = $password;
9090
if ($this->username === '' || $this->password === '') {
@@ -179,7 +179,7 @@ protected function getCompleteRequestParams($params = [])
179179
}
180180
}
181181
}
182-
182+
183183
return $complete;
184184
}
185185

@@ -199,7 +199,7 @@ public function post($uri, $params = [], $multipart = [])
199199
} else {
200200
$request_params = $this->getCompleteRequestParams($params);
201201
}
202-
202+
203203
try {
204204
return $this->parseResponse(
205205
$this->getHttpClient()->request('POST', $uri, $request_params)

src/Interfax/Inbound/Fax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Fax extends Resource
2828
*/
2929
protected function mark($unread = true)
3030
{
31-
$this->client->post($this->resource_uri, ['query' => ['unread' => $unread]]);
31+
$this->client->post($this->resource_uri . '/mark', ['query' => ['unread' => $unread]]);
3232

3333
return $this;
3434
}

tests/Interfax/Inbound/FaxTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function test_markRead()
2727

2828
$client->expects($this->once())
2929
->method('post')
30-
->with('/inbound/faxes/854759652', ['query' => ['unread' => false]])
30+
->with('/inbound/faxes/854759652/mark', ['query' => ['unread' => false]])
3131
->will($this->returnValue(''));
3232

3333
$fax = new Fax($client, 854759652);
@@ -44,7 +44,7 @@ public function test_markUnread()
4444

4545
$client->expects($this->once())
4646
->method('post')
47-
->with('/inbound/faxes/854759652', ['query' => ['unread' => true]])
47+
->with('/inbound/faxes/854759652/mark', ['query' => ['unread' => true]])
4848
->will($this->returnValue(''));
4949

5050
$fax = new Fax($client, 854759652);
@@ -139,4 +139,4 @@ public function test_emails()
139139
$fax = new Fax($client, 854759652);
140140
$this->assertEquals($response, $fax->emails());
141141
}
142-
}
142+
}

0 commit comments

Comments
 (0)