@@ -151,11 +151,12 @@ public function testAwaitWithoutPromise(PromiseAdapterInterface $Adapter, $conte
151151 * @dataProvider AdapterDataProvider
152152 * @param PromiseAdapterInterface $Adapter
153153 *
154- * @expectedException \Exception
155- * @expectedExceptionMessage error!
156154 */
157155 public function testAwaitWithUnwrap (PromiseAdapterInterface $ Adapter )
158156 {
157+ $ this ->expectException (\Exception::class);
158+ $ this ->expectExceptionMessage ('error! ' );
159+
159160 $ expected = new \Exception ('error! ' );
160161 $ promise = $ Adapter ->createRejected ($ expected );
161162
@@ -165,24 +166,24 @@ public function testAwaitWithUnwrap(PromiseAdapterInterface $Adapter)
165166 /**
166167 * @dataProvider AdapterDataProvider
167168 * @param PromiseAdapterInterface $Adapter
168- *
169- * @expectedException \InvalidArgumentException
170- * @expectedExceptionMessage ::await" method must be called with a Promise ("then" method).
171169 */
172170 public function testAwaitWithInvalidPromise (PromiseAdapterInterface $ Adapter )
173171 {
172+ $ this ->expectException (\InvalidArgumentException::class);
173+ $ this ->expectExceptionMessage ('::await" method must be called with a Promise ("then" method). ' );
174+
174175 $ Adapter ->await (new \stdClass (), true );
175176 }
176177
177178 /**
178179 * @dataProvider AdapterDataProvider
179180 * @param PromiseAdapterInterface $Adapter
180- *
181- * @expectedException \Exception
182- * @expectedExceptionMessage Cancel promise!
183181 */
184182 public function testCancel (PromiseAdapterInterface $ Adapter )
185183 {
184+ $ this ->expectException (\Exception::class);
185+ $ this ->expectExceptionMessage ('Cancel promise! ' );
186+
186187 $ promise = $ Adapter ->create ($ resolve , $ reject , function () {
187188 throw new \Exception ('Cancel promise! ' );
188189 });
@@ -194,12 +195,12 @@ public function testCancel(PromiseAdapterInterface $Adapter)
194195 /**
195196 * @dataProvider AdapterDataProvider
196197 * @param PromiseAdapterInterface $Adapter
197- *
198- * @expectedException \Exception
199- * @expectedExceptionMessage ::cancel" method must be called with a compatible Promise.
200198 */
201199 public function testCancelInvalidPromise (PromiseAdapterInterface $ Adapter )
202200 {
201+ $ this ->expectException (\Exception::class);
202+ $ this ->expectExceptionMessage ('::cancel" method must be called with a compatible Promise. ' );
203+
203204 $ Adapter ->create ($ resolve , $ reject , function () {
204205 throw new \Exception ('Cancel will never be called! ' );
205206 });
0 commit comments