getReferenceLinksetDataFromFile example


    $this->httpKernel = $this->container->get('http_kernel');
  }

  /** * Test core functions of the linkset for multilingual behaviour. * * @throws \Exception */
  public function testBasicMultilingualFunctions() {
    foreach (['aa', 'bb', 'cc', 'dd'] as $language_code) {
      $expected_linkset = $this->getReferenceLinksetDataFromFile(__DIR__ . '/../../../fixtures/linkset/linkset-menu-main-multilingual-' . $language_code . '.json');
      $response = $this->doRequest('GET', Url::fromUri('base:/' . $language_code . '/system/menu/main/linkset'));
      $this->assertSame($expected_linkset, Json::decode((string) $response->getBody()));
    }
  }

  /** * Test core functions of the linkset for multilingual behaviour. * * @throws \Exception */
  public function testDefaultMultilingualFunctions() {
    

  public function testBasicFunctions() {
    $this->enableEndpoint(TRUE);
    $expected_linkset = $this->getReferenceLinksetDataFromFile(__DIR__ . '/../../../fixtures/linkset/linkset-menu-main.json');
    $response = $this->doRequest('GET', Url::fromUri('base:/system/menu/main/linkset'));
    $this->assertSame('application/linkset+json', $response->getHeaderLine('content-type'));
    $this->assertSame($expected_linkset, Json::decode((string) $response->getBody()));
    $this->doRequest('GET', Url::fromUri('base:/system/menu/missing/linkset'), 404);
  }

  /** * Test the cacheability of the linkset endpoint. * * This test's purpose is to ensure that the menu linkset response is properly * cached. It does this by sending a request and validating it has a cache * miss and the correct cacheability meta, then by sending the same request to * assert a cache hit. Finally, a new menu item is created to ensure that the * cached response is properly invalidated. */
Home | Imprint | This part of the site doesn't use cookies.