1010 */
1111final class BaseFactoryTest extends TestCase
1212{
13- public function testNoDiscoveryReturnsEmptyArray ()
13+ public function testNoDiscoveryReturnsEmptyArray (): void
1414 {
1515 $ factory = new class () extends BaseFactory {
1616 public const HANDLER_PATH = 'Bananas ' ;
@@ -19,7 +19,7 @@ public function testNoDiscoveryReturnsEmptyArray()
1919 $ this ->assertSame ([], $ factory ::findAll ());
2020 }
2121
22- public function testGetHandlerClassReturnsClass ()
22+ public function testGetHandlerClassReturnsClass (): void
2323 {
2424 $ expected = 'Tests\Support\Cars\WidgetCar ' ;
2525
@@ -29,36 +29,36 @@ public function testGetHandlerClassReturnsClass()
2929 $ this ->assertSame ($ expected , $ result );
3030 }
3131
32- public function testGetHandlerClassRequiresPhpExtension ()
32+ public function testGetHandlerClassRequiresPhpExtension (): void
3333 {
3434 $ result = CarFactory::getHandlerClass ('foo ' , 'bar ' );
3535
3636 $ this ->assertNull ($ result );
3737 }
3838
39- public function testGetHandlerClassRequiresInterfaces ()
39+ public function testGetHandlerClassRequiresInterfaces (): void
4040 {
4141 $ result = CarFactory::getHandlerClass (SUPPORTPATH . 'Cars/NotCar.php ' , 'Tests\Support ' );
4242
4343 $ this ->assertNull ($ result );
4444 }
4545
46- public function testGetHandlerClassRequiresHandlerInterface ()
46+ public function testGetHandlerClassRequiresHandlerInterface (): void
4747 {
4848 $ result = CarFactory::getHandlerClass (SUPPORTPATH . 'Cars/BadCar.php ' , 'Tests\Support ' );
4949
5050 $ this ->assertNull ($ result );
5151 }
5252
53- public function testGetHandlerClassFails ()
53+ public function testGetHandlerClassFails (): void
5454 {
5555 $ file = realpath (SUPPORTPATH . 'Cars/WidgetCar.php ' );
5656 $ result = CarFactory::getHandlerClass ($ file , 'Foo\Bar ' );
5757
5858 $ this ->assertNull ($ result );
5959 }
6060
61- public function testIgnoresClass ()
61+ public function testIgnoresClass (): void
6262 {
6363 config ('Handlers ' )->ignoredClasses [] = 'Tests\Support\Cars\PopCar ' ;
6464
@@ -68,7 +68,7 @@ public function testIgnoresClass()
6868 $ this ->assertSame ($ expected , $ result );
6969 }
7070
71- public function testCollision ()
71+ public function testCollision (): void
7272 {
7373 // Stop ignoring the collision clas
7474 config ('Handlers ' )->ignoredClasses = [];
@@ -79,7 +79,7 @@ public function testCollision()
7979 CarFactory::findAll ();
8080 }
8181
82- public function testFindAll ()
82+ public function testFindAll (): void
8383 {
8484 $ expected = [
8585 'pop ' => 'Tests\Support\Cars\PopCar ' ,
@@ -91,7 +91,7 @@ public function testFindAll()
9191 $ this ->assertSame ($ expected , $ result );
9292 }
9393
94- public function testFind ()
94+ public function testFind (): void
9595 {
9696 $ expected = 'Tests\Support\Cars\PopCar ' ;
9797
@@ -100,15 +100,15 @@ public function testFind()
100100 $ this ->assertSame ($ expected , $ result );
101101 }
102102
103- public function testFindThrows ()
103+ public function testFindThrows (): void
104104 {
105105 $ this ->expectException ('RuntimeException ' );
106106 $ this ->expectExceptionMessage ('Unknown handler "banana" for ' . CarFactory::class);
107107
108108 CarFactory::find ('banana ' );
109109 }
110110
111- public function testResetSingle ()
111+ public function testResetSingle (): void
112112 {
113113 CarFactory::findAll ();
114114 FactoryFactory::findAll ();
@@ -121,7 +121,7 @@ public function testResetSingle()
121121 $ this ->assertSame (['Factories ' ], array_keys ($ result ));
122122 }
123123
124- public function testResetAll ()
124+ public function testResetAll (): void
125125 {
126126 CarFactory::findAll ();
127127 FactoryFactory::findAll ();
0 commit comments