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:
@@ -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
|
||||
*
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user