Skip to content

Commit 7ae26ed

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 6ba0414 + 0f9a728 commit 7ae26ed

File tree

237 files changed

+1092
-1096
lines changed

Some content is hidden

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

237 files changed

+1092
-1096
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
@@ -17,7 +17,7 @@ class DoctrineParserCacheTest extends \PHPUnit_Framework_TestCase
1717
{
1818
public function testFetch()
1919
{
20-
$doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache');
20+
$doctrineCacheMock = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
2121
$parserCache = new DoctrineParserCache($doctrineCacheMock);
2222

2323
$doctrineCacheMock->expects($this->once())
@@ -31,7 +31,7 @@ public function testFetch()
3131

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

3737
$doctrineCacheMock
@@ -44,7 +44,7 @@ public function testFetchUnexisting()
4444

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

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

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

Lines changed: 4 additions & 4 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');

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/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))

src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function setUp()
6767

6868
protected function createRegistryMock(ObjectManager $em = null)
6969
{
70-
$registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
70+
$registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
7171
$registry->expects($this->any())
7272
->method('getManager')
7373
->with($this->equalTo(self::EM_NAME))
@@ -96,7 +96,7 @@ protected function createEntityManagerMock($repositoryMock)
9696
->will($this->returnValue($repositoryMock))
9797
;
9898

99-
$classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
99+
$classMetadata = $this->getMockBuilder('Doctrine\Common\Persistence\Mapping\ClassMetadata')->getMock();
100100
$classMetadata
101101
->expects($this->any())
102102
->method('hasField')

0 commit comments

Comments
 (0)