Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Misc QA fixes for review #1

Merged
merged 4 commits into from

3 participants

@CloCkWeRX
Owner

So; with Jenkins now available - how do we feel about phpunit 3.6, a build.xml (implying ant), dropping AllTests, etc?

@till
Owner

I don't mind either. Maybe we can pre-process this before the job runs?

Pull request looks good: +1

@cweiske
Owner

I'd rather use phing than ant, but I'm ok with dropping alltests (as long as we have something that pear can use with run-tests )

@CloCkWeRX
Owner

@till - when you say preprocess; what do you mean?
@cweiske - pear run-tests supports phpunit AllTests out of the box? Or at least can be told "pear run-tests tests/AllTests.php" and have it treat it like a normal PHP file? What does it do with the results?

@CloCkWeRX CloCkWeRX merged commit 6c339be into pear:master
@till
Owner

@ClockWerx: I mean, I wouldn't go through all packages and delete AllTests.php now. I'd tell people it's not necessary anymore so new packages don't do it or current packages can update when they get around to it.

Also, I'd probably try to leverage a phpunit.xml (somehow) because it makes bootstrapping tests with phpunit very simple.

Generally, I'm not sure how jenkins is being setup, but maybe that part would just do whatever is necessary to run tests.

@CloCkWeRX
Owner

@till - I agree - I've been doing two main types of jobs.

  1. phpunit --with-lots -of flags tests/[AllTests.php if needed]
  2. build.xml + phpunit.xml when there are external libraries; and the jenkins build has ~3+ custom commands to manage it.
@cweiske
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 6, 2011
  1. @CloCkWeRX

    Upgraded for PHPUnit 3.6

    CloCkWeRX authored
  2. @CloCkWeRX

    Added build.xml

    CloCkWeRX authored
  3. @CloCkWeRX

    &new vs new

    CloCkWeRX authored
  4. @CloCkWeRX

    Renaming

    CloCkWeRX authored
This page is out of date. Refresh to see the latest.
View
2  Console/Getargs.php
@@ -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);
View
42 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>
View
58 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>
@@ -25,11 +25,11 @@ 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>
@@ -37,26 +37,19 @@ based on the given configuration.</description>
</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>
@@ -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>
@@ -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>
View
21 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>
View
56 tests/AllTests.php
@@ -1,56 +0,0 @@
-<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4: */
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 2004 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 3.0 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at the following url: |
-// | http://www.php.net/license/3_0.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Author: Bertrand Mansion <bmansion@mamasam.com> |
-// +----------------------------------------------------------------------+
-//
-// $Id$
-
-/**
- * Unit tests for Console_Getargs package.
- */
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Console_Getargs_AllTests::main');
-}
-
-require_once 'PHPUnit/TextUI/TestRunner.php';
-
-
-chdir(dirname(__FILE__) . '/../');
-require_once 'Getargs_basic_testcase.php';
-require_once 'Getargs_getValues_testcase.php';
-
-class Console_Getargs_AllTests
-{
- public static function main()
- {
- PHPUnit_TextUI_TestRunner::run(self::suite());
- }
-
- public static function suite()
- {
- $suite = new PHPUnit_Framework_TestSuite('Console_Getargs Tests');
- /** Add testsuites, if there is. */
- $suite->addTestSuite('Getargs_basic_testcase');
- $suite->addTestSuite('Getargs_getValues_testcase');
-
- return $suite;
- }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Console_Getargs_AllTests::main') {
- Console_Getargs_AllTests::main();
-}
-?>
View
4 tests/Getargs_basic_testcase.php → tests/Getargs_BasicTest.php
@@ -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.
View
6 tests/Getargs_getValues_testcase.php → tests/Getargs_getValuesTest.php
@@ -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
@@ -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.
@@ -294,4 +294,4 @@ function testMultiple()
Getargs_getValues_testCase::main();
}
-?>
+?>
Something went wrong with that request. Please try again.