Neos\Flow\Security\Cryptography\HashService::injectSettings PHP Method

injectSettings() public method

Injects the settings of the package this controller belongs to.
public injectSettings ( array $settings ) : void
$settings array Settings container of the current package
return void
    public function injectSettings(array $settings)
    {
        $this->strategySettings = $settings['security']['cryptography']['hashingStrategies'];
    }

Usage Example

 /**
  * @test
  * @expectedException \Neos\Flow\Security\Exception\MissingConfigurationException
  */
 public function hashPasswordThrowsExceptionIfNoDefaultHashingStrategyIsConfigured()
 {
     $mockSettings = ['security' => ['cryptography' => ['hashingStrategies' => ['TestStrategy' => TestHashingStrategy::class]]]];
     $this->hashService->injectSettings($mockSettings);
     $this->hashService->hashPassword('myTestPassword');
 }