1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-19 12:11:26 +02:00

Add ImageManager::driver()

This commit is contained in:
Oliver Vogel
2024-04-13 15:37:39 +02:00
parent 6e104b6594
commit 2691d92ec5
2 changed files with 17 additions and 0 deletions

View File

@@ -124,6 +124,16 @@ final class ImageManager
return $this->driver->createAnimation($init);
}
/**
* Return currently used driver
*
* @return DriverInterface
*/
public function driver(): DriverInterface
{
return $this->driver;
}
/**
* Return driver object
*

View File

@@ -35,6 +35,13 @@ final class ImageManagerTest extends BaseTestCase
$this->assertInstanceOf(ImageManager::class, $manager);
}
public function testDriver(): void
{
$driver = new GdDriver();
$manager = ImageManager::withDriver($driver);
$this->assertEquals($driver, $manager->driver());
}
public function testDriverStatics(): void
{
$manager = ImageManager::gd();