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.
8 * Copyright (C) 2004, 2006 Martin Geisler.
9 * Copyright (C) 2017 Johannes Weberhofer
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.
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.
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
26 use PHPUnit\Framework\TestCase;
28 use lsolesen\pel\PelFormat;
30 class PelFormatTest extends TestCase
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));
42 function testDescriptions()
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));