DEP Use PHPUnit 11

This commit is contained in:
Steve Boyd 2024-09-10 11:28:36 +12:00
parent e411cbcd32
commit 918c501b96
3 changed files with 6 additions and 5 deletions

View File

@ -28,7 +28,7 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "^3",
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^11.3",
"silverstripe/standards": "^1",
"phpstan/extension-installer": "^1.3"
},

View File

@ -14,7 +14,7 @@ class FileTextCacheDatabaseTest extends SapphireTest
Config::modify()->set(Database::class, 'max_content_length', 5);
$cache = new Database();
$file = $this->getMockBuilder(File::class)->setMethods(['write'])->getMock();
$file = $this->getMockBuilder(File::class)->onlyMethods(['write'])->getMock();
$content = '0123456789';
$cache->save($file, $content);

View File

@ -7,6 +7,7 @@ use SilverStripe\Assets\File;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\TextExtraction\Extractor\TikaServerTextExtractor;
use SilverStripe\TextExtraction\Rest\TikaRestClient;
use PHPUnit\Framework\Attributes\DataProvider;
/**
* @group tika-tests
@ -39,13 +40,13 @@ class TikaServerTextExtractorTest extends SapphireTest
/**
* @param string $version
* @param bool $expected
* @dataProvider isAvailableProvider
*/
#[DataProvider('isAvailableProvider')]
public function testIsAvailable($version, $expected)
{
/** @var MockObject|TikaServerTextExtractor $extractor */
$extractor = $this->getMockBuilder(TikaServerTextExtractor::class)
->setMethods(['getClient', 'getServerEndpoint'])
->onlyMethods(['getClient', 'getServerEndpoint'])
->getMock();
$client = $this->createMock(TikaRestClient::class);
@ -62,7 +63,7 @@ class TikaServerTextExtractorTest extends SapphireTest
/**
* @return array[]
*/
public function isAvailableProvider()
public static function isAvailableProvider()
{
return [
['1.5.2', false],