示例#1
0
 /**
  * @covers CryptLib\Random\Factory::getLowStrengthGenerator
  * @covers CryptLib\Random\Factory::getGenerator
  * @covers CryptLib\Random\Factory::findMixer
  */
 public function testGetLowStrengthGenerator()
 {
     $factory = new Factory();
     $generator = $factory->getLowStrengthGenerator();
     $this->assertTrue($generator instanceof CryptLib\Random\Generator);
     $mixer = call_user_func(array(get_class($generator->getMixer()), 'getStrength'));
     $this->assertTrue($mixer->compare(new Strength(Strength::LOW)) <= 0);
     $compare = new Strength(Strength::LOW);
     foreach ($generator->getSources() as $source) {
         $strength = call_user_func(array(get_class($source), 'getStrength'));
         $this->assertTrue($strength->compare($compare) >= 0);
     }
 }