2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test for PMA_warnMissingExtension() from libraries/core.lib.php
5 * PMA_warnMissingExtension warns or fails on missing extension.
7 * @package phpMyAdmin-test
13 require_once 'libraries/core.lib.php';
15 class PMA_warnMissingExtension_test
extends PHPUnit_Framework_TestCase
18 function testMissingExtention(){
20 $this->setExpectedException('PHPUnit_Framework_Error',
21 'The [a@'.PMA_getPHPDocLink('book.' . $ext . '.php').'@Documentation][em]'.$ext.'[/em][/a] extension is missing. Please check your PHP configuration.');
22 PMA_warnMissingExtension($ext);
25 function testMissingExtentionFatal(){
27 $warn = 'The <a href="'.PMA_linkURL(PMA_getPHPDocLink('book.' . $ext . '.php')).'" target="Documentation"><em>'.$ext.'</em></a> extension is missing. Please check your PHP configuration.';
30 PMA_warnMissingExtension($ext,true);
31 $printed = ob_get_contents();
34 $this->assertGreaterThan(0,strpos($printed,$warn));
37 function testMissingExtentionFatalWithExtra(){
39 $extra = 'Appended Extra String';
41 $warn = 'The <a href="'.PMA_linkURL(PMA_getPHPDocLink('book.' . $ext . '.php')).'" target="Documentation"><em>'.$ext.'</em></a> extension is missing. Please check your PHP configuration.'.' '.$extra;
44 PMA_warnMissingExtension($ext,true,$extra);
45 $printed = ob_get_contents();
48 $this->assertGreaterThan(0,strpos($printed,$warn));
51 function testMissingExtentionWithExtra(){
53 $extra = 'Appended Extra String';
54 $this->setExpectedException('PHPUnit_Framework_Error',
55 'The [a@'.PMA_getPHPDocLink('book.' . $ext . '.php').'@Documentation][em]'.$ext.'[/em][/a] extension is missing. Please check your PHP configuration.'.' '.$extra);
56 PMA_warnMissingExtension($ext,false,$extra);
57 $this->assertTrue(true);