Skip to content

Commit 2ad0441

Browse files
Use consistent variable name
1 parent 7195d43 commit 2ad0441

File tree

8 files changed

+138
-138
lines changed

8 files changed

+138
-138
lines changed

tests/unit/Framework/MockObject/Creation/CreateConfiguredMockTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ final class CreateConfiguredMockTest extends TestCase
2424
{
2525
public function testCreatesMockObjectForInterfaceOrExtendableClassWithReturnValueConfigurationForMultipleMethods(): void
2626
{
27-
$stub = $this->createConfiguredMock(
27+
$double = $this->createConfiguredMock(
2828
InterfaceWithReturnTypeDeclaration::class,
2929
[
3030
'doSomething' => true,
3131
'doSomethingElse' => 1,
3232
],
3333
);
3434

35-
$this->assertTrue($stub->doSomething());
36-
$this->assertSame(1, $stub->doSomethingElse(0));
35+
$this->assertTrue($double->doSomething());
36+
$this->assertSame(1, $double->doSomethingElse(0));
3737
}
3838
}

tests/unit/Framework/MockObject/Creation/CreateConfiguredStubTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ final class CreateConfiguredStubTest extends TestCase
2424
{
2525
public function testCreatesTestStubForInterfaceOrExtendableClassWithReturnValueConfigurationForMultipleMethods(): void
2626
{
27-
$stub = $this->createConfiguredStub(
27+
$double = $this->createConfiguredStub(
2828
InterfaceWithReturnTypeDeclaration::class,
2929
[
3030
'doSomething' => true,
3131
'doSomethingElse' => 1,
3232
],
3333
);
3434

35-
$this->assertTrue($stub->doSomething());
36-
$this->assertSame(1, $stub->doSomethingElse(0));
35+
$this->assertTrue($double->doSomething());
36+
$this->assertSame(1, $double->doSomethingElse(0));
3737
}
3838
}

tests/unit/Framework/MockObject/Creation/CreatePartialMockTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ final class CreatePartialMockTest extends TestCase
2626
{
2727
public function testCreatesPartialMockObjectForExtendableClass(): void
2828
{
29-
$mock = $this->createPartialMock(ExtendableClass::class, ['doSomethingElse']);
29+
$double = $this->createPartialMock(ExtendableClass::class, ['doSomethingElse']);
3030

31-
$mock->expects($this->once())->method('doSomethingElse')->willReturn(true);
31+
$double->expects($this->once())->method('doSomethingElse')->willReturn(true);
3232

33-
$this->assertTrue($mock->doSomething());
33+
$this->assertTrue($double->doSomething());
3434
}
3535

3636
public function testCannotCreatePartialMockObjectForExtendableClassWithDuplicateMethods(): void
@@ -43,10 +43,10 @@ public function testCannotCreatePartialMockObjectForExtendableClassWithDuplicate
4343

4444
public function testMethodOfPartialMockThatIsNotConfigurableCannotBeConfigured(): void
4545
{
46-
$mock = $this->createPartialMock(ExtendableClass::class, ['doSomethingElse']);
46+
$double = $this->createPartialMock(ExtendableClass::class, ['doSomethingElse']);
4747

4848
try {
49-
$mock->expects($this->once())->method('doSomething')->willReturn(true);
49+
$double->expects($this->once())->method('doSomething')->willReturn(true);
5050
} catch (MethodCannotBeConfiguredException $e) {
5151
$this->assertSame('Trying to configure method "doSomething" which cannot be configured because it does not exist, has not been specified, is final, or is static', $e->getMessage());
5252

tests/unit/Framework/MockObject/Creation/CreateTestProxyTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ final class CreateTestProxyTest extends TestCase
2525
{
2626
public function testCreatesTestProxyForExtendableClass(): void
2727
{
28-
$proxy = $this->createTestProxy(TestProxyFixture::class);
28+
$double = $this->createTestProxy(TestProxyFixture::class);
2929

30-
$proxy->expects($this->once())
30+
$double->expects($this->once())
3131
->method('returnString');
3232

33-
assert($proxy instanceof MockObject);
34-
assert($proxy instanceof TestProxyFixture);
33+
assert($double instanceof MockObject);
34+
assert($double instanceof TestProxyFixture);
3535

36-
$this->assertSame('result', $proxy->returnString());
36+
$this->assertSame('result', $double->returnString());
3737
}
3838
}

tests/unit/Framework/MockObject/Creation/GetMockForAbstractClassTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ final class GetMockForAbstractClassTest extends TestCase
2828
{
2929
public function testCreatesMockObjectForAbstractClassAndAllowsConfigurationOfAbstractMethods(): void
3030
{
31-
$mock = $this->getMockForAbstractClass(AbstractClass::class);
31+
$double = $this->getMockForAbstractClass(AbstractClass::class);
3232

33-
$mock->expects($this->once())->method('doSomethingElse')->willReturn(true);
33+
$double->expects($this->once())->method('doSomethingElse')->willReturn(true);
3434

35-
$this->assertTrue($mock->doSomething());
35+
$this->assertTrue($double->doSomething());
3636
}
3737

3838
public function testCannotCreateMockObjectForAbstractClassThatDoesNotExist(): void
@@ -45,10 +45,10 @@ public function testCannotCreateMockObjectForAbstractClassThatDoesNotExist(): vo
4545

4646
public function testCreatesMockObjectForAbstractClassAndDoesNotAllowConfigurationOfConcreteMethods(): void
4747
{
48-
$mock = $this->getMockForAbstractClass(AbstractClass::class);
48+
$double = $this->getMockForAbstractClass(AbstractClass::class);
4949

5050
try {
51-
$mock->expects($this->once())->method('doSomething');
51+
$double->expects($this->once())->method('doSomething');
5252
} catch (MethodCannotBeConfiguredException $e) {
5353
$this->assertSame('Trying to configure method "doSomething" which cannot be configured because it does not exist, has not been specified, is final, or is static', $e->getMessage());
5454

tests/unit/Framework/MockObject/Creation/GetMockForTraitTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ final class GetMockForTraitTest extends TestCase
2525
{
2626
public function testCreatesMockObjectForTraitAndAllowsConfigurationOfAbstractMethods(): void
2727
{
28-
$mock = $this->getMockForTrait(TraitWithConcreteAndAbstractMethod::class);
28+
$double = $this->getMockForTrait(TraitWithConcreteAndAbstractMethod::class);
2929

30-
$mock->method('abstractMethod')->willReturn(true);
30+
$double->method('abstractMethod')->willReturn(true);
3131

32-
$this->assertTrue($mock->concreteMethod());
32+
$this->assertTrue($double->concreteMethod());
3333
}
3434

3535
public function testCannotCreateMockObjectForTraitThatDoesNotExist(): void

tests/unit/Framework/MockObject/Creation/GetMockFromWsdlTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ final class GetMockFromWsdlTest extends TestCase
2626
#[TestDox('Creates mock object from WSDL file')]
2727
public function test_CreatesMockObjectFromWsdlFileWithNonNamespacedClassName(): void
2828
{
29-
$mock = $this->getMockFromWsdl(TEST_FILES_PATH . 'GoogleSearch.wsdl');
29+
$double = $this->getMockFromWsdl(TEST_FILES_PATH . 'GoogleSearch.wsdl');
3030

3131
$this->assertStringStartsWith(
3232
'MockObject_GoogleSearch_',
33-
$mock::class,
33+
$double::class,
3434
);
3535
}
3636
}

0 commit comments

Comments
 (0)