diff --git a/src/CHM.php b/src/CHM.php index c1eab73..7d65a69 100644 --- a/src/CHM.php +++ b/src/CHM.php @@ -162,7 +162,7 @@ public function getEntries($type = null) } $result = array(); foreach ($this->entries as $entry) { - if (($entry->getType() && $type) !== 0) { + if (($entry->getType() & $type) !== 0) { $result[] = $entry; } } diff --git a/test/tests/ParseSampleFilesTest.php b/test/tests/ParseSampleFilesTest.php index ffb27be..0d2635c 100644 --- a/test/tests/ParseSampleFilesTest.php +++ b/test/tests/ParseSampleFilesTest.php @@ -50,8 +50,10 @@ public function testFindAllFiles(SampleData $sampleData) { $chm = $sampleData->getCHM(); $foundFiles = array(); - foreach ($chm->getEntries(Entry::TYPE_FILE) as $entry) { - $foundFiles[] = $entry->getPath(); + foreach ($chm->getEntries(-1 & ~Entry::TYPE_DIRECTORY) as $entry) { + if (strpos($entry->getPath(), ':') === false) { + $foundFiles[] = $entry->getPath(); + } } $extraFoundFiles = array_diff($foundFiles, $sampleData->getExtractedFiles()); $this->assertEmpty($extraFoundFiles, 'Some extra files found');