cvs: peardoc /en/core ppm.xml /en/core/ppm pear-runtest.xml /en/core/ppm/pear-runtest generate-diff.xml pear-runtest.xml run.xml
| From: | Greg Beaver | Date: | Thu, 09 Jun 2005 03:19:43 +0000 |
| Subject: | cvs: peardoc /en/core ppm.xml /en/core/ppm pear-runtest.xml /en/core/ppm/pear-runtest generate-diff.xml pear-runtest.xml run.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-6259@lists.php.net to get a copy of this message | ||
cellog Wed Jun 8 23:19:43 2005 EDT
Added files:
/peardoc/en/core/ppm pear-runtest.xml
/peardoc/en/core/ppm/pear-runtest generate-diff.xml
pear-runtest.xml run.xml
Modified files:
/peardoc/en/core ppm.xml
Log:
add docs for PEAR_RunTest
http://cvs.php.net/diff.php/peardoc/en/core/ppm.xml?r1=1.10&r2=1.11&ty=u Index: peardoc/en/core/ppm.xml diff -u peardoc/en/core/ppm.xml:1.10 peardoc/en/core/ppm.xml:1.11 --- peardoc/en/core/ppm.xml:1.10 Wed Jun 8 23:00:46 2005 +++ peardoc/en/core/ppm.xml Wed Jun 8 23:19:43 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <chapter id="core.ppm"> <title>PEAR Installer classes</title> @@ -26,6 +26,7 @@ &core.ppm.pear-registry; &core.ppm.pear-remote; &core.ppm.pear-rest; + &core.ppm.pear-runtest; &core.ppm.pear-validate; &core.ppm.pear-xmlparser; http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest.xml +++ peardoc/en/core/ppm/pear-runtest.xml <!-- $Revision: 1.1 $ --> <sect1 id="core.ppm.pear-runtest"> <title>PEAR</title> <refentry id="core.ppm.pear-runtest-summary"> <refnamediv> <refname> Class Summary <classname>PEAR_RunTest</classname> </refname> <refpurpose>Simplified version of PHP's test suite</refpurpose> </refnamediv> <refsect1> <title>Simplified version of PHP's test suite</title> <para>Try it with:</para> <para> <screen> <![CDATA[ $ php -r 'include "../PEAR/RunTest.php"; $t=new PEAR_RunTest; \ $o=$t->run("./pear_system.phpt");print_r($o);' ]]> </screen> </para> </refsect1> <refsect1> <title> Class Trees for <classname>PEAR_RunTest</classname> </title> <para> <itemizedlist> <listitem> <para>PEAR_RunTest</para> </listitem> </itemizedlist> </para> </refsect1> </refentry> &core.ppm.pear-runtest.pear-runtest; &core.ppm.pear-runtest.generate-diff; &core.ppm.pear-runtest.run; </sect1> http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest/generate-diff.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest/generate-diff.xml +++ peardoc/en/core/ppm/pear-runtest/generate-diff.xml <!-- $Revision: 1.1 $ --> <refentry id="core.ppm.pear-runtest.generate-diff"> <refnamediv> <refname> <function>PEAR_RunTest::generate_diff</function> </refname> <refpurpose>generate_diff</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo>require_once '/RunTest.php';</funcsynopsisinfo> <funcprototype> <funcdef> void <function>PEAR_RunTest::generate_diff</function> </funcdef> <paramdef> string <parameter>$wanted</parameter> </paramdef> <paramdef> string <parameter>$output</parameter> </paramdef> <paramdef> array|false <parameter>$return_value</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.ppm.pear-runtest.generate-diff.desc"> &title.desc; <para> Returns differences by line between the expected output (<parameter>$wanted</parameter>) and the actual output (<parameter>$output</parameter>). In addition, the value returned from the script can also be tested. The test should be performed outside <function>generate_diff</function>. If the return value is as expected, pass in &false;, otherwise pass in an array where the first element is the expected return value and the second is the actual return value. </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.generate-diff.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$wanted</parameter> </term> <listitem> <para> Expected output </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$output</parameter> </term> <listitem> <para> Actual output </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.array;|&false; <parameter>$return_value</parameter> </term> <listitem> <para> False if return value was correct, otherwise an array of format: </para> <para> <programlisting role="php"> <![CDATA[ <?php array( 1, // expected return 2, // actual return value ); ?> ]]> </programlisting> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.generate-diff.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.generate-diff.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest/pear-runtest.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest/pear-runtest.xml +++ peardoc/en/core/ppm/pear-runtest/pear-runtest.xml <!-- $Revision: 1.1 $ --> <refentry id="core.ppm.pear-runtest.pear-runtest"> <refnamediv> <refname> constructor <function>PEAR_RunTest::PEAR_RunTest</function> </refname> <refpurpose>Instantiate a PEAR_RunTest object.</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo>require_once '/RunTest.php';</funcsynopsisinfo> <funcprototype> <funcdef> void constructor <function>PEAR_RunTest::PEAR_RunTest</function> </funcdef> <paramdef> PEAR_Common|null <parameter> <optional>$logger = &null;</optional> </parameter> </paramdef> <paramdef> array <parameter> <optional>$options = array()</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.ppm.pear-runtest.pear-runtest.desc"> &title.desc; <para> If no logger is specified, a new PEAR_Common object will be instantiated and used to print output to the screen. </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.pear-runtest.param"> &title.param; <para> <variablelist> <varlistentry> <term> <link linkend="core.ppm.pear-common"><classname>PEAR_Common</classname></link>|&null; <parameter>$logger</parameter> </term> <listitem> <para> A class that contains a <function>log</function> method matching the signature of <classname>PEAR_Common</classname>. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.array; <parameter>$options</parameter> </term> <listitem> <para> Currently supported options are <literal>simple</literal> and <literal>quiet</literal>. The <literal>simple</literal> option causes tests to simply print the title of the test and not the full path to the test file. The <literal>quiet</literal> option causes output of only failed tests. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.pear-runtest.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.pear-runtest.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest/run.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest/run.xml +++ peardoc/en/core/ppm/pear-runtest/run.xml <!-- $Revision: 1.1 $ --> <refentry id="core.ppm.pear-runtest.run"> <refnamediv> <refname> <function>PEAR_RunTest::run</function> </refname> <refpurpose>run</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo>require_once '/RunTest.php';</funcsynopsisinfo> <funcprototype> <funcdef> string|PEAR_Error <function>PEAR_RunTest::run</function> </funcdef> <paramdef> string <parameter>$file</parameter> </paramdef> <paramdef> string <parameter> <optional>$ini_settings = ''</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.ppm.pear-runtest.run.desc"> &title.desc; <para> Run a unit test. The return value is one of: </para> <para> <itemizedlist> <listitem> <para> <literal>PASSED</literal> </para> </listitem> <listitem> <para> <literal>SKIPPED</literal> </para> </listitem> <listitem> <para> <literal>WARNED</literal> </para> </listitem> <listitem> <para> <literal>FAILED</literal> </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.run.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$file</parameter> </term> <listitem> <para> Full path to the test file to run. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$ini_settings</parameter> </term> <listitem> <para> Additional customized settings to pass on the command-line to the PHP instance used for testing. For example, requesting disabling use of php.ini or a testing php.ini can be specified. For a full list of possible settings, type: </para> <para> <screen> <![CDATA[ $ php -h ]]> </screen> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.run.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.run.note"> &title.note; ¬e.notstatic; </refsect1> </refentry>
http://cvs.php.net/diff.php/peardoc/en/core/ppm.xml?r1=1.10&r2=1.11&ty=u Index: peardoc/en/core/ppm.xml diff -u peardoc/en/core/ppm.xml:1.10 peardoc/en/core/ppm.xml:1.11 --- peardoc/en/core/ppm.xml:1.10 Wed Jun 8 23:00:46 2005 +++ peardoc/en/core/ppm.xml Wed Jun 8 23:19:43 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <chapter id="core.ppm"> <title>PEAR Installer classes</title> @@ -26,6 +26,7 @@ &core.ppm.pear-registry; &core.ppm.pear-remote; &core.ppm.pear-rest; + &core.ppm.pear-runtest; &core.ppm.pear-validate; &core.ppm.pear-xmlparser; http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest.xml +++ peardoc/en/core/ppm/pear-runtest.xml <!-- $Revision: 1.1 $ --> <sect1 id="core.ppm.pear-runtest"> <title>PEAR</title> <refentry id="core.ppm.pear-runtest-summary"> <refnamediv> <refname> Class Summary <classname>PEAR_RunTest</classname> </refname> <refpurpose>Simplified version of PHP's test suite</refpurpose> </refnamediv> <refsect1> <title>Simplified version of PHP's test suite</title> <para>Try it with:</para> <para> <screen> <![CDATA[ $ php -r 'include "../PEAR/RunTest.php"; $t=new PEAR_RunTest; \ $o=$t->run("./pear_system.phpt");print_r($o);' ]]> </screen> </para> </refsect1> <refsect1> <title> Class Trees for <classname>PEAR_RunTest</classname> </title> <para> <itemizedlist> <listitem> <para>PEAR_RunTest</para> </listitem> </itemizedlist> </para> </refsect1> </refentry> &core.ppm.pear-runtest.pear-runtest; &core.ppm.pear-runtest.generate-diff; &core.ppm.pear-runtest.run; </sect1> http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest/generate-diff.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest/generate-diff.xml +++ peardoc/en/core/ppm/pear-runtest/generate-diff.xml <!-- $Revision: 1.1 $ --> <refentry id="core.ppm.pear-runtest.generate-diff"> <refnamediv> <refname> <function>PEAR_RunTest::generate_diff</function> </refname> <refpurpose>generate_diff</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo>require_once '/RunTest.php';</funcsynopsisinfo> <funcprototype> <funcdef> void <function>PEAR_RunTest::generate_diff</function> </funcdef> <paramdef> string <parameter>$wanted</parameter> </paramdef> <paramdef> string <parameter>$output</parameter> </paramdef> <paramdef> array|false <parameter>$return_value</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.ppm.pear-runtest.generate-diff.desc"> &title.desc; <para> Returns differences by line between the expected output (<parameter>$wanted</parameter>) and the actual output (<parameter>$output</parameter>). In addition, the value returned from the script can also be tested. The test should be performed outside <function>generate_diff</function>. If the return value is as expected, pass in &false;, otherwise pass in an array where the first element is the expected return value and the second is the actual return value. </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.generate-diff.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$wanted</parameter> </term> <listitem> <para> Expected output </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$output</parameter> </term> <listitem> <para> Actual output </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.array;|&false; <parameter>$return_value</parameter> </term> <listitem> <para> False if return value was correct, otherwise an array of format: </para> <para> <programlisting role="php"> <![CDATA[ <?php array( 1, // expected return 2, // actual return value ); ?> ]]> </programlisting> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.generate-diff.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.generate-diff.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest/pear-runtest.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest/pear-runtest.xml +++ peardoc/en/core/ppm/pear-runtest/pear-runtest.xml <!-- $Revision: 1.1 $ --> <refentry id="core.ppm.pear-runtest.pear-runtest"> <refnamediv> <refname> constructor <function>PEAR_RunTest::PEAR_RunTest</function> </refname> <refpurpose>Instantiate a PEAR_RunTest object.</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo>require_once '/RunTest.php';</funcsynopsisinfo> <funcprototype> <funcdef> void constructor <function>PEAR_RunTest::PEAR_RunTest</function> </funcdef> <paramdef> PEAR_Common|null <parameter> <optional>$logger = &null;</optional> </parameter> </paramdef> <paramdef> array <parameter> <optional>$options = array()</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.ppm.pear-runtest.pear-runtest.desc"> &title.desc; <para> If no logger is specified, a new PEAR_Common object will be instantiated and used to print output to the screen. </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.pear-runtest.param"> &title.param; <para> <variablelist> <varlistentry> <term> <link linkend="core.ppm.pear-common"><classname>PEAR_Common</classname></link>|&null; <parameter>$logger</parameter> </term> <listitem> <para> A class that contains a <function>log</function> method matching the signature of <classname>PEAR_Common</classname>. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.array; <parameter>$options</parameter> </term> <listitem> <para> Currently supported options are <literal>simple</literal> and <literal>quiet</literal>. The <literal>simple</literal> option causes tests to simply print the title of the test and not the full path to the test file. The <literal>quiet</literal> option causes output of only failed tests. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.pear-runtest.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.pear-runtest.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> http://cvs.php.net/co.php/peardoc/en/core/ppm/pear-runtest/run.xml?r=1.1&p=1 Index: peardoc/en/core/ppm/pear-runtest/run.xml +++ peardoc/en/core/ppm/pear-runtest/run.xml <!-- $Revision: 1.1 $ --> <refentry id="core.ppm.pear-runtest.run"> <refnamediv> <refname> <function>PEAR_RunTest::run</function> </refname> <refpurpose>run</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo>require_once '/RunTest.php';</funcsynopsisinfo> <funcprototype> <funcdef> string|PEAR_Error <function>PEAR_RunTest::run</function> </funcdef> <paramdef> string <parameter>$file</parameter> </paramdef> <paramdef> string <parameter> <optional>$ini_settings = ''</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.ppm.pear-runtest.run.desc"> &title.desc; <para> Run a unit test. The return value is one of: </para> <para> <itemizedlist> <listitem> <para> <literal>PASSED</literal> </para> </listitem> <listitem> <para> <literal>SKIPPED</literal> </para> </listitem> <listitem> <para> <literal>WARNED</literal> </para> </listitem> <listitem> <para> <literal>FAILED</literal> </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.run.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$file</parameter> </term> <listitem> <para> Full path to the test file to run. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$ini_settings</parameter> </term> <listitem> <para> Additional customized settings to pass on the command-line to the PHP instance used for testing. For example, requesting disabling use of php.ini or a testing php.ini can be specified. For a full list of possible settings, type: </para> <para> <screen> <![CDATA[ $ php -h ]]> </screen> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.run.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="core.ppm.pear-runtest.run.note"> &title.note; ¬e.notstatic; </refsect1> </refentry>