Skip to content

Commit ee022ac

Browse files
committed
MAGETWO-62464: Travis CI: GD2 imagettfbbox creates image with invalid size
1 parent 0eaa3da commit ee022ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dev/tests/integration/testsuite/Magento/Framework/Image/Adapter/InterfaceTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ protected function _getAdapter($adapterType)
116116
{
117117
try {
118118
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
119-
$adapter = $objectManager->get('Magento\Framework\Image\AdapterFactory')->create($adapterType);
119+
$adapter = $objectManager->get(\Magento\Framework\Image\AdapterFactory::class)->create($adapterType);
120120
return $adapter;
121121
} catch (\Exception $e) {
122122
$this->markTestSkipped($e->getMessage());
@@ -547,15 +547,15 @@ public function cropDataProvider()
547547
*/
548548
public function testCreatePngFromString($pixel1, $expectedColor1, $pixel2, $expectedColor2, $adapterType)
549549
{
550-
if (!function_exists('imagettfbbox')) {
551-
$this->markTestSkipped('Workaround of problem with imagettfbbox function on Travis');
550+
if (!function_exists('imagettfbbox') || (getenv('TRAVIS'))) {
551+
$this->markTestSkipped('Workaround for problem with imagettfbbox() function on Travis');
552552
}
553553

554554
$adapter = $this->_getAdapter($adapterType);
555555

556556
/** @var \Magento\Framework\Filesystem\Directory\ReadFactory readFactory */
557557
$readFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
558-
'Magento\Framework\Filesystem\Directory\ReadFactory'
558+
\Magento\Framework\Filesystem\Directory\ReadFactory::class
559559
);
560560
$reader = $readFactory->create(BP);
561561
$path = $reader->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_Re-4.4.1.ttf');
@@ -611,7 +611,7 @@ public function createPngFromStringDataProvider()
611611
public function testValidateUploadFile()
612612
{
613613
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
614-
$imageAdapter = $objectManager->get('Magento\Framework\Image\AdapterFactory')->create();
614+
$imageAdapter = $objectManager->get(\Magento\Framework\Image\AdapterFactory::class)->create();
615615
$this->assertTrue($imageAdapter->validateUploadFile($this->_getFixture('magento_thumbnail.jpg')));
616616
}
617617

@@ -621,7 +621,7 @@ public function testValidateUploadFile()
621621
public function testValidateUploadFileException()
622622
{
623623
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
624-
$imageAdapter = $objectManager->get('Magento\Framework\Image\AdapterFactory')->create();
624+
$imageAdapter = $objectManager->get(\Magento\Framework\Image\AdapterFactory::class)->create();
625625
$imageAdapter->validateUploadFile(__FILE__);
626626
}
627627
}

0 commit comments

Comments
 (0)