You are here

public function UriSignerTest::testCheck in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Tests/UriSignerTest.php \Symfony\Component\HttpKernel\Tests\UriSignerTest::testCheck()

File

vendor/symfony/http-kernel/Tests/UriSignerTest.php, line 26

Class

UriSignerTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

public function testCheck() {
  $signer = new UriSigner('foobar');
  $this
    ->assertFalse($signer
    ->check('http://example.com/foo?_hash=foo'));
  $this
    ->assertFalse($signer
    ->check('http://example.com/foo?foo=bar&_hash=foo'));
  $this
    ->assertFalse($signer
    ->check('http://example.com/foo?foo=bar&_hash=foo&bar=foo'));
  $this
    ->assertTrue($signer
    ->check($signer
    ->sign('http://example.com/foo')));
  $this
    ->assertTrue($signer
    ->check($signer
    ->sign('http://example.com/foo?foo=bar')));
  $this
    ->assertTrue($signer
    ->sign('http://example.com/foo?foo=bar&bar=foo') === $signer
    ->sign('http://example.com/foo?bar=foo&foo=bar'));
}