11
11
use PHPUnit \Framework \TestCase ;
12
12
use Zend \InputFilter \InputFilterAbstractServiceFactory ;
13
13
use Zend \InputFilter \InputFilterPluginManager ;
14
- use Zend \InputFilter \InputFilterPluginManagerFactory ;
15
14
use Zend \InputFilter \Module ;
16
15
17
16
class ModuleTest extends TestCase
18
17
{
19
18
/** @var Module */
20
19
private $ module ;
21
20
22
- public function setUp ()
21
+ protected function setUp ()
23
22
{
24
23
$ this ->module = new Module ();
25
24
}
@@ -70,9 +69,7 @@ public function testInputFilterConfigShouldContainAbstractServiceFactory()
70
69
public function testInitMethodShouldRegisterPluginManagerSpecificationWithServiceListener ()
71
70
{
72
71
// Service listener
73
- $ serviceListener = $ this ->prophesize (
74
- TestAsset \ServiceListenerInterface::class
75
- );
72
+ $ serviceListener = $ this ->prophesize (TestAsset \ServiceListenerInterface::class);
76
73
$ serviceListener ->addServiceManager (
77
74
'InputFilterManager ' ,
78
75
'input_filters ' ,
@@ -82,19 +79,15 @@ public function testInitMethodShouldRegisterPluginManagerSpecificationWithServic
82
79
83
80
// Container
84
81
$ container = $ this ->prophesize (ContainerInterface::class);
85
- $ container ->get ('ServiceListener ' )->willReturn (
86
- $ serviceListener ->reveal ()
87
- );
82
+ $ container ->get ('ServiceListener ' )->will ([$ serviceListener , 'reveal ' ]);
88
83
89
84
// Event
90
85
$ event = $ this ->prophesize (TestAsset \ModuleEventInterface::class);
91
- $ event ->getParam ('ServiceManager ' )->willReturn ( $ container-> reveal () );
86
+ $ event ->getParam ('ServiceManager ' )->will ([ $ container, ' reveal ' ] );
92
87
93
88
// Module manager
94
- $ moduleManager = $ this ->prophesize (
95
- TestAsset \ModuleManagerInterface::class
96
- );
97
- $ moduleManager ->getEvent ()->willReturn ($ event ->reveal ());
89
+ $ moduleManager = $ this ->prophesize (TestAsset \ModuleManagerInterface::class);
90
+ $ moduleManager ->getEvent ()->will ([$ event , 'reveal ' ]);
98
91
99
92
$ this ->assertNull ($ this ->module ->init ($ moduleManager ->reveal ()));
100
93
}
0 commit comments