<commit_before><commit_msg>new test (finish PEAR_Command tests)<commit_after>--TEST--
PEAR_Command::setFrontendClass()
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
    echo 'skip';
}
?>
--FILE--
<?php
error_reporting(E_ALL);
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$err = &PEAR_Command::setFrontendClass('foo_gobrmlble');
$phpunit->assertErrors(array(
    array('package' => 'PEAR_Error', 'message' => 'no such class: foo_gobrmlble')
), 'invalid');
class invalid_frontend {
    function noUserConfirm()
    {
    }
}
$err = &PEAR_Command::setFrontendClass('invalid_frontend');
$phpunit->assertErrors(array(
    array('package' => 'PEAR_Error', 'message' => 'not a frontend class: invalid_frontend')
), 'not a frontend');
$ok = &PEAR_Command::setFrontendClass('PEAR_Frontend_CLI');
$phpunit->assertIsa('PEAR_Frontend_CLI', $ok, 'ok');
echo 'tests done';
?>
--EXPECT--
tests done
{'fraction_non_alphanumeric': 0.18102508178844057, 'fraction_numerical': 0.0, 'mean_word_length': 6.344, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2702', 'n_tokens_mistral': 336, 'n_tokens_neox': 332, 'n_words': 59}