* * 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:----q0LZkbtXvpJ9B35mLwgeyvDL+spYS89vwoUkeIUT2sRHZVXPQOeKuf2aZpL+TKlew2IlbXv0e6j6hv63ZRw7RWFDi01T3MvOFru9nx+iw7OpTuSku37gOBmeNK9PdoC6qsRVD+1wWuF4tEILCJb0m2FniJ2ByGDhJbWSLEZ/k+BzzWn9ww6L4wEXvNJu1H2ng16uLsXtWDa+/RhlqmLVLQVeaqlwBSxM6DfzgSodfCNcnb68B/d4nni8ioJVtWvUhDQ6PudWNmvjF5G+77+qUbt8iSM9LkQZl4XkS+esQd+8nvf8tJt9ZCjnTFYgQ3Ya3lpJViHnVpWt8hlaxBhw4lnxoqw6BZlcPa8P6y4GY/xXBS31fV+koEQx3M45Okv1qFa0DDKDhH9vKWN1SqDnjjeT9e95iGIDVZWQw5O55gR+aWaLAcNfFLhG1PT63w9KT3ekTAuo+oJF27iUtgZrYDaeEajbsP+Dx9WR5pn3NyIFIv8CHTNE+DG2Jj3b5uNMrC/r2roqPklkNbCAUTq/e7fs8re5AGQL5lbUhFStJcPDuyAUHS9d7tY79Ymwfii9n0GWzeian579YRa8QM/poqyefWJs0KM194ghcWZaprHZbEWtPQx1s4fPJehR+u5NQXRc/Sh25qSHR+QQB/apHqHfYLMpk9MlX62rucLPfvo=----ATTACHMENT:----NTcwOTU0NjA1MDkzMDM3NCA0NDQwODA1NDM4MTIzMzY4IDkzODY5MjM5NDIzMzY4NTk=