bf283772709f006fecc71cf7eb506fab738cd540
[yaffs-website] / vendor / lsolesen / pel / test / Bug1730993Test.php
1 <?php
2
3 /**
4  * PEL: PHP Exif Library.
5  * A library with support for reading and
6  * writing all Exif headers in JPEG and TIFF images using PHP.
7  *
8  * Copyright (C) 2004, 2006, 2007 Martin Geisler.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program in the file COPYING; if not, write to the
22  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA 02110-1301 USA
24  */
25
26 use lsolesen\pel\PelJpeg;
27
28 class Bug1730993Test extends \PHPUnit_Framework_TestCase
29 {
30     function testThisDoesNotWorkAsExpected()
31     {
32         $tmpfile = dirname(__FILE__) . '/images/bug1730993_tmp.jpg';
33         $bigfile = dirname(__FILE__) . '/images/bug1730993_large.jpg';
34         // TODO: Should not throw exception
35         $this->markTestIncomplete(
36           'This test fails and should be fixed.'
37         );
38         try {
39             require_once 'PelJpeg.php';
40             $jpeg = new PelJpeg($tmpfile); // the error occurs here
41             $exif = $jpeg->getExif();
42             if ($exif !== null) {
43                 $jpeg1 = new PelJpeg($bigfile);
44                 $jpeg1->setExif($exif);
45                 file_put_contents($bigfile, $jpeg1->getBytes());
46             }
47         } catch (Exception $e) {
48             $this->fail('Test should not throw exception: ' . $e->getMessage());
49         }
50     }
51 }