You are here

public function PrintableCssIncludeTest::testGetCssIncludePath in Printer and PDF versions for Drupal 8+ 2.x

Same name and namespace in other branches
  1. 8 tests/src/Unit/PrintableCssIncludeTest.php \Drupal\Tests\printable\Unit\PrintableCssIncludeTest::testGetCssIncludePath()

Tests getting the plugin label from the plugin.

@covers PrintableCssInclude::getCssIncludePath

@dataProvider providerTestGetCssIncludePath

File

tests/src/Unit/PrintableCssIncludeTest.php, line 33

Class

PrintableCssIncludeTest
Tests the print format plugin.

Namespace

Drupal\Tests\printable\Unit

Code

public function testGetCssIncludePath($include, $expected) {
  $config = $this
    ->getConfigFactoryStub([
    'printable.settings' => [
      'css_include' => $include,
    ],
  ]);
  $theme_info = [
    'bartik' => new \stdClass(),
  ];
  $theme_info['bartik']->uri = 'core/themes/bartik/bartik.info.yml';
  $theme_handler = $this
    ->getMockBuilder('Drupal\\Core\\Extension\\ThemeHandlerInterface')
    ->disableOriginalConstructor()
    ->getMock();
  $theme_handler
    ->expects($this
    ->any())
    ->method('listInfo')
    ->will($this
    ->returnValue($theme_info));
  $css_include = new PrintableCssInclude($config, $theme_handler);
  $this
    ->assertEquals($expected, $css_include
    ->getCssIncludePath());
}