<?php
namespace Tests\TestHubBundle\Helper;
use TestHubBundle\Helper\StringGenerator;
class StringGeneratorTest extends \PHPUnit_Framework_TestCase
{
public function testGenerateString()
{
$string = StringGenerator::generateString();
$iterations = 5;
$randoms = [];
for ($i = 0; $i < $iterations; $i++) {
$randoms[] = StringGenerator::generateString();
}
$string = StringGenerator::generateString();
$this->assertGreaterThan(10, mb_strlen($string)); $this->assertLessThan(100, mb_strlen($string)); }
}
PD9waHAKbmFtZXNwYWNlIFRlc3RzXFRlc3RIdWJCdW5kbGVcSGVscGVyOwoKdXNlIFRlc3RIdWJCdW5kbGVcSGVscGVyXFN0cmluZ0dlbmVyYXRvcjsKCmNsYXNzIFN0cmluZ0dlbmVyYXRvclRlc3QgZXh0ZW5kcyBcUEhQVW5pdF9GcmFtZXdvcmtfVGVzdENhc2UKewogICAgcHVibGljIGZ1bmN0aW9uIHRlc3RHZW5lcmF0ZVN0cmluZygpCiAgICB7CiAgICAgICAgJHN0cmluZyA9IFN0cmluZ0dlbmVyYXRvcjo6Z2VuZXJhdGVTdHJpbmcoKTsKICAgICAgICAkdGhpcy0+YXNzZXJ0VHJ1ZShpc19zdHJpbmcoJHN0cmluZykpOwoKICAgICAgICAkaXRlcmF0aW9ucyA9IDU7CiAgICAgICAgJHJhbmRvbXMgPSBbXTsKICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCAkaXRlcmF0aW9uczsgJGkrKykgewogICAgICAgICAgICAkcmFuZG9tc1tdID0gU3RyaW5nR2VuZXJhdG9yOjpnZW5lcmF0ZVN0cmluZygpOwogICAgICAgIH0KICAgICAgICAkdGhpcy0+YXNzZXJ0RXF1YWxzKCRpdGVyYXRpb25zLCBjb3VudChhcnJheV91bmlxdWUoJHJhbmRvbXMpKSk7CgogICAgICAgIG1iX2ludGVybmFsX2VuY29kaW5nKCd1dGY4Jyk7CiAgICAgICAgJHN0cmluZyA9IFN0cmluZ0dlbmVyYXRvcjo6Z2VuZXJhdGVTdHJpbmcoKTsKICAgICAgICAkdGhpcy0+YXNzZXJ0R3JlYXRlclRoYW4oMTAsIG1iX3N0cmxlbigkc3RyaW5nKSk7CiAgICAgICAgJHRoaXMtPmFzc2VydExlc3NUaGFuKDEwMCwgbWJfc3RybGVuKCRzdHJpbmcpKTsKICAgIH0KfQ==