Skip to content

Commit

Permalink
Merge pull request #102 from creative-commoners/pulls/5/phpunit11
Browse files Browse the repository at this point in the history
DEP Use PHPUnit 11
  • Loading branch information
GuySartorelli authored Sep 18, 2024
2 parents e411cbc + 918c501 commit d495840
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/FileTextCacheDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testTruncatesByMaxLength()
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);

Expand Down
7 changes: 4 additions & 3 deletions tests/TikaServerTextExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\Dev\SapphireTest;
use SilverStripe\TextExtraction\Extractor\TikaServerTextExtractor;
use SilverStripe\TextExtraction\Rest\TikaRestClient;
use PHPUnit\Framework\Attributes\DataProvider;

/**
* @group tika-tests
Expand Down Expand Up @@ -39,13 +40,13 @@ public function testServerExtraction()
/**
* @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);
Expand All @@ -62,7 +63,7 @@ public function testIsAvailable($version, $expected)
/**
* @return array[]
*/
public function isAvailableProvider()
public static function isAvailableProvider()
{
return [
['1.5.2', false],
Expand Down

0 comments on commit d495840

Please sign in to comment.