@@ -56,82 +56,6 @@ public function testConstructWithContextAssignsGivenContext()
5656 $ this ->assertSame ($ tcp , $ connectors ['tcp ' ]);
5757 }
5858
59- public function testConstructWithLegacyContextSignatureAssignsGivenContext ()
60- {
61- $ tcp = $ this ->getMockBuilder ('React\Socket\ConnectorInterface ' )->getMock ();
62-
63- $ connector = new Connector (null , array (
64- 'tcp ' => $ tcp ,
65- 'dns ' => false ,
66- 'timeout ' => false
67- ));
68-
69- $ ref = new \ReflectionProperty ($ connector , 'connectors ' );
70- $ ref ->setAccessible (true );
71- $ connectors = $ ref ->getValue ($ connector );
72-
73- $ this ->assertSame ($ tcp , $ connectors ['tcp ' ]);
74- }
75-
76- public function testConstructWithLegacyLoopSignatureAssignsGivenLoop ()
77- {
78- $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )->getMock ();
79-
80- $ connector = new Connector ($ loop );
81-
82- $ ref = new \ReflectionProperty ($ connector , 'connectors ' );
83- $ ref ->setAccessible (true );
84- $ connectors = $ ref ->getValue ($ connector );
85-
86- $ ref = new \ReflectionProperty ($ connectors ['tcp ' ], 'loop ' );
87- $ ref ->setAccessible (true );
88- $ loop = $ ref ->getValue ($ connectors ['tcp ' ]);
89-
90- $ this ->assertInstanceOf ('React\EventLoop\LoopInterface ' , $ loop );
91- }
92-
93- public function testConstructWithInvalidContextThrows ()
94- {
95- $ this ->setExpectedException ('InvalidArgumentException ' );
96- new Connector ('foo ' );
97- }
98-
99- public function testConstructWithInvalidLoopThrows ()
100- {
101- $ this ->setExpectedException ('InvalidArgumentException ' );
102- new Connector (array (), 'foo ' );
103- }
104-
105- public function testConstructWithContextTwiceThrows ()
106- {
107- $ this ->setExpectedException ('InvalidArgumentException ' );
108- new Connector (array (), array ());
109- }
110-
111- public function testConstructWithLoopTwiceThrows ()
112- {
113- $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )->getMock ();
114-
115- $ this ->setExpectedException ('InvalidArgumentException ' );
116- new Connector ($ loop , $ loop );
117- }
118-
119- public function testConstructWithNullContextAndLoopThrows ()
120- {
121- $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )->getMock ();
122-
123- $ this ->setExpectedException ('InvalidArgumentException ' );
124- new Connector (null , $ loop );
125- }
126-
127- public function testConstructWithLoopAndNullContextThrows ()
128- {
129- $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )->getMock ();
130-
131- $ this ->setExpectedException ('InvalidArgumentException ' );
132- new Connector ($ loop , null );
133- }
134-
13559 public function testConnectorUsesTcpAsDefaultScheme ()
13660 {
13761 $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )->getMock ();
0 commit comments