diff --git a/composer.json b/composer.json index f5aa654..eba5f6e 100644 --- a/composer.json +++ b/composer.json @@ -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" }, diff --git a/tests/FileTextCacheDatabaseTest.php b/tests/FileTextCacheDatabaseTest.php index e7fb242..9b6d1a0 100644 --- a/tests/FileTextCacheDatabaseTest.php +++ b/tests/FileTextCacheDatabaseTest.php @@ -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); diff --git a/tests/TikaServerTextExtractorTest.php b/tests/TikaServerTextExtractorTest.php index b47dfb0..a443681 100644 --- a/tests/TikaServerTextExtractorTest.php +++ b/tests/TikaServerTextExtractorTest.php @@ -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],