svn: /pear2/Pyrus/trunk/ src/Pyrus/Config.php tests/Installer/install.remote.signedpackage.phpt tests/RemoteCategories/exceptions.phpt tests/RemoteCategory/arrayaccess.phpt tests/RemotePackage/invalidcert.phpt tests/RemotePackage/wrongemailcert.phpt tests/RemotePackages/singlerelease.phpt tests/XMLParser/recursivetag.phpt tests/XMLWriter/empty.phpt
[email protected] (Helgi Þormar Þorbjörnsson) Sat, 18 Sep 2010 13:43:07 +0000
| Newsgroups | php.pear.cvs,php.pear.core |
|---|---|
| Message-ID | <[email protected]> |
dufuz Sat, 18 Sep 2010 13:43:07 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=303499
Log:
Bit of cosmetics and clean ups. Skip a broken test
Changed paths:
U pear2/Pyrus/trunk/src/Pyrus/Config.php
U pear2/Pyrus/trunk/tests/Installer/install.remote.signedpackage.phpt
U pear2/Pyrus/trunk/tests/RemoteCategories/exceptions.phpt
U pear2/Pyrus/trunk/tests/RemoteCategory/arrayaccess.phpt
U pear2/Pyrus/trunk/tests/RemotePackage/invalidcert.phpt
U pear2/Pyrus/trunk/tests/RemotePackage/wrongemailcert.phpt
U pear2/Pyrus/trunk/tests/RemotePackages/singlerelease.phpt
U pear2/Pyrus/trunk/tests/XMLParser/recursivetag.phpt
U pear2/Pyrus/trunk/tests/XMLWriter/empty.phpt
svn-diffs-303499.txt
(text/x-diff, 9.2 KB)
Modified: pear2/Pyrus/trunk/src/Pyrus/Config.php
===================================================================
--- pear2/Pyrus/trunk/src/Pyrus/Config.php 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/src/Pyrus/Config.php 2010-09-18 13:43:07 UTC (rev 303499)
@@ -627,7 +627,6 @@
}
return '/tmp/' . md5($cwd);
-
}
/**
@@ -654,8 +653,7 @@
$userfile = $test;
}
} else {
- Logger::log(5, 'Found default user configuration file ' .
- $userfile);
+ Logger::log(5, 'Found default user configuration file ' . $userfile);
}
} else {
self::$explicitUserConfig = true;
Modified: pear2/Pyrus/trunk/tests/Installer/install.remote.signedpackage.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/Installer/install.remote.signedpackage.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/Installer/install.remote.signedpackage.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -1,6 +1,7 @@
--TEST--
\PEAR2\Pyrus\Installer: install remote packages that is signed with an OpenSSL signature
--SKIPIF--
+<?php die('Skipped: for coverage'); ?>
<?php
if (!extension_loaded('openssl')) die('SKIP openssl required');
?>
Modified: pear2/Pyrus/trunk/tests/RemoteCategories/exceptions.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/RemoteCategories/exceptions.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/RemoteCategories/exceptions.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -10,6 +10,7 @@
Internet::addDirectory(__DIR__ . '/../Mocks/Internet/remotepackage',
'http://pear2.php.net/');
\PEAR2\Pyrus\Main::$downloadClass = 'Internet';
+
$chan = \PEAR2\Pyrus\Config::current()->channelregistry['pecl.php.net'];
unset($chan->protocols->rest['REST1.1']);
try {
@@ -19,6 +20,7 @@
$test->assertEquals('Cannot access remote categories without REST1.1 protocol', $e->getMessage(),
'no REST1.1');
}
+
$remote = new PEAR2\Pyrus\Channel\RemoteCategories(\PEAR2\Pyrus\Config::current()->channelregistry['pear2.php.net']);
try {
$remote['foo'] = 1;
@@ -27,6 +29,7 @@
$test->assertEquals('remote channel info is read-only', $e->getMessage(),
'offsetSet');
}
+
try {
unset($remote['foo']);
throw new Exception('succeeded and should fail');
Modified: pear2/Pyrus/trunk/tests/RemoteCategory/arrayaccess.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/RemoteCategory/arrayaccess.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/RemoteCategory/arrayaccess.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -19,6 +19,7 @@
$test->assertEquals('PEAR2\Pyrus\Channel\RemotePackage',
get_class($chan->remotecategories['Default']['GetMaintainers_Test']),
'offsetGet test');
+
foreach ($chan->remotecategories['Default'] as $name => $package) {
$test->assertEquals('GetMaintainers_Test', $name, 'right name');
$test->assertEquals('PEAR2\Pyrus\Channel\RemotePackage', get_class($package), 'right class');
Modified: pear2/Pyrus/trunk/tests/RemotePackage/invalidcert.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/RemotePackage/invalidcert.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/RemotePackage/invalidcert.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -10,13 +10,13 @@
include __DIR__ . '/setup.php.inc';
require __DIR__ . '/../Mocks/Internet.php';
-Internet::addDirectory(__DIR__ . '/invalidcert',
- 'http://pear2.php.net/');
+Internet::addDirectory(__DIR__ . '/invalidcert', 'http://pear2.php.net/');
\PEAR2\Pyrus\Main::$downloadClass = 'Internet';
-$remote = new \PEAR2\Pyrus\Channel\RemotePackage(\PEAR2\Pyrus\Config::current()->channelregistry['pear2.php.net'],
- 'stable');
+
+$remote = new \PEAR2\Pyrus\Channel\RemotePackage(\PEAR2\Pyrus\Config::current()->channelregistry['pear2.php.net'], 'stable');
$remote = $remote['P1'];
$remote->version['release'] = '1.0.0';
+
try {
$remote->download();
throw new Exception('should fail and did not');
Modified: pear2/Pyrus/trunk/tests/RemotePackage/wrongemailcert.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/RemotePackage/wrongemailcert.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/RemotePackage/wrongemailcert.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -1,9 +1,8 @@
--TEST--
\PEAR2\Pyrus\Channel\RemotePackage::download(), certificate is not releasing maintainer's email
--SKIPIF--
-<?php die('Skipped: for coverage'); ?>
<?php
-die('skip for now');
+die('SKIP for now - broken test');
if (!extension_loaded('openssl')) die('SKIP openssl required');
?>
--FILE--
@@ -12,13 +11,13 @@
include __DIR__ . '/setup.php.inc';
require __DIR__ . '/../Mocks/Internet.php';
-Internet::addDirectory(__DIR__ . '/wrongemailcert',
- 'http://pear2.php.net/');
+Internet::addDirectory(__DIR__ . '/wrongemailcert', 'http://pear2.php.net/');
\PEAR2\Pyrus\Main::$downloadClass = 'Internet';
-$remote = new \PEAR2\Pyrus\Channel\RemotePackage(\PEAR2\Pyrus\Config::current()->channelregistry['pear2.php.net'],
- 'stable');
+
+$remote = new \PEAR2\Pyrus\Channel\RemotePackage(\PEAR2\Pyrus\Config::current()->channelregistry['pear2.php.net'], 'stable');
$remote = $remote['P1'];
$remote->version['release'] = '1.0.0';
+
try {
$remote->download();
throw new Exception('should fail and did not');
Modified: pear2/Pyrus/trunk/tests/RemotePackages/singlerelease.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/RemotePackages/singlerelease.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/RemotePackages/singlerelease.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -18,7 +18,6 @@
$remote = $chan->remotepackages;
$package = $remote->getPackage('P1');
$test->assertEquals('P1', $package->name, 'right package');
-
?>
===DONE===
--CLEAN--
Modified: pear2/Pyrus/trunk/tests/XMLParser/recursivetag.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/XMLParser/recursivetag.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/XMLParser/recursivetag.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -3,7 +3,8 @@
--FILE--
<?php
require dirname(__FILE__) . '/setup.php.inc';
-$res = $parser->parseString('<?xml version="1.0" ?><package>
+
+$xml = '<?xml version="1.0" ?><package>
<lead>
<name>test</name>
<another>tag</another>
@@ -24,48 +25,50 @@
<file name="my2"/>
</dir>
</contents>
-</package>');
+</package>';
+$res = $parser->parseString($xml);
+
$test->assertEquals(array (
- 'package' =>
+ 'package' =>
array (
- 'lead' =>
+ 'lead' =>
array (
- 0 =>
+ 0 =>
array (
'name' => 'test',
'another' => 'tag',
),
- 1 =>
+ 1 =>
array (
'name' => 'second',
'another' => 'thing',
),
),
- 'contents' =>
+ 'contents' =>
array (
- 'dir' =>
+ 'dir' =>
array (
- 0 =>
+ 0 =>
array (
- 'attribs' =>
+ 'attribs' =>
array (
'name' => 'blah',
),
- 'dir' =>
+ 'dir' =>
array (
- 'attribs' =>
+ 'attribs' =>
array (
'name' => 'two',
),
- 'dir' =>
+ 'dir' =>
array (
- 'attribs' =>
+ 'attribs' =>
array (
'name' => 'three',
),
- 'file' =>
+ 'file' =>
array (
- 'attribs' =>
+ 'attribs' =>
array (
'name' => 'my',
),
@@ -73,15 +76,15 @@
),
),
),
- 1 =>
+ 1 =>
array (
- 'attribs' =>
+ 'attribs' =>
array (
'name' => 'four',
),
- 'file' =>
+ 'file' =>
array (
- 'attribs' =>
+ 'attribs' =>
array (
'name' => 'my2',
),
Modified: pear2/Pyrus/trunk/tests/XMLWriter/empty.phpt
===================================================================
--- pear2/Pyrus/trunk/tests/XMLWriter/empty.phpt 2010-09-18 12:11:14 UTC (rev 303498)
+++ pear2/Pyrus/trunk/tests/XMLWriter/empty.phpt 2010-09-18 13:43:07 UTC (rev 303499)
@@ -6,6 +6,13 @@
$write = new $xmlwriter(array('a' => ''));
$test->assertEquals('<?xml version="1.0" encoding="UTF-8"?>
<a/>', (string) $write, 'test');
+
+$e = new stdClass;
+try {
+ $write = new $xmlwriter(array());
+} catch (PEAR2\Pyrus\XMLWriter\Exception $e) {}
+$test->assertEquals('Cannot serialize array to XML, array must have exactly 1 element', $e->getMessage(), 'error');
+
?>
===DONE===
--EXPECT--