5
5
*/
6
6
namespace Magento \Framework \Image \Adapter ;
7
7
8
- use Magento \Framework \App \Filesystem \DirectoryList ;
9
-
10
8
/**
11
9
* @magentoAppIsolation enabled
12
10
*/
@@ -547,11 +545,6 @@ public function cropDataProvider()
547
545
*/
548
546
public function testCreatePngFromString ($ pixel1 , $ expectedColor1 , $ pixel2 , $ expectedColor2 , $ adapterType )
549
547
{
550
- if (!function_exists ('imagettfbbox ' )
551
- || (getenv ('TRAVIS ' ) && getenv ('TRAVIS_PHP_VERSION ' ) == '7.1 ' )
552
- ) {
553
- $ this ->markTestSkipped ('Workaround for problem with imagettfbbox() function on Travis ' );
554
- }
555
548
$ adapter = $ this ->_getAdapter ($ adapterType );
556
549
557
550
/** @var \Magento\Framework\Filesystem\Directory\ReadFactory readFactory */
@@ -564,9 +557,11 @@ public function testCreatePngFromString($pixel1, $expectedColor1, $pixel2, $expe
564
557
$ adapter ->refreshImageDimensions ();
565
558
566
559
$ color1 = $ adapter ->getColorAt ($ pixel1 ['x ' ], $ pixel1 ['y ' ]);
560
+ unset($ color1 ['alpha ' ]);
567
561
$ this ->assertEquals ($ expectedColor1 , $ color1 );
568
562
569
563
$ color2 = $ adapter ->getColorAt ($ pixel2 ['x ' ], $ pixel2 ['y ' ]);
564
+ unset($ color2 ['alpha ' ]);
570
565
$ this ->assertEquals ($ expectedColor2 , $ color2 );
571
566
}
572
567
@@ -580,30 +575,30 @@ public function createPngFromStringDataProvider()
580
575
return [
581
576
[
582
577
['x ' => 5 , 'y ' => 8 ],
583
- 'expectedColor1 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 , ' alpha ' => 0 ],
584
- ['x ' => 0 , 'y ' => 15 ],
585
- 'expectedColor2 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 , ' alpha ' => 127 ],
578
+ 'expectedColor1 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 ],
579
+ ['x ' => 0 , 'y ' => 14 ],
580
+ 'expectedColor2 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 ],
586
581
\Magento \Framework \Image \Adapter \AdapterInterface::ADAPTER_GD2 ,
587
582
],
588
583
[
589
- ['x ' => 4 , 'y ' => 7 ],
590
- 'expectedColor1 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 , ' alpha ' => 0 ],
591
- ['x ' => 0 , 'y ' => 15 ],
592
- 'expectedColor2 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 , ' alpha ' => 127 ],
584
+ ['x ' => 5 , 'y ' => 12 ],
585
+ 'expectedColor1 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 ],
586
+ ['x ' => 0 , 'y ' => 20 ],
587
+ 'expectedColor2 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 ],
593
588
\Magento \Framework \Image \Adapter \AdapterInterface::ADAPTER_IM
594
589
],
595
590
[
596
591
['x ' => 1 , 'y ' => 14 ],
597
- 'expectedColor1 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 , ' alpha ' => 127 ],
592
+ 'expectedColor1 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 ],
598
593
['x ' => 5 , 'y ' => 12 ],
599
- 'expectedColor2 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 , ' alpha ' => 0 ],
594
+ 'expectedColor2 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 ],
600
595
\Magento \Framework \Image \Adapter \AdapterInterface::ADAPTER_GD2
601
596
],
602
597
[
603
- ['x ' => 1 , 'y ' => 14 ],
604
- 'expectedColor1 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 , ' alpha ' => 127 ],
605
- ['x ' => 4 , 'y ' => 10 ],
606
- 'expectedColor2 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 , ' alpha ' => 0 ],
598
+ ['x ' => 1 , 'y ' => 20 ],
599
+ 'expectedColor1 ' => ['red ' => 255 , 'green ' => 255 , 'blue ' => 255 ],
600
+ ['x ' => 5 , 'y ' => 16 ],
601
+ 'expectedColor2 ' => ['red ' => 0 , 'green ' => 0 , 'blue ' => 0 ],
607
602
\Magento \Framework \Image \Adapter \AdapterInterface::ADAPTER_IM
608
603
]
609
604
];
0 commit comments