mirror of
https://github.com/Intervention/image.git
synced 2025-08-23 14:02:47 +02:00
PHPUnit 10 Migration (#1302)
* Bump PHPUnit dependencies * Set return type of base TestCase methods From the [PHPUnit 8 release notes][1], the `TestCase` methods below now declare a `void` return type: - `setUpBeforeClass()` - `setUp()` - `assertPreConditions()` - `assertPostConditions()` - `tearDown()` - `tearDownAfterClass()` - `onNotSuccessfulTest()` [1]: https://phpunit.de/announcements/phpunit-8.html * Ignore PHPUnit cache folder * Adopt PHP attributes in test classes * Declare data providers as `static` * Add return types to test methods * Define test classes as `final` * Migrate phpunit.xml to phpunit 10 * Correct phpunit attribute class name * Rename base test class * Restructure test folders * Fix test image paths * Only set rules for php files in .editorconfig * Remove php unit flag in local test env --------- Co-authored-by: Shift <shift@laravelshift.com>
This commit is contained in:
@@ -2,13 +2,11 @@
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
[*.php]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.php]
|
||||
indent_size = 4
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
build/
|
||||
vendor/
|
||||
.phpunit.result.cache
|
||||
/.phpunit.cache
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
|
@@ -1,51 +1,51 @@
|
||||
{
|
||||
"name": "intervention/image",
|
||||
"description": "PHP image manipulation",
|
||||
"homepage": "https://image.intervention.io/",
|
||||
"keywords": [
|
||||
"image",
|
||||
"gd",
|
||||
"imagick",
|
||||
"watermark",
|
||||
"thumbnail",
|
||||
"resize"
|
||||
],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Oliver Vogel",
|
||||
"email": "oliver@intervention.io",
|
||||
"homepage": "https://intervention.io/"
|
||||
"name": "intervention/image",
|
||||
"description": "PHP image manipulation",
|
||||
"homepage": "https://image.intervention.io/",
|
||||
"keywords": [
|
||||
"image",
|
||||
"gd",
|
||||
"imagick",
|
||||
"watermark",
|
||||
"thumbnail",
|
||||
"resize"
|
||||
],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Oliver Vogel",
|
||||
"email": "oliver@intervention.io",
|
||||
"homepage": "https://intervention.io/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"ext-mbstring": "*",
|
||||
"intervention/gif": "^4.0.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^10.0",
|
||||
"mockery/mockery": "^1.6",
|
||||
"phpstan/phpstan": "^1",
|
||||
"squizlabs/php_codesniffer": "^3.8",
|
||||
"slevomat/coding-standard": "~8.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-exif": "Recommended to be able to read EXIF data properly."
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Intervention\\Image\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Intervention\\Image\\Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"ext-mbstring": "*",
|
||||
"intervention/gif": "^4.0.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9",
|
||||
"mockery/mockery": "^1.6",
|
||||
"phpstan/phpstan": "^1",
|
||||
"squizlabs/php_codesniffer": "^3.8",
|
||||
"slevomat/coding-standard": "~8.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-exif": "Recommended to be able to read EXIF data properly."
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Intervention\\Image\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Intervention\\Image\\Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ services:
|
||||
tests:
|
||||
build: ./
|
||||
working_dir: /project
|
||||
command: bash -c "composer install && ./vendor/bin/phpunit -vvv"
|
||||
command: bash -c "composer install && ./vendor/bin/phpunit"
|
||||
volumes:
|
||||
- ./:/project
|
||||
coverage:
|
||||
|
24
phpunit.xml
24
phpunit.xml
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
beStrictAboutTestsThatDoNotTestAnything="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Package Test Suite">
|
||||
<directory suffix=".php">./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
</phpunit>
|
@@ -1,23 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Package Test Suite">
|
||||
<directory suffix=".php">./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
|
||||
<testsuites>
|
||||
<testsuite name="Unit Tests">
|
||||
<directory suffix=".php">./tests/Unit</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</source>
|
||||
</phpunit>
|
||||
|
@@ -9,7 +9,7 @@ use Intervention\Image\Colors\Rgb\Color as RgbColor;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Mockery\Adapter\Phpunit\MockeryTestCase;
|
||||
|
||||
abstract class TestCase extends MockeryTestCase
|
||||
abstract class BaseTestCase extends MockeryTestCase
|
||||
{
|
||||
public function getTestImagePath($filename = 'test.jpg'): string
|
||||
{
|
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Analyzers;
|
||||
|
||||
use Intervention\Image\Analyzers\HeightAnalyzer;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Analyzers\HeightAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\HeightAnalyzer
|
||||
*/
|
||||
class HeightAnalyzerTest extends TestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
||||
public function testAnalyze(): void
|
||||
{
|
||||
$image = $this->readTestImage('tile.png');
|
||||
$analyzer = new HeightAnalyzer();
|
||||
$result = $analyzer->analyze($image);
|
||||
$this->assertEquals(16, $result);
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Analyzers;
|
||||
|
||||
use Intervention\Image\Analyzers\WidthAnalyzer;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Analyzers\WidthAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\WidthAnalyzer
|
||||
*/
|
||||
class WidthAnalyzerTest extends TestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
||||
public function testAnalyze(): void
|
||||
{
|
||||
$image = $this->readTestImage('tile.png');
|
||||
$analyzer = new WidthAnalyzer();
|
||||
$result = $analyzer->analyze($image);
|
||||
$this->assertEquals(16, $result);
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Imagick\Analyzers;
|
||||
|
||||
use Intervention\Image\Analyzers\HeightAnalyzer;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateImagickTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension imagick
|
||||
* @covers \Intervention\Image\Analyzers\HeightAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\HeightAnalyzer
|
||||
*/
|
||||
class HeightAnalyzerTest extends TestCase
|
||||
{
|
||||
use CanCreateImagickTestImage;
|
||||
|
||||
public function testAnalyze(): void
|
||||
{
|
||||
$image = $this->readTestImage('tile.png');
|
||||
$analyzer = new HeightAnalyzer();
|
||||
$result = $analyzer->analyze($image);
|
||||
$this->assertEquals(16, $result);
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Imagick\Analyzers;
|
||||
|
||||
use Intervention\Image\Analyzers\WidthAnalyzer;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateImagickTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension imagick
|
||||
* @covers \Intervention\Image\Analyzers\WidthAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\WidthAnalyzer
|
||||
*/
|
||||
class WidthAnalyzerTest extends TestCase
|
||||
{
|
||||
use CanCreateImagickTestImage;
|
||||
|
||||
public function testAnalyze(): void
|
||||
{
|
||||
$image = $this->readTestImage('tile.png');
|
||||
$analyzer = new WidthAnalyzer();
|
||||
$result = $analyzer->analyze($image);
|
||||
$this->assertEquals(16, $result);
|
||||
}
|
||||
}
|
@@ -2,14 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Analyzers;
|
||||
|
||||
use Intervention\Image\Analyzers\SpecializableAnalyzer;
|
||||
use Intervention\Image\Interfaces\ImageInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
class SpecializableAnalyzerTest extends TestCase
|
||||
final class SpecializableAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
public function testAnalyzer(): void
|
||||
{
|
@@ -2,17 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests;
|
||||
namespace Intervention\Image\Tests\Unit;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Collection;
|
||||
use Intervention\Image\Exceptions\RuntimeException;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Collection
|
||||
*/
|
||||
class CollectionTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Collection::class)]
|
||||
final class CollectionTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor()
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$collection = new Collection(['foo', 'bar', 'baz']);
|
||||
$this->assertInstanceOf(Collection::class, $collection);
|
||||
@@ -21,7 +21,7 @@ class CollectionTest extends TestCase
|
||||
$this->assertInstanceOf(Collection::class, $collection);
|
||||
}
|
||||
|
||||
public function testIterator()
|
||||
public function testIterator(): void
|
||||
{
|
||||
$collection = new Collection(['foo', 'bar', 'baz']);
|
||||
foreach ($collection as $key => $item) {
|
||||
@@ -41,14 +41,14 @@ class CollectionTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testCount()
|
||||
public function testCount(): void
|
||||
{
|
||||
$collection = new Collection(['foo', 'bar', 'baz']);
|
||||
$this->assertEquals(3, $collection->count());
|
||||
$this->assertEquals(3, count($collection));
|
||||
}
|
||||
|
||||
public function testFilter()
|
||||
public function testFilter(): void
|
||||
{
|
||||
$collection = new Collection(['foo', 'bar', 'baz']);
|
||||
$this->assertEquals(3, $collection->count());
|
||||
@@ -58,7 +58,7 @@ class CollectionTest extends TestCase
|
||||
$this->assertEquals(2, $collection->count());
|
||||
}
|
||||
|
||||
public function testFirstLast()
|
||||
public function testFirstLast(): void
|
||||
{
|
||||
$collection = new Collection(['foo', 'bar', 'baz']);
|
||||
$this->assertEquals('foo', $collection->first());
|
||||
@@ -69,7 +69,7 @@ class CollectionTest extends TestCase
|
||||
$this->assertNull($collection->last());
|
||||
}
|
||||
|
||||
public function testPush()
|
||||
public function testPush(): void
|
||||
{
|
||||
$collection = new Collection(['foo', 'bar', 'baz']);
|
||||
$this->assertEquals(3, $collection->count());
|
||||
@@ -78,7 +78,7 @@ class CollectionTest extends TestCase
|
||||
$this->assertInstanceOf(Collection::class, $result);
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
public function testToArray(): void
|
||||
{
|
||||
$collection = new Collection(['foo', 'bar', 'baz']);
|
||||
$this->assertEquals(['foo', 'bar', 'baz'], $collection->toArray());
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Cmyk;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Cmyk;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Cmyk\Channels\Cyan as Channel;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Cmyk\Channels\Cyan
|
||||
* @covers \Intervention\Image\Colors\Cmyk\Channels\Magenta
|
||||
* @covers \Intervention\Image\Colors\Cmyk\Channels\Yellow
|
||||
* @covers \Intervention\Image\Colors\Cmyk\Channels\Key
|
||||
*/
|
||||
class ChannelTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Cyan::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Magenta::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Yellow::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Cmyk\Channels\Key::class)]
|
||||
final class ChannelTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,8 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Cmyk;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Cmyk;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Cmyk\Channels\Cyan;
|
||||
use Intervention\Image\Colors\Cmyk\Channels\Key;
|
||||
use Intervention\Image\Colors\Cmyk\Channels\Magenta;
|
||||
@@ -11,13 +13,11 @@ use Intervention\Image\Colors\Cmyk\Channels\Yellow;
|
||||
use Intervention\Image\Colors\Cmyk\Color;
|
||||
use Intervention\Image\Colors\Cmyk\Colorspace;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Cmyk\Color
|
||||
*/
|
||||
class ColorTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Cmyk\Color::class)]
|
||||
final class ColorTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,8 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Cmyk;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Cmyk;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Cmyk\Channels\Cyan;
|
||||
use Intervention\Image\Colors\Cmyk\Channels\Key;
|
||||
use Intervention\Image\Colors\Cmyk\Channels\Magenta;
|
||||
@@ -13,12 +14,10 @@ use Intervention\Image\Colors\Rgb\Color as RgbColor;
|
||||
use Intervention\Image\Colors\Hsv\Color as HsvColor;
|
||||
use Intervention\Image\Colors\Hsl\Color as HslColor;
|
||||
use Intervention\Image\Colors\Cmyk\Colorspace;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Cmyk\Colorspace
|
||||
*/
|
||||
class ColorspaceTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Cmyk\Colorspace::class)]
|
||||
final class ColorspaceTest extends BaseTestCase
|
||||
{
|
||||
public function testColorFromNormalized(): void
|
||||
{
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Cmyk\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Cmyk\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Cmyk\Color;
|
||||
use Intervention\Image\Colors\Cmyk\Decoders\StringColorDecoder;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Cmyk\Decoders\StringColorDecoder
|
||||
*/
|
||||
class StringColorDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Cmyk\Decoders\StringColorDecoder::class)]
|
||||
final class StringColorDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecode(): void
|
||||
{
|
@@ -2,20 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsl;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsl;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Hue;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Saturation;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Luminance;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Hsl\Channels\Hue
|
||||
* @covers \Intervention\Image\Colors\Hsl\Channels\Saturation
|
||||
* @covers \Intervention\Image\Colors\Hsl\Channels\Luminance
|
||||
*/
|
||||
class ChannelTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsl\Channels\Hue::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsl\Channels\Saturation::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsl\Channels\Luminance::class)]
|
||||
final class ChannelTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,12 +2,12 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsl\Channels;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsl\Channels;
|
||||
|
||||
use Intervention\Image\Colors\Hsl\Channels\Saturation;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
class SaturationTest extends TestCase
|
||||
final class SaturationTest extends BaseTestCase
|
||||
{
|
||||
public function testMinMax(): void
|
||||
{
|
@@ -2,20 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsl;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsl;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Hue;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Luminance;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Saturation;
|
||||
use Intervention\Image\Colors\Hsl\Color;
|
||||
use Intervention\Image\Colors\Hsl\Colorspace;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Hsl\Color
|
||||
*/
|
||||
class ColorTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsl\Color::class)]
|
||||
final class ColorTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,8 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsl;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsl;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Hue;
|
||||
use Intervention\Image\Colors\Hsl\Channels\Luminance;
|
||||
@@ -12,12 +13,10 @@ use Intervention\Image\Colors\Hsl\Color as HslColor;
|
||||
use Intervention\Image\Colors\Rgb\Color as RgbColor;
|
||||
use Intervention\Image\Colors\Hsv\Color as HsvColor;
|
||||
use Intervention\Image\Colors\Hsl\Colorspace;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Hsl\Colorspace
|
||||
*/
|
||||
class ColorspaceTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsl\Colorspace::class)]
|
||||
final class ColorspaceTest extends BaseTestCase
|
||||
{
|
||||
public function testColorFromNormalized(): void
|
||||
{
|
@@ -2,17 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsl\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsl\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Hsl\Color;
|
||||
use Intervention\Image\Colors\Hsl\Decoders\StringColorDecoder;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Hsl\Decoders\StringColorDecoder
|
||||
*/
|
||||
class StringColorDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsl\Decoders\StringColorDecoder::class)]
|
||||
final class StringColorDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecode(): void
|
||||
{
|
@@ -2,21 +2,21 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsv;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsv;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Hue;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Saturation;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Value;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Hsv\Channels\Hue
|
||||
* @covers \Intervention\Image\Colors\Hsv\Channels\Saturation
|
||||
* @covers \Intervention\Image\Colors\Hsv\Channels\Value
|
||||
*/
|
||||
class ChannelTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsv\Channels\Hue::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsv\Channels\Saturation::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsv\Channels\Value::class)]
|
||||
final class ChannelTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,12 +2,12 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsv\Channels;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsv\Channels;
|
||||
|
||||
use Intervention\Image\Colors\Hsv\Channels\Saturation;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
class SaturationTest extends TestCase
|
||||
final class SaturationTest extends BaseTestCase
|
||||
{
|
||||
public function testMinMax(): void
|
||||
{
|
@@ -2,12 +2,12 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsv\Channels;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsv\Channels;
|
||||
|
||||
use Intervention\Image\Colors\Hsv\Channels\Value;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
class ValueTest extends TestCase
|
||||
final class ValueTest extends BaseTestCase
|
||||
{
|
||||
public function testMinMax(): void
|
||||
{
|
@@ -2,20 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsv;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsv;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Hue;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Saturation;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Value;
|
||||
use Intervention\Image\Colors\Hsv\Color;
|
||||
use Intervention\Image\Colors\Hsv\Colorspace;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Hsv\Color
|
||||
*/
|
||||
class ColorTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsv\Color::class)]
|
||||
final class ColorTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,8 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsv;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsv;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Hue;
|
||||
use Intervention\Image\Colors\Hsv\Channels\Saturation;
|
||||
@@ -12,12 +13,10 @@ use Intervention\Image\Colors\Hsv\Color as HsvColor;
|
||||
use Intervention\Image\Colors\Rgb\Color as RgbColor;
|
||||
use Intervention\Image\Colors\Hsl\Color as HslColor;
|
||||
use Intervention\Image\Colors\Hsv\Colorspace;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Hsv\Colorspace
|
||||
*/
|
||||
class ColorspaceTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsv\Colorspace::class)]
|
||||
final class ColorspaceTest extends BaseTestCase
|
||||
{
|
||||
public function testColorFromNormalized(): void
|
||||
{
|
@@ -2,17 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Hsv\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Hsv\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Hsv\Color;
|
||||
use Intervention\Image\Colors\Hsv\Decoders\StringColorDecoder;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Hsv\Decoders\StringColorDecoder
|
||||
*/
|
||||
class StringColorDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Hsv\Decoders\StringColorDecoder::class)]
|
||||
final class StringColorDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecodeHsv(): void
|
||||
{
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Rgb;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Rgb;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Rgb\Channels\Red as Channel;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Rgb\Channels\Red
|
||||
* @covers \Intervention\Image\Colors\Rgb\Channels\Green
|
||||
* @covers \Intervention\Image\Colors\Rgb\Channels\Blue
|
||||
*/
|
||||
class ChannelTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Red::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Green::class)]
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Blue::class)]
|
||||
final class ChannelTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,15 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Rgb\Channels;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Rgb\Channels;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Rgb\Channels\Alpha;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Rgb\Channels\Alpha
|
||||
*/
|
||||
class AlphaTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Channels\Alpha::class)]
|
||||
final class AlphaTest extends BaseTestCase
|
||||
{
|
||||
public function testToString(): void
|
||||
{
|
@@ -2,8 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Rgb;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Rgb;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
|
||||
use Intervention\Image\Colors\Cmyk\Colorspace as CmykColorspace;
|
||||
use Intervention\Image\Colors\Rgb\Channels\Red;
|
||||
@@ -12,13 +14,11 @@ use Intervention\Image\Colors\Rgb\Channels\Blue;
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Rgb\Color
|
||||
*/
|
||||
class ColorTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Color::class)]
|
||||
final class ColorTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
@@ -2,8 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Rgb;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Rgb;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
|
||||
use Intervention\Image\Colors\Hsv\Color as HsvColor;
|
||||
use Intervention\Image\Colors\Rgb\Channels\Blue;
|
||||
@@ -13,12 +14,10 @@ use Intervention\Image\Colors\Rgb\Color as RgbColor;
|
||||
use Intervention\Image\Colors\Hsl\Color as HslColor;
|
||||
use Intervention\Image\Colors\Rgb\Channels\Alpha;
|
||||
use Intervention\Image\Colors\Rgb\Colorspace;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Colors\Rgb\Colorspace
|
||||
*/
|
||||
class ColorspaceTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Colorspace::class)]
|
||||
final class ColorspaceTest extends BaseTestCase
|
||||
{
|
||||
public function testColorFromNormalized(): void
|
||||
{
|
@@ -2,17 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Rgb\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Rgb\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder
|
||||
*/
|
||||
class HexColorDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder::class)]
|
||||
final class HexColorDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecode(): void
|
||||
{
|
@@ -2,17 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Rgb\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Rgb\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use Intervention\Image\Colors\Rgb\Decoders\HtmlColornameDecoder;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Rgb\Decoders\HtmlColorNameDecoder
|
||||
*/
|
||||
class HtmlColornameDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Decoders\HtmlColorNameDecoder::class)]
|
||||
final class HtmlColornameDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecode(): void
|
||||
{
|
@@ -2,17 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Colors\Rgb\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Colors\Rgb\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use Intervention\Image\Colors\Rgb\Decoders\StringColorDecoder;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Colors\Rgb\Decoders\StringColorDecoder
|
||||
*/
|
||||
class StringColorDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Colors\Rgb\Decoders\StringColorDecoder::class)]
|
||||
final class StringColorDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecode(): void
|
||||
{
|
@@ -2,14 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Decoders;
|
||||
|
||||
use Intervention\Image\Decoders\SpecializableDecoder;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
class SpecializableDecoderTest extends TestCase
|
||||
final class SpecializableDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecode(): void
|
||||
{
|
@@ -2,21 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Exception;
|
||||
use Intervention\Image\Drivers\AbstractDecoder;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Interfaces\CollectionInterface;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Intervention\Image\Interfaces\ImageInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Drivers\AbstractDecoder
|
||||
*/
|
||||
class AbstractDecoderTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Drivers\AbstractDecoder::class)]
|
||||
final class AbstractDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testHandle(): void
|
||||
{
|
@@ -2,19 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Drivers\AbstractDecoder;
|
||||
use Intervention\Image\Drivers\AbstractInputHandler;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Interfaces\ImageInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Drivers\AbstractInputHandler
|
||||
*/
|
||||
final class AbstractInputHandlerTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Drivers\AbstractInputHandler::class)]
|
||||
final class AbstractInputHandlerTest extends BaseTestCase
|
||||
{
|
||||
public function testHandle(): void
|
||||
{
|
@@ -2,18 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Drivers\DriverSpecializedEncoder;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Drivers\DriverSpecializedEncoder
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class DriverSpecializedEncoderTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Drivers\DriverSpecializedEncoder::class)]
|
||||
final class DriverSpecializedEncoderTest extends BaseTestCase
|
||||
{
|
||||
public function testGetBuffered(): void
|
||||
{
|
@@ -2,20 +2,21 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use Intervention\Image\Encoders\JpegEncoder;
|
||||
use Intervention\Image\Interfaces\DriverInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Drivers\DriverSpecialized;
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @covers \Intervention\Image\Drivers\DriverSpecialized
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class DriverSpecializedTest extends TestCase
|
||||
#[CoversClass(\Intervention\Image\Drivers\DriverSpecialized::class)]
|
||||
final class DriverSpecializedTest extends BaseTestCase
|
||||
{
|
||||
public function testBuildSpecialized(): void
|
||||
{
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\ColorspaceAnalyzer;
|
||||
use Intervention\Image\Interfaces\ColorspaceInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Analyzers\ColorspaceAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\ColorspaceAnalyzer
|
||||
*/
|
||||
class ColorspaceAnalyzerTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\ColorspaceAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ColorspaceAnalyzer::class)]
|
||||
final class ColorspaceAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
27
tests/Unit/Drivers/Gd/Analyzers/HeightAnalyzerTest.php
Normal file
27
tests/Unit/Drivers/Gd/Analyzers/HeightAnalyzerTest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\HeightAnalyzer;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\HeightAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\HeightAnalyzer::class)]
|
||||
final class HeightAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
||||
public function testAnalyze(): void
|
||||
{
|
||||
$image = $this->readTestImage('tile.png');
|
||||
$analyzer = new HeightAnalyzer();
|
||||
$result = $analyzer->analyze($image);
|
||||
$this->assertEquals(16, $result);
|
||||
}
|
||||
}
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\PixelColorAnalyzer;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Analyzers\PixelColorAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\PixelColorAnalyzer
|
||||
*/
|
||||
class PixelColorAnalyzerTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\PixelColorAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorAnalyzer::class)]
|
||||
final class PixelColorAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\PixelColorsAnalyzer;
|
||||
use Intervention\Image\Collection;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Analyzers\PixelColorsAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\PixelColorsAnalyzer
|
||||
*/
|
||||
class PixelColorsAnalyzerTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\PixelColorsAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorsAnalyzer::class)]
|
||||
final class PixelColorsAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\ResolutionAnalyzer;
|
||||
use Intervention\Image\Resolution;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Analyzers\ResolutionAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\ResolutionAnalyzer
|
||||
*/
|
||||
class ResolutionAnalyzerTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\ResolutionAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ResolutionAnalyzer::class)]
|
||||
final class ResolutionAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
27
tests/Unit/Drivers/Gd/Analyzers/WidthAnalyzerTest.php
Normal file
27
tests/Unit/Drivers/Gd/Analyzers/WidthAnalyzerTest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\WidthAnalyzer;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\WidthAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\WidthAnalyzer::class)]
|
||||
final class WidthAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
||||
public function testAnalyze(): void
|
||||
{
|
||||
$image = $this->readTestImage('tile.png');
|
||||
$analyzer = new WidthAnalyzer();
|
||||
$result = $analyzer->analyze($image);
|
||||
$this->assertEquals(16, $result);
|
||||
}
|
||||
}
|
@@ -2,14 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use Intervention\Image\Drivers\Gd\Cloner;
|
||||
use Intervention\Image\Geometry\Rectangle;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
class ClonerTest extends TestCase
|
||||
final class ClonerTest extends BaseTestCase
|
||||
{
|
||||
public function testClone(): void
|
||||
{
|
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use Intervention\Image\Colors\Rgb\Channels\Alpha;
|
||||
use Intervention\Image\Colors\Rgb\Channels\Blue;
|
||||
@@ -11,9 +11,9 @@ use Intervention\Image\Colors\Rgb\Channels\Red;
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use Intervention\Image\Drivers\Gd\ColorProcessor;
|
||||
use Intervention\Image\Exceptions\ColorException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
class ColorProcessorTest extends TestCase
|
||||
final class ColorProcessorTest extends BaseTestCase
|
||||
{
|
||||
public function testColorToNative(): void
|
||||
{
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use GdImage;
|
||||
use Intervention\Image\Drivers\Gd\Core;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Exceptions\AnimationException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
class CoreTest extends TestCase
|
||||
final class CoreTest extends BaseTestCase
|
||||
{
|
||||
protected Core $core;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->core = new Core([
|
||||
new Frame(imagecreatetruecolor(3, 2)),
|
@@ -2,13 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use Intervention\Image\Drivers\Gd\Decoders\AbstractDecoder;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
class AbstractDecoderTest extends TestCase
|
||||
final class AbstractDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testGetMediaTypeFromFilePath(): void
|
||||
{
|
@@ -2,22 +2,22 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Decoders\Base64ImageDecoder;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\Base64ImageDecoder
|
||||
*/
|
||||
class Base64ImageDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\Base64ImageDecoder::class)]
|
||||
final class Base64ImageDecoderTest extends BaseTestCase
|
||||
{
|
||||
protected Base64ImageDecoder $decoder;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->decoder = new Base64ImageDecoder();
|
||||
}
|
@@ -2,17 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Decoders\BinaryImageDecoder;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\BinaryImageDecoder
|
||||
*/
|
||||
class BinaryImageDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\BinaryImageDecoder::class)]
|
||||
final class BinaryImageDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecodePng(): void
|
||||
{
|
@@ -2,23 +2,23 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Decoders\DataUriImageDecoder;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\DataUriImageDecoder
|
||||
*/
|
||||
class DataUriImageDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\DataUriImageDecoder::class)]
|
||||
final class DataUriImageDecoderTest extends BaseTestCase
|
||||
{
|
||||
protected DataUriImageDecoder $decoder;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->decoder = new DataUriImageDecoder();
|
||||
}
|
@@ -2,23 +2,23 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Decoders\FilePathImageDecoder;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\FilePathImageDecoder
|
||||
*/
|
||||
class FilePathImageDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\FilePathImageDecoder::class)]
|
||||
final class FilePathImageDecoderTest extends BaseTestCase
|
||||
{
|
||||
protected FilePathImageDecoder $decoder;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->decoder = new FilePathImageDecoder();
|
||||
}
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Decoders\FilePointerImageDecoder;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\FilePointerImageDecoder
|
||||
*/
|
||||
class FilePointerImageDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\FilePointerImageDecoder::class)]
|
||||
final class FilePointerImageDecoderTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Decoders\ImageObjectDecoder;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\ImageObjectDecoder
|
||||
*/
|
||||
class ImageObjectDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\ImageObjectDecoder::class)]
|
||||
final class ImageObjectDecoderTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Decoders\SplFileInfoImageDecoder;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use SplFileInfo;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\SplFileInfoImageDecoder
|
||||
*/
|
||||
class SplFileInfoImageDecoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Decoders\SplFileInfoImageDecoder::class)]
|
||||
final class SplFileInfoImageDecoderTest extends BaseTestCase
|
||||
{
|
||||
public function testDecode(): void
|
||||
{
|
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use Intervention\Image\Colors\Rgb\Colorspace;
|
||||
use Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder;
|
||||
@@ -10,13 +10,13 @@ use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Intervention\Image\Interfaces\ColorProcessorInterface;
|
||||
use Intervention\Image\Interfaces\ImageInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
class DriverTest extends TestCase
|
||||
final class DriverTest extends BaseTestCase
|
||||
{
|
||||
protected Driver $driver;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->driver = new Driver();
|
||||
}
|
@@ -2,21 +2,21 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Encoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Core;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Encoders\AvifEncoder;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Encoders\AvifEncoder
|
||||
* @covers \Intervention\Image\Drivers\Gd\Encoders\AvifEncoder
|
||||
*/
|
||||
class AvifEncoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Encoders\AvifEncoder::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\AvifEncoder::class)]
|
||||
final class AvifEncoderTest extends BaseTestCase
|
||||
{
|
||||
protected function getTestImage(): Image
|
||||
{
|
@@ -2,21 +2,21 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Encoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Core;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Encoders\BmpEncoder;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Encoders\BmpEncoder
|
||||
* @covers \Intervention\Image\Drivers\Gd\Encoders\BmpEncoder
|
||||
*/
|
||||
class BmpEncoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Encoders\BmpEncoder::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\BmpEncoder::class)]
|
||||
final class BmpEncoderTest extends BaseTestCase
|
||||
{
|
||||
protected function getTestImage(): Image
|
||||
{
|
@@ -2,22 +2,22 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Encoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Core;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Encoders\GifEncoder;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Encoders\GifEncoder
|
||||
* @covers \Intervention\Image\Drivers\Gd\Encoders\GifEncoder
|
||||
*/
|
||||
class GifEncoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Encoders\GifEncoder::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\GifEncoder::class)]
|
||||
final class GifEncoderTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,21 +2,21 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Encoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Core;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Encoders\JpegEncoder;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Encoders\JpegEncoder
|
||||
* @covers \Intervention\Image\Drivers\Gd\Encoders\JpegEncoder
|
||||
*/
|
||||
class JpegEncoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Encoders\JpegEncoder::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\JpegEncoder::class)]
|
||||
final class JpegEncoderTest extends BaseTestCase
|
||||
{
|
||||
protected function getTestImage(): Image
|
||||
{
|
@@ -2,22 +2,22 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Encoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Core;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Encoders\PngEncoder;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Encoders\PngEncoder
|
||||
* @covers \Intervention\Image\Drivers\Gd\Encoders\PngEncoder
|
||||
*/
|
||||
class PngEncoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Encoders\PngEncoder::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\PngEncoder::class)]
|
||||
final class PngEncoderTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,21 +2,21 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Encoders;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Drivers\Gd\Core;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Encoders\WebpEncoder;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Encoders\WebpEncoder
|
||||
* @covers \Intervention\Image\Drivers\Gd\Encoders\WebpEncoder
|
||||
*/
|
||||
final class WebpEncoderTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Encoders\WebpEncoder::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Encoders\WebpEncoder::class)]
|
||||
final class WebpEncoderTest extends BaseTestCase
|
||||
{
|
||||
protected function getTestImage(): Image
|
||||
{
|
@@ -2,16 +2,16 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use Intervention\Image\Drivers\Gd\FontProcessor;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
use Intervention\Image\Interfaces\SizeInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Typography\Font;
|
||||
use Intervention\Image\Typography\TextBlock;
|
||||
|
||||
class FontProcessorTest extends TestCase
|
||||
final class FontProcessorTest extends BaseTestCase
|
||||
{
|
||||
public function testBoxSizeGdOne(): void
|
||||
{
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use GdImage;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\Drivers\Gd\Frame;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Geometry\Rectangle;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\Frame
|
||||
*/
|
||||
class FrameTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Frame::class)]
|
||||
final class FrameTest extends BaseTestCase
|
||||
{
|
||||
protected function getTestFrame(): Frame
|
||||
{
|
||||
@@ -51,7 +51,7 @@ class FrameTest extends TestCase
|
||||
$this->assertInstanceOf(Rectangle::class, $frame->size());
|
||||
}
|
||||
|
||||
public function testSetGetDelay()
|
||||
public function testSetGetDelay(): void
|
||||
{
|
||||
$frame = $this->getTestFrame();
|
||||
$this->assertEquals(0, $frame->delay());
|
||||
@@ -61,7 +61,7 @@ class FrameTest extends TestCase
|
||||
$this->assertEquals(1.5, $frame->delay());
|
||||
}
|
||||
|
||||
public function testSetGetDispose()
|
||||
public function testSetGetDispose(): void
|
||||
{
|
||||
$frame = $this->getTestFrame();
|
||||
$this->assertEquals(1, $frame->dispose());
|
||||
@@ -71,7 +71,7 @@ class FrameTest extends TestCase
|
||||
$this->assertEquals(100, $frame->dispose());
|
||||
}
|
||||
|
||||
public function testSetGetOffsetLeft()
|
||||
public function testSetGetOffsetLeft(): void
|
||||
{
|
||||
$frame = $this->getTestFrame();
|
||||
$this->assertEquals(0, $frame->offsetLeft());
|
||||
@@ -81,7 +81,7 @@ class FrameTest extends TestCase
|
||||
$this->assertEquals(100, $frame->offsetLeft());
|
||||
}
|
||||
|
||||
public function testSetGetOffsetTop()
|
||||
public function testSetGetOffsetTop(): void
|
||||
{
|
||||
$frame = $this->getTestFrame();
|
||||
$this->assertEquals(0, $frame->offsetTop());
|
||||
@@ -91,7 +91,7 @@ class FrameTest extends TestCase
|
||||
$this->assertEquals(100, $frame->offsetTop());
|
||||
}
|
||||
|
||||
public function testSetGetOffset()
|
||||
public function testSetGetOffset(): void
|
||||
{
|
||||
$frame = $this->getTestFrame();
|
||||
$this->assertEquals(0, $frame->offsetTop());
|
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use Intervention\Image\Analyzers\WidthAnalyzer;
|
||||
use Intervention\Image\Collection;
|
||||
@@ -22,17 +22,17 @@ use Intervention\Image\Interfaces\ImageInterface;
|
||||
use Intervention\Image\Interfaces\ResolutionInterface;
|
||||
use Intervention\Image\Interfaces\SizeInterface;
|
||||
use Intervention\Image\Modifiers\GreyscaleModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
use Intervention\Image\Typography\Font;
|
||||
|
||||
class ImageTest extends TestCase
|
||||
final class ImageTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
||||
protected Image $image;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->image = new Image(
|
||||
new Driver(),
|
@@ -2,22 +2,22 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
|
||||
use Intervention\Image\Colors\Hsv\Color as HsvColor;
|
||||
use Intervention\Image\Colors\Rgb\Color as RgbColor;
|
||||
use Intervention\Image\Image;
|
||||
use Intervention\Image\Drivers\Gd\InputHandler;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use SplFileInfo;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Drivers\Gd\InputHandler
|
||||
*/
|
||||
class InputHandlerTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\InputHandler::class)]
|
||||
final class InputHandlerTest extends BaseTestCase
|
||||
{
|
||||
public function testHandleEmptyString(): void
|
||||
{
|
||||
@@ -29,7 +29,7 @@ class InputHandlerTest extends TestCase
|
||||
public function testHandleBinaryImage(): void
|
||||
{
|
||||
$handler = new InputHandler();
|
||||
$input = file_get_contents(__DIR__ . '/../../images/animation.gif');
|
||||
$input = file_get_contents($this->getTestImagePath('test.jpg'));
|
||||
$result = $handler->handle($input);
|
||||
$this->assertInstanceOf(Image::class, $result);
|
||||
}
|
||||
@@ -37,7 +37,7 @@ class InputHandlerTest extends TestCase
|
||||
public function testHandleSplFileInfo(): void
|
||||
{
|
||||
$handler = new InputHandler();
|
||||
$input = new SplFileInfo(__DIR__ . '/../../images/test.jpg');
|
||||
$input = new SplFileInfo($this->getTestImagePath('test.jpg'));
|
||||
$result = $handler->handle($input);
|
||||
$this->assertInstanceOf(Image::class, $result);
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class InputHandlerTest extends TestCase
|
||||
public function testHandleFilePathImage(): void
|
||||
{
|
||||
$handler = new InputHandler();
|
||||
$input = __DIR__ . '/../../images/animation.gif';
|
||||
$input = $this->getTestImagePath('animation.gif');
|
||||
$result = $handler->handle($input);
|
||||
$this->assertInstanceOf(Image::class, $result);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class InputHandlerTest extends TestCase
|
||||
public function testHandleBase64Image(): void
|
||||
{
|
||||
$handler = new InputHandler();
|
||||
$input = base64_encode(file_get_contents(__DIR__ . '/../../images/animation.gif'));
|
||||
$input = base64_encode(file_get_contents($this->getTestImagePath('animation.gif')));
|
||||
$result = $handler->handle($input);
|
||||
$this->assertInstanceOf(Image::class, $result);
|
||||
}
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\BlurModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\BlurModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\BlurModifier
|
||||
*/
|
||||
class BlurModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\BlurModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\BlurModifier::class)]
|
||||
final class BlurModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\BrightnessModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\BrightnessModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\BrightnessModifier
|
||||
*/
|
||||
class BrightnessModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\BrightnessModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\BrightnessModifier::class)]
|
||||
final class BrightnessModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\ColorizeModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\ColorizeModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\ColorizeModifier
|
||||
*/
|
||||
class ColorizeModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\ColorizeModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\ColorizeModifier::class)]
|
||||
final class ColorizeModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\ContainModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\ContainModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\ContainModifier
|
||||
*/
|
||||
class ContainModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\ContainModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\ContainModifier::class)]
|
||||
final class ContainModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\ContrastModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\ContrastModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\ContrastModifier
|
||||
*/
|
||||
class ContrastModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\ContrastModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\ContrastModifier::class)]
|
||||
final class ContrastModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\CoverModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\CoverModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\CoverModifier
|
||||
*/
|
||||
class CoverModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\CoverModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\CoverModifier::class)]
|
||||
final class CoverModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\CropModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\CropModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\CropModifier
|
||||
*/
|
||||
class CropModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\CropModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\CropModifier::class)]
|
||||
final class CropModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\DrawEllipseModifier;
|
||||
use Intervention\Image\Geometry\Ellipse;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\DrawEllipseModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\DrawEllipseModifier
|
||||
*/
|
||||
class DrawEllipseModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\DrawEllipseModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\DrawEllipseModifier::class)]
|
||||
final class DrawEllipseModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\DrawLineModifier;
|
||||
use Intervention\Image\Geometry\Line;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\DrawLineModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\DrawLineModifier
|
||||
*/
|
||||
class DrawLineModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\DrawLineModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\DrawLineModifier::class)]
|
||||
final class DrawLineModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\DrawPixelModifier;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\DrawPixelModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\DrawPixelModifier
|
||||
*/
|
||||
class DrawPixelModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\DrawPixelModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\DrawPixelModifier::class)]
|
||||
final class DrawPixelModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\DrawPolygonModifier;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
use Intervention\Image\Geometry\Polygon;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\DrawPixelModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\DrawPixelModifier
|
||||
*/
|
||||
class DrawPolygonModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\DrawPixelModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\DrawPixelModifier::class)]
|
||||
final class DrawPolygonModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\DrawRectangleModifier;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
use Intervention\Image\Geometry\Rectangle;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\DrawRectangleModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\DrawRectangleModifier
|
||||
*/
|
||||
class DrawRectangleModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\DrawRectangleModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\DrawRectangleModifier::class)]
|
||||
final class DrawRectangleModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Colors\Rgb\Color;
|
||||
use Intervention\Image\Modifiers\FillModifier;
|
||||
use Intervention\Image\Geometry\Point;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\FillModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\FillModifier
|
||||
*/
|
||||
class FillModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\FillModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\FillModifier::class)]
|
||||
final class FillModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\FlipModifier;
|
||||
use Intervention\Image\Modifiers\FlopModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\FlipModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\FlipModifier
|
||||
*/
|
||||
class FlipFlopModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\FlipModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\FlipModifier::class)]
|
||||
final class FlipFlopModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\GammaModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\GammaModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\GammaModifier
|
||||
*/
|
||||
class GammaModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\GammaModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\GammaModifier::class)]
|
||||
final class GammaModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\GreyscaleModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\GreyscaleModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\GreyscaleModifier
|
||||
*/
|
||||
class GreyscaleModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\GreyscaleModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\GreyscaleModifier::class)]
|
||||
final class GreyscaleModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\InvertModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\InvertModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\InvertModifier
|
||||
*/
|
||||
class InvertModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\InvertModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\InvertModifier::class)]
|
||||
final class InvertModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\PixelateModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\PixelateModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\PixelateModifier
|
||||
*/
|
||||
class PixelateModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\PixelateModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\PixelateModifier::class)]
|
||||
final class PixelateModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\PlaceModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\PlaceModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\PlaceModifier
|
||||
*/
|
||||
class PlaceModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\PlaceModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\PlaceModifier::class)]
|
||||
final class PlaceModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
||||
@@ -21,7 +21,7 @@ class PlaceModifierTest extends TestCase
|
||||
{
|
||||
$image = $this->readTestImage('test.jpg');
|
||||
$this->assertEquals('febc44', $image->pickColor(300, 25)->toHex());
|
||||
$image->modify(new PlaceModifier(__DIR__ . '/../../../images/circle.png', 'top-right', 0, 0));
|
||||
$image->modify(new PlaceModifier($this->getTestImagePath('circle.png'), 'top-right', 0, 0));
|
||||
$this->assertEquals('32250d', $image->pickColor(300, 25)->toHex());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class PlaceModifierTest extends TestCase
|
||||
{
|
||||
$image = $this->readTestImage('test.jpg');
|
||||
$this->assertEquals('febc44', $image->pickColor(300, 25)->toHex());
|
||||
$image->modify(new PlaceModifier(__DIR__ . '/../../../images/circle.png', 'top-right', 0, 0, 50));
|
||||
$image->modify(new PlaceModifier($this->getTestImagePath('circle.png'), 'top-right', 0, 0, 50));
|
||||
$this->assertEquals('987028', $image->pickColor(300, 25)->toHex());
|
||||
}
|
||||
}
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Exceptions\InputException;
|
||||
use Intervention\Image\Interfaces\ImageInterface;
|
||||
use Intervention\Image\Modifiers\QuantizeColorsModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\QuantizeColorsModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\QuantizeColorsModifier
|
||||
*/
|
||||
class QuantizeColorsModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\QuantizeColorsModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\QuantizeColorsModifier::class)]
|
||||
final class QuantizeColorsModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Exceptions\InputException;
|
||||
use Intervention\Image\Modifiers\RemoveAnimationModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\RemoveAnimationModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\RemoveAnimationModifier
|
||||
*/
|
||||
class RemoveAnimationModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\RemoveAnimationModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\RemoveAnimationModifier::class)]
|
||||
final class RemoveAnimationModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\ResizeCanvasModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\ResizeCanvasModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\ResizeCanvasModifier
|
||||
*/
|
||||
class ResizeCanvasModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\ResizeCanvasModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\ResizeCanvasModifier::class)]
|
||||
final class ResizeCanvasModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\ResizeCanvasRelativeModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\ResizeCanvasRelativeModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\ResizeCanvasRelativeModifier
|
||||
*/
|
||||
class ResizeCanvasRelativeModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\ResizeCanvasRelativeModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\ResizeCanvasRelativeModifier::class)]
|
||||
final class ResizeCanvasRelativeModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\ResizeModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\ResizeModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\ResizeModifier
|
||||
*/
|
||||
class ResizeModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\ResizeModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\ResizeModifier::class)]
|
||||
final class ResizeModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\ResolutionModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\ResolutionModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\ResolutionModifier
|
||||
*/
|
||||
class ResolutionModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\ResolutionModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\ResolutionModifier::class)]
|
||||
final class ResolutionModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\RotateModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\RotateModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\RotateModifier
|
||||
*/
|
||||
class RotateModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\RotateModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\RotateModifier::class)]
|
||||
final class RotateModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Modifiers\SharpenModifier;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension gd
|
||||
* @covers \Intervention\Image\Modifiers\SharpenModifier
|
||||
* @covers \Intervention\Image\Drivers\Gd\Modifiers\SharpenModifier
|
||||
*/
|
||||
class SharpenModifierTest extends TestCase
|
||||
#[RequiresPhpExtension('gd')]
|
||||
#[CoversClass(\Intervention\Image\Modifiers\SharpenModifier::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\SharpenModifier::class)]
|
||||
final class SharpenModifierTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateGdTestImage;
|
||||
|
@@ -2,14 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Gd\Traits;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Traits;
|
||||
|
||||
use Intervention\Image\Drivers\Gd\Decoders\Traits\CanDecodeGif;
|
||||
use Intervention\Image\Interfaces\ImageInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
class CanDecodeGifTest extends TestCase
|
||||
final class CanDecodeGifTest extends BaseTestCase
|
||||
{
|
||||
public function testDecodeGifFromBinaryAnimation(): void
|
||||
{
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Imagick\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\ColorspaceAnalyzer;
|
||||
use Intervention\Image\Interfaces\ColorspaceInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateImagickTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension imagick
|
||||
* @covers \Intervention\Image\Analyzers\ColorspaceAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\ColorspaceAnalyzer
|
||||
*/
|
||||
class ColorspaceAnalyzerTest extends TestCase
|
||||
#[RequiresPhpExtension('imagick')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\ColorspaceAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\ColorspaceAnalyzer::class)]
|
||||
final class ColorspaceAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateImagickTestImage;
|
||||
|
27
tests/Unit/Drivers/Imagick/Analyzers/HeightAnalyzerTest.php
Normal file
27
tests/Unit/Drivers/Imagick/Analyzers/HeightAnalyzerTest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\HeightAnalyzer;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateImagickTestImage;
|
||||
|
||||
#[RequiresPhpExtension('imagick')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\HeightAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\HeightAnalyzer::class)]
|
||||
final class HeightAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateImagickTestImage;
|
||||
|
||||
public function testAnalyze(): void
|
||||
{
|
||||
$image = $this->readTestImage('tile.png');
|
||||
$analyzer = new HeightAnalyzer();
|
||||
$result = $analyzer->analyze($image);
|
||||
$this->assertEquals(16, $result);
|
||||
}
|
||||
}
|
@@ -2,19 +2,19 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Imagick\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\PixelColorAnalyzer;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateImagickTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension imagick
|
||||
* @covers \Intervention\Image\Analyzers\PixelColorAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\PixelColorAnalyzer
|
||||
*/
|
||||
class PixelColorAnalyzerTest extends TestCase
|
||||
#[RequiresPhpExtension('imagick')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\PixelColorAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorAnalyzer::class)]
|
||||
final class PixelColorAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateImagickTestImage;
|
||||
|
@@ -2,20 +2,20 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Tests\Drivers\Imagick\Analyzers;
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Analyzers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
|
||||
use Intervention\Image\Analyzers\PixelColorsAnalyzer;
|
||||
use Intervention\Image\Collection;
|
||||
use Intervention\Image\Interfaces\ColorInterface;
|
||||
use Intervention\Image\Tests\TestCase;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Intervention\Image\Tests\Traits\CanCreateImagickTestImage;
|
||||
|
||||
/**
|
||||
* @requires extension imagick
|
||||
* @covers \Intervention\Image\Analyzers\PixelColorsAnalyzer
|
||||
* @covers \Intervention\Image\Drivers\Imagick\Analyzers\PixelColorsAnalyzer
|
||||
*/
|
||||
class PixelColorsAnalyzerTest extends TestCase
|
||||
#[RequiresPhpExtension('imagick')]
|
||||
#[CoversClass(\Intervention\Image\Analyzers\PixelColorsAnalyzer::class)]
|
||||
#[CoversClass(\Intervention\Image\Drivers\Imagick\Analyzers\PixelColorsAnalyzer::class)]
|
||||
final class PixelColorsAnalyzerTest extends BaseTestCase
|
||||
{
|
||||
use CanCreateImagickTestImage;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user