public function testIsSupported()
 {
     $generator = new MtRandSaltGenerator();
     $this->assertTrue($generator->isSupported());
 }
Пример #2
0
 /**
  * Generates a new salt.
  *
  * @return string A new salt.
  */
 public function generateSalt()
 {
     foreach ($this->saltGenerators as $saltGenerator) {
         if ($saltGenerator->isSupported()) {
             return $saltGenerator->generateSalt();
         }
     }
     $fallback = new MtRandSaltGenerator();
     return $fallback->generateSalt();
 }