Skip to content

Commit 3f96468

Browse files
committed
Merge branch '3.1' into 3.2
* 3.1: 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 cbf766b + a305824 commit 3f96468

File tree

261 files changed

+1252
-1259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+1252
-1259
lines changed

src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private function createCollector($queries)
139139
->method('getDatabasePlatform')
140140
->will($this->returnValue(new MySqlPlatform()));
141141

142-
$registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
142+
$registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
143143
$registry
144144
->expects($this->any())
145145
->method('getConnectionNames')
@@ -152,7 +152,7 @@ private function createCollector($queries)
152152
->method('getConnection')
153153
->will($this->returnValue($connection));
154154

155-
$logger = $this->getMock('Doctrine\DBAL\Logging\DebugStack');
155+
$logger = $this->getMockBuilder('Doctrine\DBAL\Logging\DebugStack')->getMock();
156156
$logger->queries = $queries;
157157

158158
$collector = new DoctrineDataCollector($registry);

src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase
1818
{
1919
public function testShouldSetContainerOnContainerAwareFixture()
2020
{
21-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
21+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
2222
$loader = new ContainerAwareLoader($container);
2323
$fixture = new ContainerAwareFixture();
2424

src/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DoctrineParserCacheTest extends \PHPUnit_Framework_TestCase
2020
{
2121
public function testFetch()
2222
{
23-
$doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache');
23+
$doctrineCacheMock = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
2424
$parserCache = new DoctrineParserCache($doctrineCacheMock);
2525

2626
$doctrineCacheMock->expects($this->once())
@@ -34,7 +34,7 @@ public function testFetch()
3434

3535
public function testFetchUnexisting()
3636
{
37-
$doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache');
37+
$doctrineCacheMock = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
3838
$parserCache = new DoctrineParserCache($doctrineCacheMock);
3939

4040
$doctrineCacheMock
@@ -47,7 +47,7 @@ public function testFetchUnexisting()
4747

4848
public function testSave()
4949
{
50-
$doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache');
50+
$doctrineCacheMock = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
5151
$parserCache = new DoctrineParserCache($doctrineCacheMock);
5252

5353
$expression = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ParsedExpression')

src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ class DoctrineChoiceLoaderTest extends \PHPUnit_Framework_TestCase
6666

6767
protected function setUp()
6868
{
69-
$this->factory = $this->getMock('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface');
70-
$this->om = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
71-
$this->repository = $this->getMock('Doctrine\Common\Persistence\ObjectRepository');
69+
$this->factory = $this->getMockBuilder('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface')->getMock();
70+
$this->om = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')->getMock();
71+
$this->repository = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectRepository')->getMock();
7272
$this->class = 'stdClass';
7373
$this->idReader = $this->getMockBuilder('Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader')
7474
->disableOriginalConstructor()
7575
->getMock();
76-
$this->objectLoader = $this->getMock('Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface');
76+
$this->objectLoader = $this->getMockBuilder('Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface')->getMock();
7777
$this->obj1 = (object) array('name' => 'A');
7878
$this->obj2 = (object) array('name' => 'B');
7979
$this->obj3 = (object) array('name' => 'C');
@@ -117,7 +117,7 @@ public function testLoadChoiceList()
117117
*/
118118
public function testLegacyLoadChoiceList()
119119
{
120-
$factory = $this->getMock('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface');
120+
$factory = $this->getMockBuilder('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface')->getMock();
121121
$loader = new DoctrineChoiceLoader(
122122
$factory,
123123
$this->om,

src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public function requiredProvider()
8686

8787
private function getGuesser(ClassMetadata $classMetadata)
8888
{
89-
$em = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
89+
$em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')->getMock();
9090
$em->expects($this->once())->method('getClassMetaData')->with('TestEntity')->will($this->returnValue($classMetadata));
9191

92-
$registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
92+
$registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
9393
$registry->expects($this->once())->method('getManagers')->will($this->returnValue(array($em)));
9494

9595
return new DoctrineOrmTypeGuesser($registry);

src/Symfony/Bridge/Doctrine/Tests/Form/EventListener/MergeDoctrineCollectionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function setUp()
3131
{
3232
$this->collection = new ArrayCollection(array('test'));
3333
$this->dispatcher = new EventDispatcher();
34-
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
34+
$this->factory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock();
3535
$this->form = $this->getBuilder()
3636
->getForm();
3737
}

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
3232

3333
protected function getExtensions()
3434
{
35-
$manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
35+
$manager = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
3636

3737
$manager->expects($this->any())
3838
->method('getManager')

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ public function testLoaderCachingWithParameters()
12741274

12751275
protected function createRegistryMock($name, $em)
12761276
{
1277-
$registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
1277+
$registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
12781278
$registry->expects($this->any())
12791279
->method('getManager')
12801280
->with($this->equalTo($name))

src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
2020
*/
2121
public function testLog($sql, $params, $logParams)
2222
{
23-
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
23+
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
2424

2525
$dbalLogger = $this
2626
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -52,7 +52,7 @@ public function getLogFixtures()
5252

5353
public function testLogNonUtf8()
5454
{
55-
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
55+
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
5656

5757
$dbalLogger = $this
5858
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -75,7 +75,7 @@ public function testLogNonUtf8()
7575

7676
public function testLogNonUtf8Array()
7777
{
78-
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
78+
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
7979

8080
$dbalLogger = $this
8181
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -106,7 +106,7 @@ public function testLogNonUtf8Array()
106106

107107
public function testLogLongString()
108108
{
109-
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
109+
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
110110

111111
$dbalLogger = $this
112112
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -134,7 +134,7 @@ public function testLogLongString()
134134

135135
public function testLogUTF8LongString()
136136
{
137-
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
137+
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
138138

139139
$dbalLogger = $this
140140
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')

src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ public function testSupportProxy()
150150

151151
public function testLoadUserByUserNameShouldLoadUserWhenProperInterfaceProvided()
152152
{
153-
$repository = $this->getMock('\Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface');
153+
$repository = $this->getMockBuilder('\Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface')->getMock();
154154
$repository->expects($this->once())
155155
->method('loadUserByUsername')
156156
->with('name')
157157
->willReturn(
158-
$this->getMock('\Symfony\Component\Security\Core\User\UserInterface')
158+
$this->getMockBuilder('\Symfony\Component\Security\Core\User\UserInterface')->getMock()
159159
);
160160

161161
$provider = new EntityUserProvider(
@@ -171,7 +171,7 @@ public function testLoadUserByUserNameShouldLoadUserWhenProperInterfaceProvided(
171171
*/
172172
public function testLoadUserByUserNameShouldDeclineInvalidInterface()
173173
{
174-
$repository = $this->getMock('\Symfony\Component\Security\Core\User\AdvancedUserInterface');
174+
$repository = $this->getMockBuilder('\Symfony\Component\Security\Core\User\AdvancedUserInterface')->getMock();
175175

176176
$provider = new EntityUserProvider(
177177
$this->getManager($this->getObjectManager($repository)),
@@ -183,7 +183,7 @@ public function testLoadUserByUserNameShouldDeclineInvalidInterface()
183183

184184
private function getManager($em, $name = null)
185185
{
186-
$manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
186+
$manager = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
187187
$manager->expects($this->any())
188188
->method('getManager')
189189
->with($this->equalTo($name))

0 commit comments

Comments
 (0)