assertEqual(sizeof($ifd->getIterator()), 0); $desc = new PelEntryAscii(PelTag::IMAGE_DESCRIPTION, 'Hello?'); $date = new PelEntryTime(PelTag::DATE_TIME, 12345678); $ifd->addEntry($desc); $ifd->addEntry($date); $this->assertEqual(sizeof($ifd->getIterator()), 2); $entries = array(); foreach ($ifd as $tag => $entry) { $entries[$tag] = $entry; } $this->assertIdentical($entries[PelTag::IMAGE_DESCRIPTION], $desc); $this->assertIdentical($entries[PelTag::DATE_TIME], $date); } function testArrayAccess() { $ifd = new PelIfd(PelIfd::IFD0); $this->assertEqual(sizeof($ifd->getIterator()), 0); $desc = new PelEntryAscii(PelTag::IMAGE_DESCRIPTION, 'Hello?'); $date = new PelEntryTime(PelTag::DATE_TIME, 12345678); $ifd[] = $desc; $ifd[] = $date; $this->assertIdentical($ifd[PelTag::IMAGE_DESCRIPTION], $desc); $this->assertIdentical($ifd[PelTag::DATE_TIME], $date); unset($ifd[PelTag::DATE_TIME]); $this->assertFalse(isset($ifd[PelTag::DATE_TIME])); } } ?>