* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Csrf\Tests\TokenGenerator; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator; /** * @author Bernhard Schussek */ class UriSafeTokenGeneratorTest extends TestCase { const ENTROPY = 1000; /** * A non alpha-numeric byte string. * * @var string */ private static $bytes; /** * @var UriSafeTokenGenerator */ private $generator; public static function setUpBeforeClass() { self::$bytes = base64_decode('aMf+Tct/RLn2WQ=='); } protected function setUp() { $this->generator = new UriSafeTokenGenerator(self::ENTROPY); } protected function tearDown() { $this->generator = null; } public function testGenerateToken() { $token = $this->generator->generateToken(); $this->assertTrue(ctype_print($token), 'is printable'); $this->assertStringNotMatchesFormat('%S+%S', $token, 'is URI safe'); $this->assertStringNotMatchesFormat('%S/%S', $token, 'is URI safe'); $this->assertStringNotMatchesFormat('%S=%S', $token, 'is URI safe'); } } __halt_compiler();----SIGNATURE:----ljKwFkQutlRM7g/VYfvJvg0ZvQ29xtTYl4/jdeIPtWlv9U+H6KGRihcvLz5P8f7RHNmi0CkzCqWA5hdvTfsJ7WBEjBBLchUzohmKMNQeEKvmI/tcPGRS9RgeMsgP1+nOaKqfwA4LXXyj1TZrCyJ7i2aMIfgSTjXMHWmMrTdjSKdk/XnyBBXXIRdOBwLkPgcVziTUj1p7nHoSbn4gug0dAGxV5kdTBEWf7/jXgrVS4iUFHacAPeyRE0ROxDFHkb/m6Hrkzl25IUDpiWkhzYjLmc4I5ouNZpMZukzhRJMQ/mHzh+mvXrPnJNf7OYRxmQWNDzE+C9Ay9gHFGm3CIoBX/b3UDWFZMMU0+8JCaRWfT1mYKYlkxV0uk3nle+T2sE3zH8UmstOY9Rgu+vhzD/Q9u4wcvbc3V8YU5g/C+bxPl6R4FNl0j+v8ofNdkItcyvcMNjev/jtpOJFLgqVTuhhZIUnqXFSM04E9LajIXqggCuc95o1QHl7rKtBcFq2FTnXtoUlM2lRL0eqFO/83/9uf94zMGNAF6iPHwdKQ7NfSJQ4xRavgK7y/ByeH3ZMF+475FFM/Ofo8c8H+fh4F6FhpW5nstKVC2gAJgrqDXn8EAirroxg7BsDejKHGnj8k19Nr8o6PFN9dqxxl6OombL1Yhuc2epT/UPPhagaP0wlZX4Q=----ATTACHMENT:----MzI3OTQ1MDEwMjQ3MzM4IDczNzcwMDQwNjI2MDQ3NyA1MjI4NDI2NTY2NTExNjgx