Skip to content

Commit 7dc3006

Browse files
committed
Add tests for double watchers to be ignored
1 parent f5a8549 commit 7dc3006

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/AbstractLoopTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ public function testAddReadStream()
4747
$this->loop->tick();
4848
}
4949

50+
public function testAddReadStreamIgnoresSecondCallable()
51+
{
52+
list ($input, $output) = $this->createSocketPair();
53+
54+
$this->loop->addReadStream($input, $this->expectCallableExactly(2));
55+
$this->loop->addReadStream($input, $this->expectCallableNever());
56+
57+
fwrite($output, "foo\n");
58+
$this->loop->tick();
59+
60+
fwrite($output, "bar\n");
61+
$this->loop->tick();
62+
}
63+
5064
public function testAddWriteStream()
5165
{
5266
list ($input) = $this->createSocketPair();
@@ -56,6 +70,16 @@ public function testAddWriteStream()
5670
$this->loop->tick();
5771
}
5872

73+
public function testAddWriteStreamIgnoresSecondCallable()
74+
{
75+
list ($input) = $this->createSocketPair();
76+
77+
$this->loop->addWriteStream($input, $this->expectCallableExactly(2));
78+
$this->loop->addWriteStream($input, $this->expectCallableNever());
79+
$this->loop->tick();
80+
$this->loop->tick();
81+
}
82+
5983
public function testRemoveReadStreamInstantly()
6084
{
6185
list ($input, $output) = $this->createSocketPair();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy