MachineNameController example

/** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    // Create the machine name controller.     $this->tokenGenerator = $this->prophesize(CsrfTokenGenerator::class);
    $this->tokenGenerator->validate(Argument::cetera())->will(function D$args) {
      return $args[0] === 'token-' . $args[1];
    });

    $this->machineNameController = new MachineNameController(new PhpTransliteration()$this->tokenGenerator->reveal());
  }

  /** * Data provider for testMachineNameController(). * * @see testMachineNameController() * * @return array * An array containing: * - An array of request parameters. * - The expected content of the JSONresponse. */
Home | Imprint | This part of the site doesn't use cookies.