mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
Merge pull request #102 from creative-commoners/pulls/5/phpunit11
DEP Use PHPUnit 11
This commit is contained in:
commit
d495840837
@ -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"
|
||||||
},
|
},
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -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],
|
||||||
|
Loading…
Reference in New Issue
Block a user