createMemoryParser(hex2bin(self::TEST_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(8208, $block->getFilePos()); $this->assertEquals(1048576, $block->getCompressedSize()); $this->assertEquals(1048576, $block->getSize()); $this->assertEquals(0, $block->getFlags()); } const TEST_IMPLODED_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00010000"; /* flags */ public function testImplodedFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_IMPLODED_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isImploded()); } const TEST_COMPRESSED_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00020000"; /* flags */ public function testCompressedFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_COMPRESSED_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isCompressed()); } const TEST_ENCRYPTED_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00000100"; /* flags */ public function testEncryptedFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_ENCRYPTED_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isEncrypted()); } const TEST_FIX_KEY_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00000200"; /* flags */ public function testKeyBasedOnPositionFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_FIX_KEY_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isKeyBasedOnPosition()); } const TEST_PATCHED_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00001000"; /* flags */ public function testPatchedFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_PATCHED_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isPatched()); } const TEST_SINGLE_UNIT_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00000001"; /* flags */ public function testSingleUnitFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_SINGLE_UNIT_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isSingleUnit()); } const TEST_DELETE_MARKER_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00000002"; /* flags */ public function testDeleteMarkerFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_DELETE_MARKER_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isDeleted()); } const TEST_CHECKSUMED_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00000004"; /* flags */ public function testChecksumedFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_CHECKSUMED_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isChecksumed()); } const TEST_EXISTS_BLOCK_DATA = "10200000". /* file position */ "00001000". /* compressed size */ "00001000". /* size */ "00000080"; /* flags */ public function testExistsFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_EXISTS_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isExisting()); } }