MicroTimeTest.php 896 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * The RandomLib library for securely generating random numbers and strings in PHP
  4. *
  5. * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
  6. * @copyright 2011 The Authors
  7. * @license http://www.opensource.org/licenses/mit-license.html MIT License
  8. * @version Build @@version@@
  9. */
  10. namespace RandomLib\Source;
  11. use SecurityLib\Strength;
  12. class MicroTimeTest extends AbstractSourceTest
  13. {
  14. protected static function getExpectedStrength()
  15. {
  16. return new Strength(Strength::VERYLOW);
  17. }
  18. /**
  19. * Test the initialization of the static counter (!== 0)
  20. */
  21. public function testCounterNotNull()
  22. {
  23. $class = static::getTestedClass();
  24. $rand = new $class();
  25. $reflection_class = new \ReflectionClass($class);
  26. $static = $reflection_class->getStaticProperties();
  27. $this->assertTrue($static['counter'] !== 0);
  28. }
  29. }