fork download
  1. <?php
  2. namespace Tests\TestHubBundle\Helper;
  3.  
  4. use TestHubBundle\Helper\StringGenerator;
  5.  
  6. class StringGeneratorTest extends \PHPUnit_Framework_TestCase
  7. {
  8. public function testGenerateString()
  9. {
  10. $string = StringGenerator::generateString();
  11. $this->assertTrue(is_string($string));
  12.  
  13. $iterations = 5;
  14. $randoms = [];
  15. for ($i = 0; $i < $iterations; $i++) {
  16. $randoms[] = StringGenerator::generateString();
  17. }
  18. $this->assertEquals($iterations, count(array_unique($randoms)));
  19.  
  20. $string = StringGenerator::generateString();
  21. $this->assertGreaterThan(10, mb_strlen($string));
  22. $this->assertLessThan(100, mb_strlen($string));
  23. }
  24. }
Runtime error #stdin #stdout #stderr 0.03s 52480KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in /home/Zmm1FW/prog.php on line 7