Skip to content

Commit 4b3829c

Browse files
authored
Merge pull request doctrine#2022 from greg0ire/will-return
Migrate to willReturn()
2 parents b373ccf + 17c5026 commit 4b3829c

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

tests/DataCollector/DoctrineDataCollectorTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ public function testCollectEntities(): void
3838

3939
$manager->expects($this->any())
4040
->method('getMetadataFactory')
41-
->will($this->returnValue($factory));
41+
->willReturn($factory);
4242
$manager->expects($this->any())
4343
->method('getConfiguration')
44-
->will($this->returnValue($config));
44+
->willReturn($config);
4545
$manager->expects($this->any())
4646
->method('getUnitOfWork')
47-
->will($this->returnValue($unitOfWork));
47+
->willReturn($unitOfWork);
4848
$unitOfWork->expects($this->any())
4949
->method('getIdentityMap')
50-
->will($this->returnValue([
50+
->willReturn([
5151
self::FIRST_ENTITY => [new stdClass()],
5252
self::SECOND_ENTITY => [new stdClass(), new stdClass()],
53-
]));
53+
]);
5454

5555
$config->expects($this->once())
5656
->method('isSecondLevelCacheEnabled')
@@ -63,7 +63,7 @@ public function testCollectEntities(): void
6363
];
6464
$factory->expects($this->once())
6565
->method('getLoadedMetadata')
66-
->will($this->returnValue($metadatas));
66+
->willReturn($metadatas);
6767

6868
$collector->collect(new Request(), new Response());
6969

@@ -87,13 +87,13 @@ public function testDoesNotCollectEntities(): void
8787
$manager->expects($this->never())
8888
->method('getMetadataFactory');
8989
$manager->method('getConfiguration')
90-
->will($this->returnValue($config));
90+
->willReturn($config);
9191
$manager->expects($this->any())
9292
->method('getUnitOfWork')
93-
->will($this->returnValue($unitOfWork));
93+
->willReturn($unitOfWork);
9494
$unitOfWork->expects($this->any())
9595
->method('getIdentityMap')
96-
->will($this->returnValue([]));
96+
->willReturn([]);
9797

9898
$collector->collect(new Request(), new Response());
9999

@@ -167,15 +167,15 @@ private function createCollector(
167167
$registry
168168
->expects($this->any())
169169
->method('getConnectionNames')
170-
->will($this->returnValue(['default' => 'doctrine.dbal.default_connection']));
170+
->willReturn(['default' => 'doctrine.dbal.default_connection']);
171171
$registry
172172
->expects($this->any())
173173
->method('getManagerNames')
174-
->will($this->returnValue(['default' => 'doctrine.orm.default_entity_manager']));
174+
->willReturn(['default' => 'doctrine.orm.default_entity_manager']);
175175
$registry
176176
->expects($this->any())
177177
->method('getManagers')
178-
->will($this->returnValue($managers));
178+
->willReturn($managers);
179179

180180
return new DoctrineDataCollector($registry, $shouldValidateSchema, $debugDataHolder);
181181
}

0 commit comments

Comments
 (0)