@@ -18,8 +18,8 @@ class LinkifyTwigExtensionTest extends AbstractTestCase
18
18
{
19
19
public function testConstructor ()
20
20
{
21
- $ linkify = $ this ->getMock ('Misd\Linkify\Linkify ' );
22
- $ helper = $ this ->getMock ('Misd\LinkifyBundle\Helper\LinkifyHelper ' , array (), array ($ linkify ));
21
+ $ linkify = $ this ->getMockBuilder ('Misd\Linkify\Linkify ' )-> getMock ( );
22
+ $ helper = $ this ->getMockBuilder ('Misd\LinkifyBundle\Helper\LinkifyHelper ' )-> setConstructorArgs ( array ($ linkify ))-> getMock ( );
23
23
24
24
$ extension = new LinkifyTwigExtension ($ helper );
25
25
@@ -29,8 +29,8 @@ public function testConstructor()
29
29
30
30
public function testFilters ()
31
31
{
32
- $ linkify = $ this ->getMock ('Misd\Linkify\Linkify ' );
33
- $ helper = $ this ->getMock ('Misd\LinkifyBundle\Helper\LinkifyHelper ' , array (), array ($ linkify ));
32
+ $ linkify = $ this ->getMockBuilder ('Misd\Linkify\Linkify ' )-> getMock ( );
33
+ $ helper = $ this ->getMockBuilder ('Misd\LinkifyBundle\Helper\LinkifyHelper ' )-> setConstructorArgs ( array ($ linkify ))-> getMock ( );
34
34
35
35
$ extension = new LinkifyTwigExtension ($ helper );
36
36
@@ -45,8 +45,11 @@ public function testLinkify()
45
45
$ text = 'test ' ;
46
46
$ options = array ('key ' => 'value ' );
47
47
48
- $ linkify = $ this ->getMock ('Misd\Linkify\Linkify ' );
49
- $ helper = $ this ->getMock ('Misd\LinkifyBundle\Helper\LinkifyHelper ' , array ('process ' ), array ($ linkify ));
48
+ $ linkify = $ this ->getMockBuilder ('Misd\Linkify\Linkify ' )->getMock ();
49
+ $ helper = $ this ->getMockBuilder ('Misd\LinkifyBundle\Helper\LinkifyHelper ' )
50
+ ->setMethods (array ('process ' ))
51
+ ->setConstructorArgs (array ($ linkify ))
52
+ ->getMock ();
50
53
$ helper ->expects ($ this ->once ())->method ('process ' )->with ($ text , $ options );
51
54
52
55
$ extension = new LinkifyTwigExtension ($ helper );
@@ -56,8 +59,8 @@ public function testLinkify()
56
59
57
60
public function testName ()
58
61
{
59
- $ linkify = $ this ->getMock ('Misd\Linkify\Linkify ' );
60
- $ helper = $ this ->getMock ('Misd\LinkifyBundle\Helper\LinkifyHelper ' , array (), array ($ linkify ));
62
+ $ linkify = $ this ->getMockBuilder ('Misd\Linkify\Linkify ' )-> getMock ( );
63
+ $ helper = $ this ->getMockBuilder ('Misd\LinkifyBundle\Helper\LinkifyHelper ' )-> setConstructorArgs ( array ($ linkify ))-> getMock ( );
61
64
62
65
$ extension = new LinkifyTwigExtension ($ helper );
63
66
0 commit comments