Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated prophecy calls and MimeTypeGuesserInterface. #50

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ["8.1"]
drupal-version: ["9.5.x", "10.0.x", "10.1.x-dev"]
drupal-version: ["9.5.x", "10.0.x", "10.1.x"]
allowed_failure: [false]
mysql: ["8.0"]

Expand Down
8 changes: 4 additions & 4 deletions src/File/FileInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Drupal\file\Entity\File;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
use Symfony\Component\Mime\MimeTypesInterface;

/**
* Gets file information for the image to be viewed.
Expand All @@ -16,17 +16,17 @@ class FileInformation implements FileInformationInterface {
/**
* File MimeType Guesser to use extension to determine file type.
*
* @var \Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface
* @var \Symfony\Component\Mime\MimeTypesInterface
*/
private $mimetypeGuesser;

/**
* FileInformation constructor.
*
* @param \Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface $mimeTypeGuesser
* @param \Symfony\Component\Mime\MimeTypesInterface $mimeTypeGuesser
* File mimetype guesser interface.
*/
public function __construct(MimeTypeGuesserInterface $mimeTypeGuesser) {
public function __construct(MimeTypesInterface $mimeTypeGuesser) {
$this->mimetypeGuesser = $mimeTypeGuesser;
}

Expand Down
12 changes: 8 additions & 4 deletions tests/src/Kernel/ConfigTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
use Drupal\file\Entity\File;
use Drupal\KernelTests\KernelTestBase;
use Drupal\openseadragon\File\FileInformation;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Mime\MimeTypesInterface;

/**
* Tests the Config class.
Expand All @@ -16,6 +17,9 @@
* @coversDefaultClass Drupal\openseadragon\File\FileInformation
*/
class ConfigTests extends KernelTestBase {

use ProphecyTrait;

/**
* {@inheritdoc}
*/
Expand All @@ -27,14 +31,14 @@ class ConfigTests extends KernelTestBase {
/**
* The mimetype guesser prophecy.
*
* @var Prophecy\Prophet
* @var \Prophecy\Prophecy\ObjectProphecy
*/
private $mimeProphet;

/**
* The file entity prophecy.
*
* @var Prophecy\Prophet
* @var \Prophecy\Prophecy\ObjectProphecy
*/
private $fileProphet;

Expand All @@ -44,7 +48,7 @@ class ConfigTests extends KernelTestBase {
public function setUp(): void {
parent::setUp();

$this->mimeProphet = $this->prophesize(MimeTypeGuesserInterface::class);
$this->mimeProphet = $this->prophesize(MimeTypesInterface::class);
$this->fileProphet = $this->prophesize(File::class);
}

Expand Down
3 changes: 3 additions & 0 deletions tests/src/Kernel/IIIFManifestParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Log\LoggerInterface;

/**
Expand All @@ -22,6 +23,8 @@
*/
class IIIFManifestParserTest extends KernelTestBase {

use ProphecyTrait;

/**
* {@inheritdoc}
*/
Expand Down