Skip to content

Commit 936c901

Browse files
committed
wip
1 parent 73e1ed6 commit 936c901

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

rules-tests/PHPUnit120/Rector/Class_/AllowMockObjectsWithoutExpectationsAttributeRector/Fixture/some_class.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ final class SomeClass extends TestCase
1515

1616
public function testOne()
1717
{
18+
$this->someMock->method('doSomething')->willReturn('value');
1819
}
1920

2021
public function testTwo()
2122
{
22-
2323
}
2424
}
2525

rules/PHPUnit120/Rector/Class_/AllowMockObjectsWithoutExpectationsAttributeRector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public function refactor(Node $node): ?Class_
7676

7777
foreach ($node->getMethods() as $classMethod) {
7878
if ($this->testsNodeAnalyzer->isTestClassMethod($classMethod)) {
79+
// is a mock property used in the method?
80+
// skip if so
81+
7982
++$testMethodCount;
8083
}
8184
}

0 commit comments

Comments
 (0)