You are here

function BiblioCiteProcTestCase::testRenderLink in Bibliography Module 7.3

Test rendering link as label.

File

tests/CiteProc.test, line 48

Class

BiblioCiteProcTestCase
Test Render of CiteProc style plugin.

Code

function testRenderLink() {
  $biblio = $this->biblio;
  $style_name = 'citeproc';
  $options = array(
    'label_as_link' => FALSE,
  );
  $output = $biblio
    ->getText($style_name, $options);
  $matches = array();
  preg_match('/<a href=".*Handbook Of Mathematical Functions With Formulas, Graphs, And Mathematical Tables<\\/a>/i', $output, $matches);
  $this
    ->assertFalse($matches, 'CiteProc is render without label as link.');
  $options = array(
    'label_as_link' => TRUE,
  );
  $output = $biblio
    ->getText($style_name, $options);
  $matches = array();
  preg_match('/<a href=".*Handbook Of Mathematical Functions With Formulas, Graphs, And Mathematical Tables<\\/a>/i', $output, $matches);
  $this
    ->assertTrue($matches[0], 'CiteProc is render with label as link.');
}