14
14
15
15
use Bazinga \GeocoderBundle \DependencyInjection \Compiler \FactoryValidatorPass ;
16
16
use PHPUnit \Framework \TestCase ;
17
- use Symfony \Bridge \PhpUnit \SetUpTearDownTrait ;
18
17
use Symfony \Component \DependencyInjection \ContainerBuilder ;
19
18
use Symfony \Component \DependencyInjection \Exception \ServiceNotFoundException ;
20
19
21
20
class FactoryValidatorPassTest extends TestCase
22
21
{
23
- use SetUpTearDownTrait;
24
-
25
22
/**
26
23
* @var FactoryValidatorPass
27
24
*/
@@ -32,22 +29,22 @@ class FactoryValidatorPassTest extends TestCase
32
29
*/
33
30
private $ factoryId ;
34
31
35
- protected function doSetUp ()
32
+ protected function setUp (): void
36
33
{
37
34
$ this ->compilerPass = new FactoryValidatorPass ();
38
35
$ this ->factoryId = 'dummy_factory_id ' ;
39
36
$ this ->compilerPass ::addFactoryServiceId ($ this ->factoryId );
40
37
}
41
38
42
- protected function doTearDown ()
39
+ protected function tearDown (): void
43
40
{
44
41
$ reflection = new \ReflectionObject ($ this ->compilerPass );
45
42
$ prop = $ reflection ->getProperty ('factoryServiceIds ' );
46
43
$ prop ->setAccessible (true );
47
44
$ prop ->setValue ([]);
48
45
}
49
46
50
- public function testProcessThrows ()
47
+ public function testProcessThrows (): void
51
48
{
52
49
$ this ->expectException (ServiceNotFoundException::class);
53
50
$ this ->expectExceptionMessage ("Factory with ID \"$ this ->factoryId \" could not be found " );
@@ -65,7 +62,7 @@ public function testProcessThrows()
65
62
$ this ->compilerPass ->process ($ container );
66
63
}
67
64
68
- public function testProcessDoesntThrowIfAliasExists ()
65
+ public function testProcessDoesntThrowIfAliasExists (): void
69
66
{
70
67
$ container = $ this ->createMock (ContainerBuilder::class);
71
68
$ container ->expects ($ this ->once ())
@@ -80,7 +77,7 @@ public function testProcessDoesntThrowIfAliasExists()
80
77
$ this ->compilerPass ->process ($ container );
81
78
}
82
79
83
- public function testProcessDoesntThrowIfDefinitionExists ()
80
+ public function testProcessDoesntThrowIfDefinitionExists (): void
84
81
{
85
82
$ container = $ this ->createMock (ContainerBuilder::class);
86
83
$ container ->expects ($ this ->once ())
0 commit comments