Skip to content

Commit 8f9bed3

Browse files
committed
Merge branch '2.8' into 3.1
* 2.8: fixed obsolete getMock() usage fixed obsolete getMock() usage [WebProfilerBundle] Display multiple HTTP headers in WDT do not remove the Twig ExceptionController service removed obsolete condition do not try to register incomplete definitions
2 parents 2f4b611 + 9b4ada6 commit 8f9bed3

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Tests/LoggingTranslatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LoggingTranslatorTest extends \PHPUnit_Framework_TestCase
1919
{
2020
public function testTransWithNoTranslationIsLogged()
2121
{
22-
$logger = $this->getMock('Psr\Log\LoggerInterface');
22+
$logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
2323
$logger->expects($this->exactly(2))
2424
->method('warning')
2525
->with('Translation not found.')
@@ -33,7 +33,7 @@ public function testTransWithNoTranslationIsLogged()
3333

3434
public function testTransChoiceFallbackIsLogged()
3535
{
36-
$logger = $this->getMock('Psr\Log\LoggerInterface');
36+
$logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
3737
$logger->expects($this->once())
3838
->method('debug')
3939
->with('Translation use fallback catalogue.')

Tests/MessageCatalogueTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ public function testReplace()
8282

8383
public function testAddCatalogue()
8484
{
85-
$r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface');
85+
$r = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
8686
$r->expects($this->any())->method('__toString')->will($this->returnValue('r'));
8787

88-
$r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface');
88+
$r1 = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
8989
$r1->expects($this->any())->method('__toString')->will($this->returnValue('r1'));
9090

9191
$catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar')));
@@ -104,13 +104,13 @@ public function testAddCatalogue()
104104

105105
public function testAddFallbackCatalogue()
106106
{
107-
$r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface');
107+
$r = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
108108
$r->expects($this->any())->method('__toString')->will($this->returnValue('r'));
109109

110-
$r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface');
110+
$r1 = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
111111
$r1->expects($this->any())->method('__toString')->will($this->returnValue('r1'));
112112

113-
$r2 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface');
113+
$r2 = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
114114
$r2->expects($this->any())->method('__toString')->will($this->returnValue('r2'));
115115

116116
$catalogue = new MessageCatalogue('fr_FR', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar')));
@@ -169,11 +169,11 @@ public function testAddCatalogueWhenLocaleIsNotTheSameAsTheCurrentOne()
169169
public function testGetAddResource()
170170
{
171171
$catalogue = new MessageCatalogue('en');
172-
$r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface');
172+
$r = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
173173
$r->expects($this->any())->method('__toString')->will($this->returnValue('r'));
174174
$catalogue->addResource($r);
175175
$catalogue->addResource($r);
176-
$r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface');
176+
$r1 = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
177177
$r1->expects($this->any())->method('__toString')->will($this->returnValue('r1'));
178178
$catalogue->addResource($r1);
179179

Tests/TranslatorCacheTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testCatalogueIsReloadedWhenResourcesAreNoLongerFresh()
9595
$catalogue->addResource(new StaleResource()); // better use a helper class than a mock, because it gets serialized in the cache and re-loaded
9696

9797
/** @var LoaderInterface|\PHPUnit_Framework_MockObject_MockObject $loader */
98-
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
98+
$loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock();
9999
$loader
100100
->expects($this->exactly(2))
101101
->method('load')
@@ -228,8 +228,8 @@ public function testPrimaryAndFallbackCataloguesContainTheSameMessagesRegardless
228228

229229
public function testRefreshCacheWhenResourcesAreNoLongerFresh()
230230
{
231-
$resource = $this->getMock('Symfony\Component\Config\Resource\SelfCheckingResourceInterface');
232-
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
231+
$resource = $this->getMockBuilder('Symfony\Component\Config\Resource\SelfCheckingResourceInterface')->getMock();
232+
$loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock();
233233
$resource->method('isFresh')->will($this->returnValue(false));
234234
$loader
235235
->expects($this->exactly(2))
@@ -272,7 +272,7 @@ public function runForDebugAndProduction()
272272
*/
273273
private function createFailingLoader()
274274
{
275-
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
275+
$loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock();
276276
$loader
277277
->expects($this->never())
278278
->method('load');

Tests/Writer/TranslationWriterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TranslationWriterTest extends \PHPUnit_Framework_TestCase
1919
{
2020
public function testWriteTranslations()
2121
{
22-
$dumper = $this->getMock('Symfony\Component\Translation\Dumper\DumperInterface');
22+
$dumper = $this->getMockBuilder('Symfony\Component\Translation\Dumper\DumperInterface')->getMock();
2323
$dumper
2424
->expects($this->once())
2525
->method('dump');

0 commit comments

Comments
 (0)