Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit b3bda63

Browse files
committed
Mocking improvements
1 parent 65f6c2f commit b3bda63

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

test/Generic/Prototype/PrototypeClassFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testSetNameOnGenericIsCalledOnce()
5656
$mockProto = $this->getMockBuilder(PrototypeGenericClass::class)
5757
->setMethods(['setName'])
5858
->getMock();
59-
$mockProto->expects($this->once())->method('setName')->will($this->returnValue('notexist'));
59+
$mockProto->expects($this->once())->method('setName')->willReturn('notexist');
6060
$this->prototypeFactory->setGenericPrototype($mockProto);
6161
$this->prototypeFactory->getClonedPrototype('notexist');
6262
}

test/Reflection/ClassReflectionTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,8 @@ public function testGetAnnotationsWithNoNameInformations()
172172

173173
$reflectionClass->setFileScanner($fileScanner);
174174

175-
$fileScanner->expects($this->any())
176-
->method('getClassNameInformation')
177-
->will($this->returnValue(false));
175+
$fileScanner->method('getClassNameInformation')
176+
->willReturn(false);
178177

179178
self::assertFalse($reflectionClass->getAnnotations($annotationManager));
180179
}

test/Reflection/MethodReflectionTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,8 @@ public function testGetAnnotationsWithNoNameInformations()
312312

313313
$reflectionMethod->setFileScanner($fileScanner);
314314

315-
$fileScanner->expects($this->any())
316-
->method('getClassNameInformation')
317-
->will($this->returnValue(false));
315+
$fileScanner->method('getClassNameInformation')
316+
->willReturn(false);
318317

319318
self::assertFalse($reflectionMethod->getAnnotations($annotationManager));
320319
}

test/Reflection/PropertyReflectionTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ public function testGetAnnotationsWithNoNameInformations()
7373

7474
$reflectionProperty->setFileScanner($fileScanner);
7575

76-
$fileScanner->expects($this->any())
77-
->method('getClassNameInformation')
78-
->will($this->returnValue(false));
76+
$fileScanner->method('getClassNameInformation')
77+
->willReturn(false);
7978

8079
self::assertFalse($reflectionProperty->getAnnotations($annotationManager));
8180
}

0 commit comments

Comments
 (0)