Merge pull request #102 from creative-commoners/pulls/5/phpunit11

DEP Use PHPUnit 11
This commit is contained in:
Guy Sartorelli 2024-09-18 15:33:04 +12:00 committed by GitHub
commit d495840837
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View File

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

View File

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

View File

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