function test_config_value() { // default value $this->assertFalse(config_value('BIBTEXBROWSER_NO_DEFAULT')); // setting to true bibtexbrowser_configure('BIBTEXBROWSER_NO_DEFAULT', true); $this->assertTrue(config_value('BIBTEXBROWSER_NO_DEFAULT')); ob_start(); default_message(); $this->assertEquals('', ob_get_flush()); // setting to false bibtexbrowser_configure('BIBTEXBROWSER_NO_DEFAULT', false); $this->assertFalse(config_value('BIBTEXBROWSER_NO_DEFAULT')); ob_start(); default_message(); $this->assertContains('Congratulations', ob_get_flush()); }
/** @nodoc */ function default_message() { if (config_value('BIBTEXBROWSER_NO_DEFAULT') == true) { return; } ?> <div id="bibtexbrowser_message"> Congratulations! bibtexbrowser is correctly installed!<br/> Now you have to pass the name of the bibtex file as parameter (e.g. bibtexbrowser.php?bib=mybib.php)<br/> You may browse:<br/> <?php foreach (glob("*.bib") as $bibfile) { $url = "?bib=" . $bibfile; echo '<a href="' . $url . '" rel="nofollow">' . $bibfile . '</a><br/>'; } echo "</div>"; }