@@ -80,11 +80,9 @@ public function testGetConnection()
8080 $ this ->assertNotNull ($ this ->connection ->getConnection ());
8181 }
8282
83- /**
84- * @expectedException Foolz\SphinxQL\Exception\ConnectionException
85- */
8683 public function testGetConnectionThrowsException ()
8784 {
85+ $ this ->expectException (Foolz \SphinxQL \Exception \ConnectionException::class);
8886 $ this ->connection ->getConnection ();
8987 }
9088
@@ -96,11 +94,9 @@ public function testConnect()
9694 $ this ->connection ->connect ();
9795 }
9896
99- /**
100- * @expectedException Foolz\SphinxQL\Exception\ConnectionException
101- */
10297 public function testConnectThrowsException ()
10398 {
99+ $ this ->expectException (Foolz \SphinxQL \Exception \ConnectionException::class);
104100 $ this ->connection ->setParam ('port ' , 9308 );
105101 $ this ->connection ->connect ();
106102 }
@@ -111,11 +107,9 @@ public function testPing()
111107 $ this ->assertTrue ($ this ->connection ->ping ());
112108 }
113109
114- /**
115- * @expectedException Foolz\SphinxQL\Exception\ConnectionException
116- */
117110 public function testClose ()
118111 {
112+ $ this ->expectException (Foolz \SphinxQL \Exception \ConnectionException::class);
119113 $ encoding = mb_internal_encoding ();
120114 $ this ->connection ->connect ();
121115
@@ -150,29 +144,23 @@ public function testMultiQuery()
150144 ), $ query ->getNext ()->fetchAllAssoc ());
151145 }
152146
153- /**
154- * @expectedException Foolz\SphinxQL\Exception\SphinxQLException
155- * @expectedExceptionMessage The Queue is empty.
156- */
157147 public function testEmptyMultiQuery ()
158148 {
149+ $ this ->expectException (Foolz \SphinxQL \Exception \SphinxQLException::class);
150+ $ this ->expectExceptionMessage ('The Queue is empty. ' );
159151 $ this ->connection ->connect ();
160152 $ this ->connection ->multiQuery (array ());
161153 }
162154
163- /**
164- * @expectedException Foolz\SphinxQL\Exception\DatabaseException
165- */
166155 public function testMultiQueryThrowsException ()
167156 {
157+ $ this ->expectException (Foolz \SphinxQL \Exception \DatabaseException::class);
168158 $ this ->connection ->multiQuery (array ('SHOW METAL ' ));
169159 }
170160
171- /**
172- * @expectedException Foolz\SphinxQL\Exception\DatabaseException
173- */
174161 public function testQueryThrowsException ()
175162 {
163+ $ this ->expectException (Foolz \SphinxQL \Exception \DatabaseException::class);
176164 $ this ->connection ->query ('SHOW METAL ' );
177165 }
178166
@@ -182,11 +170,9 @@ public function testEscape()
182170 $ this ->assertEquals ('\'\\\' \\" \\" \\\'\\\' \'' , $ result );
183171 }
184172
185- /**
186- * @expectedException Foolz\SphinxQL\Exception\ConnectionException
187- */
188173 public function testEscapeThrowsException ()
189174 {
175+ $ this ->expectException (Foolz \SphinxQL \Exception \ConnectionException::class);
190176 // or we get the wrong error popping up
191177 $ this ->connection ->setParam ('port ' , 9308 );
192178 $ this ->connection ->connect ();
0 commit comments