mirror of
https://github.com/Intervention/image.git
synced 2025-08-21 21:15:11 +02:00
Add ImageManager::driver()
This commit is contained in:
@@ -124,6 +124,16 @@ final class ImageManager
|
|||||||
return $this->driver->createAnimation($init);
|
return $this->driver->createAnimation($init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return currently used driver
|
||||||
|
*
|
||||||
|
* @return DriverInterface
|
||||||
|
*/
|
||||||
|
public function driver(): DriverInterface
|
||||||
|
{
|
||||||
|
return $this->driver;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return driver object
|
* Return driver object
|
||||||
*
|
*
|
||||||
|
@@ -35,6 +35,13 @@ final class ImageManagerTest extends BaseTestCase
|
|||||||
$this->assertInstanceOf(ImageManager::class, $manager);
|
$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
|
public function testDriverStatics(): void
|
||||||
{
|
{
|
||||||
$manager = ImageManager::gd();
|
$manager = ImageManager::gd();
|
||||||
|
Reference in New Issue
Block a user