setExpectedException('PHPUnit_Framework_Error', 'The [a@'.PMA_getPHPDocLink('book.' . $ext . '.php').'@Documentation][em]'.$ext.'[/em][/a] extension is missing. Please check your PHP configuration.'); PMA_warnMissingExtension($ext); } function testMissingExtentionFatal(){ $ext = 'php_ext'; $warn = 'The '.$ext.' extension is missing. Please check your PHP configuration.'; ob_start(); PMA_warnMissingExtension($ext, true); $printed = ob_get_contents(); ob_end_clean(); $this->assertGreaterThan(0, strpos($printed, $warn)); } function testMissingExtentionFatalWithExtra(){ $ext = 'php_ext'; $extra = 'Appended Extra String'; $warn = 'The '.$ext.' extension is missing. Please check your PHP configuration.'.' '.$extra; ob_start(); PMA_warnMissingExtension($ext, true, $extra); $printed = ob_get_contents(); ob_end_clean(); $this->assertGreaterThan(0, strpos($printed, $warn)); } function testMissingExtentionWithExtra(){ $ext = 'php_ext'; $extra = 'Appended Extra String'; $this->setExpectedException('PHPUnit_Framework_Error', 'The [a@'.PMA_getPHPDocLink('book.' . $ext . '.php').'@Documentation][em]'.$ext.'[/em][/a] extension is missing. Please check your PHP configuration.'.' '.$extra); PMA_warnMissingExtension($ext, false, $extra); $this->assertTrue(true); } }