mirror of
https://github.com/Intervention/image.git
synced 2025-08-16 02:44:01 +02:00
Test
This commit is contained in:
16
.github/workflows/run-tests.yml
vendored
16
.github/workflows/run-tests.yml
vendored
@@ -10,22 +10,6 @@ jobs:
|
|||||||
php-versions: ['8.0']
|
php-versions: ['8.0']
|
||||||
name: Testing on PHP ${{ matrix.php-versions }}
|
name: Testing on PHP ${{ matrix.php-versions }}
|
||||||
steps:
|
steps:
|
||||||
- name: Run PHP code
|
|
||||||
shell: php {0}
|
|
||||||
run: |
|
|
||||||
<?php
|
|
||||||
$value = 2130706432;
|
|
||||||
$a = ($value >> 24) & 0xFF;
|
|
||||||
$r = ($value >> 16) & 0xFF;
|
|
||||||
$g = ($value >> 8) & 0xFF;
|
|
||||||
$b = $value & 0xFF;
|
|
||||||
$a1 = (float) round(1 - $a / 127, 2);
|
|
||||||
$a2 = round(1 - $a / 127, 2);
|
|
||||||
$a3 = 1 - $a / 127;
|
|
||||||
var_dump($a);
|
|
||||||
var_dump($a1);
|
|
||||||
var_dump($a2);
|
|
||||||
var_dump($a3);
|
|
||||||
- name: 'Checkout Project'
|
- name: 'Checkout Project'
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: 'Setup Environment'
|
- name: 'Setup Environment'
|
||||||
|
@@ -23,7 +23,7 @@ class ResizeModifierTest extends TestCase
|
|||||||
$this->assertColor(255, 0, 0, 1, $image->pickColor(150, 70));
|
$this->assertColor(255, 0, 0, 1, $image->pickColor(150, 70));
|
||||||
$this->assertColor(0, 255, 0, 1, $image->pickColor(125, 70));
|
$this->assertColor(0, 255, 0, 1, $image->pickColor(125, 70));
|
||||||
$this->assertColor(0, 0, 255, 1, $image->pickColor(130, 54));
|
$this->assertColor(0, 0, 255, 1, $image->pickColor(130, 54));
|
||||||
$transparent = $image->pickColor(150, 45);
|
$transparent = $image->pickColor(170, 30);
|
||||||
$this->assertEquals(2130706432, $transparent->toInt());
|
$this->assertEquals(2130706432, $transparent->toInt());
|
||||||
$this->assertTransparency($transparent);
|
$this->assertTransparency($transparent);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user