mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
Merge pull request #111 from creative-commoners/pulls/4/phpunit11
DEP Use PHPUnit 11
This commit is contained in:
commit
6c12c76e6c
@ -26,7 +26,7 @@
|
||||
"guzzlehttp/guzzle": "^7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"phpunit/phpunit": "^11.3",
|
||||
"squizlabs/php_codesniffer": "^3",
|
||||
"silverstripe/standards": "^1",
|
||||
"phpstan/extension-installer": "^1.3"
|
||||
|
@ -35,7 +35,7 @@ class EnvironmentCheckerTest extends SapphireTest
|
||||
|
||||
$logger = $this->getMockBuilder(Logger::class)
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['log'])
|
||||
->onlyMethods(['log'])
|
||||
->getMock();
|
||||
|
||||
$logger->expects($this->never())->method('log');
|
||||
@ -55,15 +55,17 @@ class EnvironmentCheckerTest extends SapphireTest
|
||||
|
||||
$logger = $this->getMockBuilder(Logger::class)
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['log'])
|
||||
->onlyMethods(['log'])
|
||||
->getMock();
|
||||
|
||||
$logger->expects($this->once())
|
||||
$matcher = $this->once();
|
||||
$logger->expects($matcher)
|
||||
->method('log')
|
||||
->withConsecutive(
|
||||
[$this->equalTo(LogLevel::WARNING)],
|
||||
[$this->anything()]
|
||||
);
|
||||
->willReturnCallback(function (mixed $level) use ($matcher) {
|
||||
match ($matcher->numberOfInvocations()) {
|
||||
1 => $this->assertSame(LogLevel::WARNING, $level),
|
||||
};
|
||||
});
|
||||
|
||||
Injector::inst()->registerService($logger, LoggerInterface::class);
|
||||
|
||||
@ -80,15 +82,17 @@ class EnvironmentCheckerTest extends SapphireTest
|
||||
|
||||
$logger = $this->getMockBuilder(Logger::class)
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['log'])
|
||||
->onlyMethods(['log'])
|
||||
->getMock();
|
||||
|
||||
$logger->expects($this->once())
|
||||
$matcher = $this->once();
|
||||
$logger->expects($matcher)
|
||||
->method('log')
|
||||
->withConsecutive(
|
||||
[$this->equalTo(LogLevel::ALERT), $this->anything()],
|
||||
[$this->equalTo(LogLevel::WARNING), $this->anything()]
|
||||
);
|
||||
->willReturnCallback(function (mixed $level) use ($matcher) {
|
||||
match ($matcher->numberOfInvocations()) {
|
||||
1 => $this->assertSame(LogLevel::ALERT, $level),
|
||||
};
|
||||
});
|
||||
|
||||
Injector::inst()->registerService($logger, LoggerInterface::class);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user