- $this->assertEquals($width, imagesx($image));
- $this->assertEquals($height, imagesy($image));
+ $this->assertEquals(self::WIDTH, imagesx($image));
+ $this->assertEquals(self::HEIGHT, imagesy($image));
+ }
+
+ /**
+ * Test a thumbnail with a custom size in 'common' mode.
+ */
+ public function testThumbnailCommonValid()
+ {
+ $this->conf->set('thumbnails.mode', Thumbnailer::MODE_COMMON);
+ $thumb = $this->thumbnailer->get('https://imgur.com/jlFgGpe');
+ $this->assertNotFalse($thumb);
+ $image = imagecreatefromstring(file_get_contents($thumb));
+ $this->assertEquals(self::WIDTH, imagesx($image));
+ $this->assertEquals(self::HEIGHT, imagesy($image));
+ }
+
+ /**
+ * Test a thumbnail in 'common' mode which isn't include in common websites.
+ */
+ public function testThumbnailCommonInvalid()
+ {
+ $this->conf->set('thumbnails.mode', Thumbnailer::MODE_COMMON);
+ $thumb = $this->thumbnailer->get('https://github.com/shaarli/Shaarli/');
+ $this->assertFalse($thumb);