-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Use static methods inside data providers #48709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ public function testIsFresh(callable $mockContainer, $expected) | |
$this->assertSame($expected, $this->resourceChecker->isFresh($this->resource, time())); | ||
} | ||
|
||
public function isFreshProvider() | ||
public static function isFreshProvider() | ||
{ | ||
yield 'not fresh on missing parameter' => [function (MockObject $container) { | ||
$container->method('hasParameter')->with('locales')->willReturn(false); | ||
|
@@ -62,11 +62,11 @@ public function isFreshProvider() | |
}, false]; | ||
|
||
yield 'fresh on every identical parameters' => [function (MockObject $container) { | ||
$container->expects($this->exactly(2))->method('hasParameter')->willReturn(true); | ||
$container->expects($this->exactly(2))->method('getParameter') | ||
$container->expects(self::exactly(2))->method('hasParameter')->willReturn(true); | ||
$container->expects(self::exactly(2))->method('getParameter') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these methods are defined as static anyway, shall we fix them through the whole codebase starting from 5.4 @nicolas-grekas ? Automated via rector ofc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to. That wouldn't provide any real added value but would consume a lot of time for sure. |
||
->withConsecutive( | ||
[$this->equalTo('locales')], | ||
[$this->equalTo('default_locale')] | ||
[self::equalTo('locales')], | ||
[self::equalTo('default_locale')] | ||
) | ||
->willReturnMap([ | ||
['locales', ['fr', 'en']], | ||
|
Uh oh!
There was an error while loading. Please reload this page.