Skip to content
This repository

Update docs on PHPUnit and CodeSniffer #1173

Merged
merged 1 commit into from almost 2 years ago

2 participants

Michael Babker ianmacl
Michael Babker
Owner

This updates the manual page on running PHPUnit and the CodeSniffer to:

  • Update the config value concerning the JHttpTransport tests
  • Add info about running phpunit and phpcs from build.xml using Ant
ianmacl ianmacl merged commit 5c1ef1d into from April 26, 2012
ianmacl ianmacl closed this April 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 26, 2012
Michael Babker Update docs on PHPUnit and PHPCS 11042ff
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 38 additions and 13 deletions. Show diff stats Hide diff stats

  1. 51  docs/manual/en-US/appendices/analysis.xml
51  docs/manual/en-US/appendices/analysis.xml
@@ -20,23 +20,23 @@
20 20
     <section>
21 21
       <title>Configuring Your Environment: The Database</title>
22 22
 
23  
-      <para>Standard unit tests run against a <ulink url="http://www.sqlite.org/quickstart.html">Sqlite</ulink> in memory 
24  
-      database for ease of setup and performance. Other than <ulink url="http://www.sqlite.org/quickstart.html">installing Sqlite</ulink>  
25  
-      no manual intervention or set up is required. The database is built at runtime and deleted when finished.      	
  23
+      <para>Standard unit tests run against a <ulink url="http://www.sqlite.org/quickstart.html">Sqlite</ulink> in memory
  24
+      database for ease of setup and performance. Other than <ulink url="http://www.sqlite.org/quickstart.html">installing Sqlite</ulink>
  25
+      no manual intervention or set up is required. The database is built at runtime and deleted when finished.
26 26
       </para>
27 27
 
28 28
       <para>To run the specific database tests:</para>
29 29
 
30 30
       <itemizedlist>
31 31
         <listitem>
32  
-          <para>Create your database and use the appropriate database-specific DDL located in 
  32
+          <para>Create your database and use the appropriate database-specific DDL located in
33 33
           tests/suites/database/stubs to create the database tables required.</para>
34 34
         </listitem>
35  
-        
  35
+
36 36
         <listitem>
37 37
           <para>In the root directory, copy the file named phpunit.xml.dist, leaving it in the same
38 38
           folder and naming it phpunit.xml.</para>
39  
-        </listitem>          
  39
+        </listitem>
40 40
 
41 41
         <listitem>
42 42
           <para>Uncomment the php block and include the const line(s) related to the database(s) you will be testing.</para>
@@ -49,17 +49,39 @@
49 49
     </section>
50 50
 
51 51
 	<section>
52  
-		<title>Configuring Your Environment: The JHttpTransport Test Stubs</title>
53  
-
54  
-		<para>There is a special stub that is required for testing the JHttp transports so that actual web requests can be simulated
55  
-		and assertions can be made about the results. To set these up, copy the file jhttp_stub.php to a web server and add the address
56  
-		to your config file with the config variable <code>$jhttp_stub</code>.</para>
57  
-	</section>
  52
+	  <title>Configuring Your Environment: The JHttpTransport Test Stubs</title>
  53
+
  54
+	  <para>There is a special stub that is required for testing the JHttp transports so that actual web requests can be simulated
  55
+	  and assertions can be made about the results. To set these up, you'll need to do the following:</para>
  56
+
  57
+        <itemizedlist>
  58
+          <listitem>
  59
+            <para>In the root directory, copy the file named phpunit.xml.dist, leaving it in the same
  60
+            folder and naming it phpunit.xml.</para>
  61
+          </listitem>
  62
+
  63
+          <listitem>
  64
+            <para>Uncomment the php block and include the "JTEST_HTTP_STUB" const.</para>
  65
+          </listitem>
  66
+
  67
+          <listitem>
  68
+            <para>The default file path for the const assumes that you have checked out the Joomla Platform to the web root
  69
+            of your test environment inside a folder named "joomla-platform".  If this is not the case, you can change
  70
+            the path to suit your environment and, if need be, copy the file from its default location to be available within
  71
+            your web environment.</para>
  72
+          </listitem>
  73
+        </itemizedlist>
  74
+    </section>
58 75
 
59 76
     <section>
60 77
       <title>Running the Tests</title>
61 78
 
62 79
       <para>You can run the tests by going to the platform root directory and executing <command>phpunit</command></para>
  80
+
  81
+      <para>Alternatively, if you have Ant installed on your system, you may run the unit tests by going to the platform root
  82
+      directory and executing <command>ant phpunit</command> to execute the tests on classes located under the libraries/joomla
  83
+      directory or executing <command>ant phpunit-legacy</command> to execute the tests on classes located under the
  84
+      libraries/legacy directory.</para>
63 85
     </section>
64 86
   </section>
65 87
 
@@ -78,8 +100,11 @@
78 100
     <section>
79 101
       <title>Running CodeSniffer</title>
80 102
 
81  
-      <para>You can run CodeSniffer by going to the platform root directory and executing <command>phpcs --report=checkstyle
  103
+      <para>You can run the CodeSniffer by going to the platform root directory and executing <command>phpcs --report=checkstyle
82 104
       --report-file=build/logs/checkstyle.xml --standard=/path/to/platform/build/phpcs/Joomla /path/to/platform</command></para>
  105
+
  106
+      <para>Alternatively, if you have Ant installed on your system, you may run the CodeSniffer by going to the platform root
  107
+      directory and executing <command>ant phpcs</command></para>
83 108
     </section>
84 109
 
85 110
     <section>
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.