Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / vendor / lsolesen / pel / test / PelFormatTest.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 Martin Geisler.
9  * Copyright (C) 2017 Johannes Weberhofer
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program in the file COPYING; if not, write to the
23  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
24  * Boston, MA 02110-1301 USA
25  */
26 use PHPUnit\Framework\TestCase;
27 use lsolesen\pel\Pel;
28 use lsolesen\pel\PelFormat;
29
30 class PelFormatTest extends TestCase
31 {
32
33     function testNames()
34     {
35         $pelFormat = new PelFormat();
36         $this->assertEquals($pelFormat::getName(PelFormat::ASCII), 'Ascii');
37         $this->assertEquals($pelFormat::getName(PelFormat::FLOAT), 'Float');
38         $this->assertEquals($pelFormat::getName(PelFormat::UNDEFINED), 'Undefined');
39         $this->assertEquals($pelFormat::getName(100), Pel::fmt('Unknown format: 0x%X', 100));
40     }
41
42     function testDescriptions()
43     {
44         $pelFormat = new PelFormat();
45         $this->assertEquals($pelFormat::getSize(PelFormat::ASCII), 1);
46         $this->assertEquals($pelFormat::getSize(PelFormat::FLOAT), 4);
47         $this->assertEquals($pelFormat::getSize(PelFormat::UNDEFINED), 1);
48         $this->assertEquals($pelFormat::getSize(100), Pel::fmt('Unknown format: 0x%X', 100));
49     }
50 }