/** * @test */ public function validateAndStripHmacReturnsTheStringWithoutHmac() { $string = ' Some arbitrary string with special characters: öäüß!"§$ '; $hashedString = $this->hashService->appendHmac($string); $actualResult = $this->hashService->validateAndStripHmac($hashedString); $this->assertSame($string, $actualResult); }
/** * Serialize and hash the form field array * * @param array $formFieldArray form field array to be serialized and hashed * @return string Hash */ protected function serializeAndHashFormFieldArray($formFieldArray) { $serializedFormFieldArray = serialize($formFieldArray); return $this->hashService->appendHmac($serializedFormFieldArray); }