Skip to content

Commit

Permalink
Check also meta/special files
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed May 4, 2016
1 parent 029db61 commit 5cbbf94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CHM.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
6 changes: 4 additions & 2 deletions test/tests/ParseSampleFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 5cbbf94

Please sign in to comment.