Пример #1
0
 /**
  * Test open() method
  *
  * @param array $fileData
  * @param string|bool|null $exception
  * @param string $limit
  * @dataProvider filesProvider
  */
 public function testOpen($fileData, $exception, $limit)
 {
     self::$memoryLimit = $limit;
     self::$imageData = $fileData;
     if (!empty($exception)) {
         $this->setExpectedException($exception);
     }
     $this->adapter->open('file');
 }
Пример #2
0
 /**
  * Test if open() method resets cached fileType
  *
  */
 public function testOpenDifferentTypes()
 {
     self::$imageData = [0 => 480, 1 => 320, 2 => 2, 3 => 'width="480" height="320"', 'bits' => 8, 'channels' => 3, 'mime' => 'image/jpeg'];
     $this->adapter->open('file');
     $type1 = $this->adapter->getImageType();
     self::$imageData = [0 => 480, 1 => 320, 2 => 3, 3 => 'width="480" height="320"', 'bits' => 8, 'channels' => 3, 'mime' => 'image/png'];
     $this->adapter->open('file');
     $type2 = $this->adapter->getImageType();
     $this->assertNotEquals($type1, $type2);
 }