Skip to content

Commit fbbdbcd

Browse files
committed
Made Communicator comply with the new Transmitter version.
1 parent 3588942 commit fbbdbcd

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

nbproject/private/private.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3-
<coverage xmlns="http://www.netbeans.org/ns/code-coverage/1" enabled="true"/>
3+
<coverage xmlns="http://www.netbeans.org/ns/code-coverage/1" enabled="false"/>
44
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
55
</project-private>

src/PEAR2/Net/RouterOS/Communicator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,14 @@ public function getNextWord()
465465
*/
466466
public function getNextWordAsStream()
467467
{
468-
$filters = array();
468+
$filters = new T\FilterCollection();
469469
if (null !== ($remoteCharset = $this->getCharset(self::CHARSET_REMOTE))
470470
&& null !== ($localCharset = $this->getCharset(self::CHARSET_LOCAL))
471471
) {
472-
$filters[
472+
$filters->append(
473473
'convert.iconv.' .
474474
$remoteCharset . '.' . $localCharset . '//IGNORE//TRANSLIT'
475-
] = array();
475+
);
476476
}
477477
$stream = $this->trans->receiveStream(
478478
self::decodeLength($this->trans), $filters, 'stream word'

tests/RequestHandlingTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,19 @@ public function testInvalidQueryArgumentAction()
416416
}
417417
}
418418

419+
public function testNonSeekableCommunicatorWord()
420+
{
421+
$value = fopen('php://input', 'r');
422+
$com = new Communicator(HOSTNAME, PORT);
423+
Client::login($com, USERNAME, PASSWORD);
424+
try {
425+
$com->sendWordFromStream('', $value);
426+
$this->fail('Call had to fail.');
427+
}catch(InvalidArgumentException $e) {
428+
$this->assertEquals(10, $e->getCode(), 'Improper exception code.');
429+
}
430+
}
431+
419432
public function testNonSeekableQueryArgumentValue()
420433
{
421434
$value = fopen('php://input', 'r');

0 commit comments

Comments
 (0)