8 protected function setUp() {
26 if ( !is_string( $xmp ) || !is_array( $expected ) ) {
27 throw new Exception(
"Invalid data provided to " . __METHOD__ );
30 $reader->
parse( $xmp );
31 $this->assertEquals( $expected, $reader->getResults(), $info, 0.0000000001 );
35 $xmpPath = __DIR__ .
'/../../data/xmp/';
43 array(
'1',
'parseType=Resource test' ),
44 array(
'2',
'Structure with mixed attribute and element props' ),
45 array(
'3',
'Extra qualifiers (that should be ignored)' ),
46 array(
'3-invalid',
'Test ignoring qualifiers that look like normal props' ),
47 array(
'4',
'Flash as qualifier' ),
48 array(
'5',
'Flash as qualifier 2' ),
49 array(
'6',
'Multiple rdf:Description' ),
50 array(
'7',
'Generic test of several property types' ),
51 array(
'flash',
'Test of Flash property' ),
52 array(
'invalid-child-not-struct',
'Test child props not in struct or ignored' ),
53 array(
'no-recognized-props',
'Test namespace and no recognized props' ),
54 array(
'no-namespace',
'Test non-namespaced attributes are ignored' ),
55 array(
'bag-for-seq',
"Allow bag's instead of seq's. (bug 27105)" ),
56 array(
'utf16BE',
'UTF-16BE encoding' ),
57 array(
'utf16LE',
'UTF-16LE encoding' ),
58 array(
'utf32BE',
'UTF-32BE encoding' ),
59 array(
'utf32LE',
'UTF-32LE encoding' ),
60 array(
'xmpExt',
'Extended XMP missing second part' ),
61 array(
'gps',
'Handling of exif GPS parameters in XMP' ),
64 foreach ( $xmpFiles
as $file ) {
65 $xmp = file_get_contents( $xmpPath .
$file[0] .
'.xmp' );
70 include $xmpPath .
$file[0] .
'.result.php';
86 $xmpPath = __DIR__ .
'/../../data/xmp/';
87 $standardXMP = file_get_contents( $xmpPath .
'xmpExt.xmp' );
88 $extendedXMP = file_get_contents( $xmpPath .
'xmpExt2.xmp' );
90 $md5sum =
'28C74E0AC2D796886759006FBE2E57B7';
91 $length = pack(
'N', strlen( $extendedXMP ) );
92 $offset = pack(
'N', 0 );
93 $extendedPacket = $md5sum . $length . $offset . $extendedXMP;
96 $reader->parse( $standardXMP );
97 $reader->parseExtended( $extendedPacket );
98 $actual = $reader->getResults();
102 'DigitalZoomRatio' =>
'0/10',
108 $this->assertEquals( $expected, $actual );
118 $xmpPath = __DIR__ .
'/../../data/xmp/';
119 $standardXMP = file_get_contents( $xmpPath .
'xmpExt.xmp' );
120 $extendedXMP = file_get_contents( $xmpPath .
'xmpExt2.xmp' );
122 $md5sum =
'28C74E0AC2D796886759006FBE2E57B9';
123 $length = pack(
'N', strlen( $extendedXMP ) );
124 $offset = pack(
'N', 0 );
125 $extendedPacket = $md5sum . $length . $offset . $extendedXMP;
128 $reader->parse( $standardXMP );
129 $reader->parseExtended( $extendedPacket );
130 $actual = $reader->getResults();
134 'DigitalZoomRatio' =>
'0/10',
139 $this->assertEquals( $expected, $actual );
149 $xmpPath = __DIR__ .
'/../../data/xmp/';
150 $standardXMP = file_get_contents( $xmpPath .
'xmpExt.xmp' );
151 $extendedXMP = file_get_contents( $xmpPath .
'xmpExt2.xmp' );
153 $md5sum =
'28C74E0AC2D796886759006FBE2E57B7';
154 $length = pack(
'N', strlen( $extendedXMP ) );
155 $offset = pack(
'N', 2048 );
156 $extendedPacket = $md5sum . $length . $offset . $extendedXMP;
159 $reader->parse( $standardXMP );
160 $reader->parseExtended( $extendedPacket );
161 $actual = $reader->getResults();
165 'DigitalZoomRatio' =>
'0/10',
170 $this->assertEquals( $expected, $actual );