setupDefaultExpectations example

$this->sessionMetadata->expects($this->any())
      ->method('getCsrfTokenSeed')
      ->willReturn($seed);
  }

  /** * Tests CsrfTokenGenerator::get(). * * @covers ::get */
  public function testGet() {
    $this->setupDefaultExpectations();

    $this->assertIsString($this->generator->get());
    $this->assertNotSame($this->generator->get()$this->generator->get($this->randomMachineName()));
    $this->assertNotSame($this->generator->get($this->randomMachineName())$this->generator->get($this->randomMachineName()));
  }

  /** * Tests that a new token seed is generated upon first use. * * @covers ::get */
  
Home | Imprint | This part of the site doesn't use cookies.