1212namespace Composer \XdebugHandler \Tests ;
1313
1414use Composer \XdebugHandler \Tests \Helpers \BaseTestCase ;
15- use Composer \XdebugHandler \Tests \Helpers \LoggerFactory ;
15+ use Composer \XdebugHandler \Tests \Helpers \Logger ;
1616use Composer \XdebugHandler \XdebugHandler ;
1717
1818class ClassTest extends BaseTestCase
@@ -22,7 +22,7 @@ class ClassTest extends BaseTestCase
2222 */
2323 public function testConstructorThrowsOnEmptyEnvPrefix ()
2424 {
25- $ this ->setException ('RuntimeException ' );
25+ $ this ->expectException ('RuntimeException ' );
2626 new XdebugHandler ('' );
2727 }
2828
@@ -31,7 +31,7 @@ public function testConstructorThrowsOnEmptyEnvPrefix()
3131 */
3232 public function testConstructorThrowsOnInvalidEnvPrefix ()
3333 {
34- $ this ->setException ('RuntimeException ' );
34+ $ this ->expectException ('RuntimeException ' );
3535 /** @phpstan-ignore-next-line */
3636 new XdebugHandler (array ('name ' ));
3737 }
@@ -59,7 +59,7 @@ public function setterProvider()
5959 {
6060 // $setter, $value
6161 return array (
62- 'setLogger ' => array ('setLogger ' , LoggerFactory:: createLogger ()),
62+ 'setLogger ' => array ('setLogger ' , new Logger ()),
6363 'setMainScript ' => array ('setMainScript ' , '-- ' ),
6464 'setPersistent ' => array ('setPersistent ' , null ),
6565 );
@@ -68,8 +68,7 @@ public function setterProvider()
6868 /**
6969 * Test compatibility with 1.x for extending classes
7070 *
71- * @requires PHP 7.1
72- * @dataProvider methodProvider *
71+ * @dataProvider methodProvider
7372 * @param string $method
7473 *
7574 * @return void
@@ -94,20 +93,4 @@ public function methodProvider()
9493 array ('restart ' ),
9594 );
9695 }
97-
98- /**
99- * @param string $exception
100- * @phpstan-param class-string<\Exception> $exception
101- *
102- * @return void
103- */
104- private function setException ($ exception )
105- {
106- if (method_exists ($ this , 'expectException ' )) {
107- $ this ->expectException ($ exception );
108- } else {
109- /** @phpstan-ignore-next-line */
110- $ this ->setExpectedException ($ exception );
111- }
112- }
11396}
0 commit comments