<commit_before>--TEST--
PEAR_Installer->uninstall() (package remains that optionally depends on uninstalled package)
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
    echo 'skip';
}
?>
--FILE--
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
require_once 'PEAR/PackageFile/v1.php';
$package = new PEAR_PackageFile_v1;
$package->setConfig($config);
$package->setLogger($fakelog);
$package->setPackage('foo');
$package->setSummary('foo');
$package->setDescription('foo');
$package->setDate('2004-10-01');
$package->setLicense('PHP License');
$package->setVersion('1.0');
$package->setState('stable');
$package->setNotes('foo');
$package->addFile('/', 'foo.php', array('role' => 'php'));
$package->addMaintainer('lead', 'cellog', '<NAME>', '<EMAIL>');
$reg = &$config->getRegistry();
$reg->addPackage2($package);

$package->resetFilelist();
$package->addFile('/', 'bar.php', array('role' => 'php'));
$package->clearDeps();
$package->addPackageDep('foo', '1.0', 'ge', 'yes');
$package->setPackage('bar');
$reg->addPackage2($package);

$params[] = $reg->getPackage('foo');

$dl = &new PEAR_Installer($fakelog);
$dl->setUninstallPackages($params);
$dl->uninstall('foo');
$phpunit->assertNoErrors('foo');
$phpunit->assertEquals(array(), $fakelog->getLog(), 'foo');
echo 'tests done';
?>
--EXPECT--
tests done<commit_msg>add log message to uninstall of package depended on optionally by others<commit_after>--TEST--
PEAR_Installer->uninstall() (package remains that optionally depends on uninstalled package)
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
    echo 'skip';
}
?>
--FILE--
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
require_once 'PEAR/PackageFile/v1.php';
$package = new PEAR_PackageFile_v1;
$package->setConfig($config);
$package->setLogger($fakelog);
$package->setPackage('foo');
$package->setSummary('foo');
$package->setDescription('foo');
$package->setDate('2004-10-01');
$package->setLicense('PHP License');
$package->setVersion('1.0');
$package->setState('stable');
$package->setNotes('foo');
$package->addFile('/', 'foo.php', array('role' => 'php'));
$package->addMaintainer('lead', 'cellog', '<NAME>', '<EMAIL>');
$reg = &$config->getRegistry();
$reg->addPackage2($package);

$package->resetFilelist();
$package->addFile('/', 'bar.php', array('role' => 'php'));
$package->clearDeps();
$package->addPackageDep('foo', '1.0', 'ge', 'yes');
$package->setPackage('bar');
$reg->addPackage2($package);

$params[] = $reg->getPackage('foo');

$dl = &new PEAR_Installer($fakelog);
$dl->setUninstallPackages($params);
$dl->uninstall('foo');
$phpunit->assertNoErrors('foo');
$phpunit->assertEquals( array (
  0 => 
  array (
    0 => 'pear/bar (version >= 1.0) can be optionally used by installed package "pear/foo"',
    1 => true,
  ),
 )
, $fakelog->getLog(), 'foo');
echo 'tests done';
?>
--EXPECT--
tests done
{'fraction_non_alphanumeric': 0.23696027633851469, 'fraction_numerical': 0.012780656303972366, 'mean_word_length': 6.934246575342466, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 73, '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': '2763214', 'n_tokens_mistral': 1029, 'n_tokens_neox': 1007, 'n_words': 183}