Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (85 sloc) 3.12 KB
--TEST--
PEAR_Channelfile->getSsl()
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
echo 'skip';
}
?>
--FILE--
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$chf->fromXmlString($first = '<?xml version="1.0" encoding="ISO-8859-1" ?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/channel-1.0.xsd">
<name>pear.php.net</name>
<suggestedalias>pear</suggestedalias>
<summary>PHP Extension and Application Repository</summary>
<servers>
<primary>
<xmlrpc>
<function version="1.0">logintest</function>
<function version="1.0">package.listLatestReleases</function>
<function version="1.0">package.listAll</function>
<function version="1.0">package.info</function>
<function version="1.0">package.getDownloadURL</function>
<function version="1.0">channel.listAll</function>
<function version="1.0">channel.update</function>
</xmlrpc>
</primary>
<mirror host="blah">
<xmlrpc>
<function version="1.0">logintest</function>
<function version="1.0">package.listLatestReleases</function>
<function version="1.0">package.listAll</function>
<function version="1.0">package.info</function>
<function version="1.0">package.getDownloadURL</function>
<function version="1.0">channel.listAll</function>
<function version="1.0">channel.update</function>
</xmlrpc>
</mirror>
</servers>
</channel>');
$phpt->assertTrue($chf->validate(), 'default parse');
$phpt->assertFalse($chf->getSsl(), 'main 1');
$phpt->assertFalse($chf->getSsl('blah'), 'mirror 1');
$chf->fromXmlString($first = '<?xml version="1.0" encoding="ISO-8859-1" ?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/channel-1.0.xsd">
<name>pear.php.net</name>
<suggestedalias>pear</suggestedalias>
<summary>PHP Extension and Application Repository</summary>
<servers>
<primary ssl="yes">
<xmlrpc>
<function version="1.0">logintest</function>
<function version="1.0">package.listLatestReleases</function>
<function version="1.0">package.listAll</function>
<function version="1.0">package.info</function>
<function version="1.0">package.getDownloadURL</function>
<function version="1.0">channel.listAll</function>
<function version="1.0">channel.update</function>
</xmlrpc>
</primary>
<mirror host="blah" ssl="yes">
<xmlrpc>
<function version="1.0">logintest</function>
<function version="1.0">package.listLatestReleases</function>
<function version="1.0">package.listAll</function>
<function version="1.0">package.info</function>
<function version="1.0">package.getDownloadURL</function>
<function version="1.0">channel.listAll</function>
<function version="1.0">channel.update</function>
</xmlrpc>
</mirror>
</servers>
</channel>');
$phpt->assertTrue($chf->validate(), '2 parse');
$phpt->assertTrue($chf->getSsl(), 'main 2');
$phpt->assertTrue($chf->getSsl('blah'), 'mirror 2');
echo 'tests done';
?>
--EXPECT--
tests done
Something went wrong with that request. Please try again.