Commit 4d350cdd authored by catch's avatar catch
Browse files

Issue #3249082 by Lendude, bbrala, quietone: Views FieldPluginBaseTest has...

Issue #3249082 by Lendude, bbrala, quietone: Views FieldPluginBaseTest has methods with unused arguments

(cherry picked from commit c044cc2c)
parent 1004c40d
Loading
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -315,14 +315,12 @@ public function testRenderNoResult() {
   * @dataProvider providerTestRenderAsLinkWithPathAndOptions
   * @covers ::renderAsLink
   */
  public function testRenderAsLinkWithPathAndOptions($path, $alter, $link_html, $final_html = NULL) {
  public function testRenderAsLinkWithPathAndOptions($path, $alter, $final_html) {
    $alter += [
      'make_link' => TRUE,
      'path' => $path,
    ];

    $final_html = $final_html ?? $link_html;

    $this->setUpUrlIntegrationServices();
    $this->setupDisplayWithEmptyArgumentsAndFields();
    $field = $this->setupTestField(['alter' => $alter]);
@@ -342,7 +340,7 @@ public function testRenderAsLinkWithPathAndOptions($path, $alter, $link_html, $f
  public function providerTestRenderAsLinkWithPathAndOptions() {
    $data = [];
    // Simple path with default options.
    $data[] = ['test-path', [], [], '<a href="/test-path">value</a>'];
    $data[] = ['test-path', [], '<a href="/test-path">value</a>'];
    // Add a fragment.
    $data[] = ['test-path', ['fragment' => 'test'], '<a href="/test-path#test">value</a>'];
    // Rel attributes.
@@ -371,14 +369,14 @@ public function providerTestRenderAsLinkWithPathAndOptions() {
    $entity_type_id = 'node';
    $data[] = ['test-path', ['entity_type' => $entity_type_id], '<a href="/test-path">value</a>'];
    // prefix
    $data[] = ['test-path', ['prefix' => 'test_prefix'], '<a href="/test-path">value</a>', 'test_prefix<a href="/test-path">value</a>'];
    $data[] = ['test-path', ['prefix' => 'test_prefix'], 'test_prefix<a href="/test-path">value</a>'];
    // suffix.
    $data[] = ['test-path', ['suffix' => 'test_suffix'], '<a href="/test-path">value</a>', '<a href="/test-path">value</a>test_suffix'];
    $data[] = ['test-path', ['suffix' => 'test_suffix'], '<a href="/test-path">value</a>test_suffix'];

    // External URL.
    $data[] = ['https://www.example.com', [], [], '<a href="https://www.example.com">value</a>'];
    $data[] = ['www.example.com', ['external' => TRUE], [], '<a href="http://www.example.com">value</a>'];
    $data[] = ['', ['external' => TRUE], [], 'value'];
    $data[] = ['https://www.example.com', [], '<a href="https://www.example.com">value</a>'];
    $data[] = ['www.example.com', ['external' => TRUE], '<a href="http://www.example.com">value</a>'];
    $data[] = ['', ['external' => TRUE], 'value'];

    return $data;
  }
@@ -389,14 +387,12 @@ public function providerTestRenderAsLinkWithPathAndOptions() {
   * @dataProvider providerTestRenderAsLinkWithUrlAndOptions
   * @covers ::renderAsLink
   */
  public function testRenderAsLinkWithUrlAndOptions(Url $url, $alter, Url $expected_url, $url_path, Url $expected_link_url, $link_html, $final_html = NULL) {
  public function testRenderAsLinkWithUrlAndOptions(Url $url, $alter, Url $expected_url, $url_path, Url $expected_link_url, $final_html) {
    $alter += [
      'make_link' => TRUE,
      'url' => $url,
    ];

    $final_html = $final_html ?? $link_html;

    $this->setUpUrlIntegrationServices();
    $this->setupDisplayWithEmptyArgumentsAndFields();
    $field = $this->setupTestField(['alter' => $alter]);
@@ -516,11 +512,11 @@ public static function providerTestRenderAsLinkWithUrlAndOptions() {

    // Test prefix.
    $url = Url::fromRoute('test_route');
    $data[] = [$url, ['prefix' => 'test_prefix'], clone $url, '/test-path', clone $url, '<a href="/test-path">value</a>', 'test_prefix<a href="/test-path">value</a>'];
    $data[] = [$url, ['prefix' => 'test_prefix'], clone $url, '/test-path', clone $url, 'test_prefix<a href="/test-path">value</a>'];

    // Test suffix.
    $url = Url::fromRoute('test_route');
    $data[] = [$url, ['suffix' => 'test_suffix'], clone $url, '/test-path', clone $url, '<a href="/test-path">value</a>', '<a href="/test-path">value</a>test_suffix'];
    $data[] = [$url, ['suffix' => 'test_suffix'], clone $url, '/test-path', clone $url, '<a href="/test-path">value</a>test_suffix'];

    return $data;
  }