Example #1
0
 /**
  * Tests the typeahead method.
  *
  * @return  void
  *
  * @since   3.6.0
  */
 public function testTypeahead()
 {
     // Initialise the typeahead script
     JHtmlBootstrap::typeahead();
     // Get the document instance
     $document = JFactory::getDocument();
     $this->assertArrayHasKey('/media/jui/js/bootstrap.min.js', $document->_scripts, 'Verify that the alert method initialises Bootstrap as well');
     $this->assertEquals($document->_script['text/javascript'], 'jQuery(function($){ $(".typeahead").typeahead({"items": 8,"minLength": 1}); });', 'Verify that the typeahead script is initialised');
 }