]> source.dussan.org Git - nextcloud-server.git/commitdiff
Revert "Do not run image tests on php8"
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 26 Oct 2021 09:55:43 +0000 (11:55 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 2 Nov 2021 10:49:41 +0000 (11:49 +0100)
This reverts commit d690f909284ae4bb4dee7d00318104ee76720bfa.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
tests/lib/ImageTest.php

index ebf00392d875f658fc312a9b501dc6878cec8a01..5b83c4ac57fbbbce82e07c2baeb40c49e76d07f2 100644 (file)
@@ -20,10 +20,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testConstructDestruct() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertInstanceOf('\OC_Image', $img);
@@ -51,10 +47,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testValid() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertTrue($img->valid());
@@ -69,10 +61,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testMimeType() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertEquals('image/png', $img->mimeType());
@@ -90,10 +78,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testWidth() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertEquals(128, $img->width());
@@ -111,10 +95,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testHeight() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertEquals(128, $img->height());
@@ -132,10 +112,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testSave() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $img->resize(16);
@@ -150,10 +126,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testData() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.png'));
@@ -188,10 +160,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testDataNoResource() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $this->assertNull($img->data());
        }
@@ -200,10 +168,6 @@ class ImageTest extends \Test\TestCase {
         * @depends testData
         */
        public function testToString() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $expected = base64_encode($img->data());
@@ -221,10 +185,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testResize() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertTrue($img->resize(32));
@@ -245,10 +205,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testPreciseResize() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertTrue($img->preciseResize(128, 512));
@@ -269,10 +225,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testCenterCrop() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $img->centerCrop();
@@ -293,10 +245,6 @@ class ImageTest extends \Test\TestCase {
        }
 
        public function testCrop() {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertTrue($img->crop(0, 0, 50, 20));
@@ -332,10 +280,6 @@ class ImageTest extends \Test\TestCase {
         * @param int[] $expected
         */
        public function testFitIn($filename, $asked, $expected) {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT . '/tests/data/' . $filename);
                $this->assertTrue($img->fitIn($asked[0], $asked[1]));
@@ -359,10 +303,6 @@ class ImageTest extends \Test\TestCase {
         * @param string $filename
         */
        public function testScaleDownToFitWhenSmallerAlready($filename) {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename);
                $currentWidth = $img->width();
@@ -396,10 +336,6 @@ class ImageTest extends \Test\TestCase {
         * @param int[] $expected
         */
        public function testScaleDownWhenBigger($filename, $asked, $expected) {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename);
                //$this->assertTrue($img->scaleDownToFit($asked[0], $asked[1]));
@@ -420,10 +356,6 @@ class ImageTest extends \Test\TestCase {
         * @dataProvider convertDataProvider
         */
        public function testConvert($mimeType) {
-               if (PHP_MAJOR_VERSION > 7) {
-                       $this->markTestSkipped('Only run on php7');
-               }
-
                $img = new \OC_Image();
                $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
                $tempFile = tempnam(sys_get_temp_dir(), 'img-test');