Skip to content

Commit f86b2a8

Browse files
committed
Merge branch '3.2'
* 3.2: fixed obsolete getMock() usage fixed obsolete getMock() usage 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 4660c6d + 980acef commit f86b2a8

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

Tests/File/FileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function testMoveToAnUnexistentDirectory()
166166

167167
protected function createMockGuesser($path, $mimeType)
168168
{
169-
$guesser = $this->getMock('Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface');
169+
$guesser = $this->getMockBuilder('Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface')->getMock();
170170
$guesser
171171
->expects($this->once())
172172
->method('guess')

Tests/ResponseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public function testSetVary()
442442

443443
public function testDefaultContentType()
444444
{
445-
$headerMock = $this->getMock('Symfony\Component\HttpFoundation\ResponseHeaderBag', array('set'));
445+
$headerMock = $this->getMockBuilder('Symfony\Component\HttpFoundation\ResponseHeaderBag')->setMethods(array('set'))->getMock();
446446
$headerMock->expects($this->at(0))
447447
->method('set')
448448
->with('Content-Type', 'text/html');
@@ -846,7 +846,7 @@ public function testSettersAreChainable()
846846
public function testNoDeprecationsAreTriggered()
847847
{
848848
new DefaultResponse();
849-
$this->getMock(Response::class);
849+
$this->getMockBuilder(Response::class)->getMock();
850850
}
851851

852852
/**

Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function setUp()
3535
}
3636

3737
parent::setUp();
38-
$this->memcache = $this->getMock('Memcache');
38+
$this->memcache = $this->getMockBuilder('Memcache')->getMock();
3939
$this->storage = new MemcacheSessionHandler(
4040
$this->memcache,
4141
array('prefix' => self::PREFIX, 'expiretime' => self::TTL)

Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function setUp()
4141
$this->markTestSkipped('Tests can only be run with memcached extension 2.1.0 or lower, or 3.0.0b1 or higher');
4242
}
4343

44-
$this->memcached = $this->getMock('Memcached');
44+
$this->memcached = $this->getMockBuilder('Memcached')->getMock();
4545
$this->storage = new MemcachedSessionHandler(
4646
$this->memcached,
4747
array('prefix' => self::PREFIX, 'expiretime' => self::TTL)

Tests/Session/Storage/Handler/PdoSessionHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function testReadConvertsStreamToString()
140140
}
141141

142142
$pdo = new MockPdo('pgsql');
143-
$pdo->prepareResult = $this->getMock('PDOStatement');
143+
$pdo->prepareResult = $this->getMockBuilder('PDOStatement')->getMock();
144144

145145
$content = 'foobar';
146146
$stream = $this->createStream($content);
@@ -161,8 +161,8 @@ public function testReadLockedConvertsStreamToString()
161161
}
162162

163163
$pdo = new MockPdo('pgsql');
164-
$selectStmt = $this->getMock('PDOStatement');
165-
$insertStmt = $this->getMock('PDOStatement');
164+
$selectStmt = $this->getMockBuilder('PDOStatement')->getMock();
165+
$insertStmt = $this->getMockBuilder('PDOStatement')->getMock();
166166

167167
$pdo->prepareResult = function ($statement) use ($selectStmt, $insertStmt) {
168168
return 0 === strpos($statement, 'INSERT') ? $insertStmt : $selectStmt;

Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class WriteCheckSessionHandlerTest extends \PHPUnit_Framework_TestCase
2020
{
2121
public function test()
2222
{
23-
$wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
23+
$wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock();
2424
$writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
2525

2626
$wrappedSessionHandlerMock
@@ -35,7 +35,7 @@ public function test()
3535

3636
public function testWrite()
3737
{
38-
$wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
38+
$wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock();
3939
$writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
4040

4141
$wrappedSessionHandlerMock
@@ -50,7 +50,7 @@ public function testWrite()
5050

5151
public function testSkippedWrite()
5252
{
53-
$wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
53+
$wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock();
5454
$writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
5555

5656
$wrappedSessionHandlerMock
@@ -71,7 +71,7 @@ public function testSkippedWrite()
7171

7272
public function testNonSkippedWrite()
7373
{
74-
$wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
74+
$wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock();
7575
$writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
7676

7777
$wrappedSessionHandlerMock

Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SessionHandlerProxyTest extends \PHPUnit_Framework_TestCase
3535

3636
protected function setUp()
3737
{
38-
$this->mock = $this->getMock('SessionHandlerInterface');
38+
$this->mock = $this->getMockBuilder('SessionHandlerInterface')->getMock();
3939
$this->proxy = new SessionHandlerProxy($this->mock);
4040
}
4141

0 commit comments

Comments
 (0)