'bomb-1GiB', 'shouldBeConsideredAsABomb' => true,], ['file' => 'bomb-4GiB', 'shouldBeConsideredAsABomb' => true,], ['file' => 'chocolate_factory_1539704410', 'shouldBeConsideredAsABomb' => false,], ['file' => 'planets_and_moons_1539704402', 'shouldBeConsideredAsABomb' => false,], ]; } /** * @dataProvider zipBombCandidatesProvider * @param string $file * @param bool $shouldBeConsideredAsABomb * @throws \common_Exception */ public function testCheckWhetherArchiveIsBomb($file, $shouldBeConsideredAsABomb) { $bombCandidatesSampleDir = __DIR__ . '/../samples/zipBombCandidates/'; $archiveObj = new \ZipArchive(); $openingResult = $archiveObj->open($bombCandidatesSampleDir . $file . '.zip'); $this->assertTrue($openingResult); $result = \tao_helpers_File::checkWhetherArchiveIsBomb($archiveObj); $this->assertEquals($shouldBeConsideredAsABomb, $result); } }