Skip to content

Commit d28d2b0

Browse files
committed
Fixed PHPUnit deprecation warnings
1 parent 4dfd21c commit d28d2b0

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Tests/Mailer/MailerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ private function getMailer()
6565
return new Mailer(
6666
new Swift_Mailer(
6767
new Swift_Transport_NullTransport(
68-
$this->getMock('Swift_Events_EventDispatcher')
68+
$this->getMockBuilder('Swift_Events_EventDispatcher')->getMock()
6969
)
7070
),
71-
$this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface'),
71+
$this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock(),
7272
$this->getTemplating(),
7373
array(
7474
'confirmation.template' => 'foo',
@@ -93,7 +93,7 @@ private function getTemplating()
9393

9494
private function getUser($emailAddress)
9595
{
96-
$user = $this->getMock('FOS\UserBundle\Model\UserInterface');
96+
$user = $this->getMockBuilder('FOS\UserBundle\Model\UserInterface')->getMock();
9797
$user->method('getEmail')
9898
->willReturn($emailAddress)
9999
;
@@ -103,9 +103,9 @@ private function getUser($emailAddress)
103103

104104
private function getEmailAddressValueObject($emailAddressAsString)
105105
{
106-
$emailAddress = $this->getMock('EmailAddress', array(
107-
'__toString',
108-
));
106+
$emailAddress = $this->getMockBuilder('EmailAddress')
107+
->setMethods(array('__toString'))
108+
->getMock();
109109

110110
$emailAddress->method('__toString')
111111
->willReturn($emailAddressAsString)

Tests/Mailer/TwigSwiftMailerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ private function getTwigSwiftMailer()
6767
return new TwigSwiftMailer(
6868
new Swift_Mailer(
6969
new Swift_Transport_NullTransport(
70-
$this->getMock('Swift_Events_EventDispatcher')
70+
$this->getMockBuilder('Swift_Events_EventDispatcher')->getMock()
7171
)
7272
),
73-
$this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface'),
73+
$this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock(),
7474
$this->getTwigEnvironment(),
7575
array(
7676
'template' => array(
@@ -119,7 +119,7 @@ private function getTwigTemplate()
119119

120120
private function getUser($emailAddress)
121121
{
122-
$user = $this->getMock('FOS\UserBundle\Model\UserInterface');
122+
$user = $this->getMockBuilder('FOS\UserBundle\Model\UserInterface')->getMock();
123123
$user->method('getEmail')
124124
->willReturn($emailAddress)
125125
;
@@ -129,9 +129,9 @@ private function getUser($emailAddress)
129129

130130
private function getEmailAddressValueObject($emailAddressAsString)
131131
{
132-
$emailAddress = $this->getMock('EmailAddress', array(
133-
'__toString',
134-
));
132+
$emailAddress = $this->getMockBuilder('EmailAddress')
133+
->setMethods(array('__toString'))
134+
->getMock();
135135

136136
$emailAddress->method('__toString')
137137
->willReturn($emailAddressAsString)

0 commit comments

Comments
 (0)