* * 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:----pU6ZGkpRme4feix+L+u6T1Kv3lFsI/BlBphQhvQMezhDaeFuCSGoNWGNfFfhfb6mXLmZxH7XNEhQAEE7wQc6hma8h4Ltl62+hNO1uoWHCKmo/55Ci6OWf2h02RfA4hknDK8hbkBqXbx0L0gZ5nVzLGHryNdb987bYopUuGPD8ALVGMnacdShwE13mioccwyILfjDGiA2Q4KcnylvyNXcjwen0SjPTI9fGTVhmK7/Yh/9XeeohzP2jf2VVUiLqqmUpoqNLcmOzCb4gGor559k6UN1Ewh4pd4lntERit+SVQEkDmz4zYdtm3IImyCTWZVhFM4Beqn/QVm5trmY+dgO5jZ3MaKpued35GtXt0vpC9mePeOFWirHwHJQBqJUZi3d/gjDWOsr/NaJkNDnvmxKtdcECRKGvts/cLSsSj+Jn4rQXkh9rmClIEredx7Czu0m1/6CpUmZiL83wTqOrbG3Fy7x9Jh52rgP7oAY0GFZ2EjeXumT41Z2kgxWlcJqzrTlcKuTY/M7IBGMGjKzcKTNDVrUVMPX+rKg5Mu2sXXfiAEp0Hwnh6ko/Pa+uum6NjvpqG3rygA9jbQkFaYO0SnhKK3okOnnINEHSONg/OKEU0YqyWSDGEM9V4Rr9YVvX74Vngr+ctdfssHvBoDLPq+qiFwxdJHK7rr81sTa1aMwods=----ATTACHMENT:----MzgzNDQyNzM2MTA0MTMyNiA4MzE2NTczNjI3MDMyNTI5IDU3OTgzMjA3MjEzOTYzODA=