You are here

public function CDNJSTest::test_convertFiles in Libraries CDN API 7

@covers ::convertFiles()

File

tests/src/Plugin/LibrariesCDN/CDNJSTest.php, line 242
Contains \Drupal\Tests\Libraries_cdn\Plugin\LibrariesCDN\CDNJSTest.

Class

CDNJSTest
@coversDefaultClass \Drupal\libraries_cdn\Plugin\LibrariesCDN\CDNJS

Namespace

Drupal\Tests\libraries_cdn\Plugin\LibrariesCDN

Code

public function test_convertFiles() {
  $this->plugin
    ->setLibrary('jquery');
  $urls = $this->plugin
    ->getConfiguration('urls');
  $files = array(
    'file1.js',
    'file2.js',
  );
  $version = '1.0';
  $data = $this->plugin
    ->convertFiles($files, $version);
  foreach ($data as $key => $file) {
    $url = sprintf($urls['convertFiles'], $this->plugin
      ->getLibrary(), $version) . $files[$key];
    $this
      ->assertEquals($url, $file);
  }
}