Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc QA fixes for review #1

Merged
merged 4 commits into from Nov 6, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Console/Getargs.php
Expand Up @@ -224,7 +224,7 @@ class Console_Getargs
function &factory($config = array(), $arguments = null)
{
// Create the options object.
$obj = & new Console_Getargs_Options();
$obj = new Console_Getargs_Options();

// Try to set up the arguments.
$err = $obj->init($config, $arguments);
Expand Down
42 changes: 42 additions & 0 deletions build.xml
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<project name="Console_GetArgs" default="build" basedir=".">
<condition property="phpunit.bin" value="phpunit.bat" else="phpunit">
<os family="windows"/>
</condition>

<condition property="pear.bin" value="pear.bat" else="pear">
<os family="windows"/>
</condition>

<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/lib" />
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<delete dir="${basedir}/build"/>

<mkdir dir="${basedir}/lib/" />
<mkdir dir="${basedir}/build"/>
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>

<target name="phpunit">
<exec dir="${basedir}" executable="${phpunit.bin}" failonerror="true">
<arg line="."/>
</exec>
</target>

<target name="package">
<exec dir="${basedir}/build" executable="${pear.bin}" failonerror="true">
<arg line="package ../package.xml"/>
</exec>
</target>

<target name="build" depends="clean,phpunit,package"/>
</project>
58 changes: 37 additions & 21 deletions package.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>Console_Getargs</name>
<channel>pear.php.net</channel>
<summary>A command-line arguments parser</summary>
Expand All @@ -25,38 +25,31 @@ based on the given configuration.</description>
<email>wenz@php.net</email>
<active>no</active>
</developer>
<date>2010-10-11</date>
<time>16:40:03</time>
<date>2011-11-06</date>
<time>13:11:30</time>
<version>
<release>1.3.5</release>
<api>1.3.5</api>
<release>1.3.6</release>
<api>1.3.6</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
QA release.
* removed some coding style erros
* fixed bug #2599 2 parameters for CVS example
* fixed bug #2600 Parameter with '=argument"
* fixed bug #4091 New method: getValues()
* fixed bug #9252 No error when required arguments are missing
* fixed bug #9583 Console Args isDefined not working correctly
* fixed bug #10609 wrong require_once in doc
* fixed bug #13605 fix unit tests to work with phpunit3
QA Release.
Upgrade to phpunit 3.6
</notes>
<contents>
<dir baseinstalldir="/" name="/">
<file baseinstalldir="/" name="Console/Getargs.php" role="php">
<replace from="@package_version@" to="version" type="package-info" />
<file baseinstalldir="/" md5sum="0906cc9b6eea315b36487c9680471bf1" name="Console/Getargs.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="Console" name="examples/example.php" role="doc" />
<file baseinstalldir="Console" name="examples/example2.php" role="doc" />
<file baseinstalldir="/" name="tests/AllTests.php" role="test" />
<file baseinstalldir="Console" name="tests/Getargs_basic_testcase.php" role="test" />
<file baseinstalldir="" name="tests/Getargs_getValues_testcase.php" role="test" />
<file baseinstalldir="Console" md5sum="6a5651269cfaa096143c02426c070ae6" name="examples/example.php" role="doc" />
<file baseinstalldir="Console" md5sum="8b053b550ce74b06f7b000906df47f8f" name="examples/example2.php" role="doc" />
<file baseinstalldir="/" md5sum="ae35d76786d4753954495f05f2935a3b" name="tests/Getargs_BasicTest.php" role="test" />
<file baseinstalldir="/" md5sum="32ada775f0d4d8bee604bbe08298d61b" name="tests/Getargs_getValuesTest.php" role="test" />
<file baseinstalldir="/" md5sum="c6adc2abcd57bf1315a6619032335dc0" name="README" role="data" />
</dir>
</contents>
<dependencies>
Expand All @@ -68,6 +61,13 @@ based on the given configuration.</description>
<min>1.4.0b1</min>
</pearinstaller>
</required>
<optional>
<package>
<name>PHPUnit</name>
<channel>pear.phpunit.de</channel>
<min>3.6.0</min>
</package>
</optional>
</dependencies>
<phprelease />
<changelog>
Expand Down Expand Up @@ -229,5 +229,21 @@ Fix for bug #9252: No error when required arguments are missing.
Update to package2.xml
</notes>
</release>
<release>
<version>
<release>1.3.6</release>
<api>1.3.6</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>2011-11-06</date>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
QA Release.
Upgrade to phpunit 3.6
</notes>
</release>
</changelog>
</package>
21 changes: 21 additions & 0 deletions phpunit.xml
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<phpunit verbose="true">
<logging>
<log type="coverage-html" target="build/coverage" title="Console_GetArgs" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false" title="Console_GetArgs"/>
</logging>
<filter>
<blacklist>
<directory suffix=".php">/usr/share/php</directory>
<directory suffix=".php">tests/unit/</directory>
</blacklist>
</filter>
<testsuites>
<testsuite>
<directory>tests</directory>
<file>*Test.php</file>
</testsuite>
</testsuites>
<php><includePath>lib/</includePath></php>
</phpunit>
56 changes: 0 additions & 56 deletions tests/AllTests.php

This file was deleted.

Expand Up @@ -22,13 +22,13 @@
}

require_once 'Console/Getargs.php';
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Framework/TestCase.php';

/**
* Unit tests for Console_Getargs package.
*/

class Getargs_Basic_testCase extends PHPUnit_Framework_TestCase
class Getargs_BasicTest extends PHPUnit_Framework_TestCase
{
/**
* Runs the test methods of this class.
Expand Down
Expand Up @@ -26,7 +26,7 @@
}

require_once 'Console/Getargs.php';
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Framework/TestCase.php';

/**
* getValues Test case for Console_Getargs
Expand All @@ -40,7 +40,7 @@
* @version Release: @package_version@
* @link http://pear.php.net/package/Console_Getargs
*/
class Getargs_getValues_testCase extends PHPUnit_Framework_TestCase
class Getargs_getValuesTest extends PHPUnit_Framework_TestCase
{
/**
* Runs the test methods of this class.
Expand Down Expand Up @@ -294,4 +294,4 @@ function testMultiple()
Getargs_getValues_testCase::main();
}

?>
?>