/** * Tests the alert method. * * @return void * * @since 3.1 */ public function testAlert() { // Initialise the alert script JHtmlBootstrap::alert(); // 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'], "(function(\$){\n\t\t\t\t\$('.alert').alert();\n\t\t\t\t})(jQuery);", 'Verify that the alert script is initialised'); }