Menu

[r20]: / branches / phpcoverage-0.8.2 / samples / remote / README  Maximize  Restore  History

Download this file

51 lines (41 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
################################################################################
#  $Id: README 49493 2006-04-08 00:16:04Z hkodungallur $
#  
#  Copyright(c) 2004-2006, SpikeSource Inc. All Rights Reserved.
#  Licensed under the Open Software License version 2.1
#  (See http://www.spikesource.com/license.html)
################################################################################
################################################
# Spike PHPCoverage Remote Code Coverage Sample
################################################

This sample has a single PHP file taken straight from the Xdebug 
documentation - named as "sample.php". 

The codeCoverageMain.php is the wrapper script that sets up the 
remote code coverage recording and then executes the "sample.php" file
deployed in your web server. The code coverage report is generated in a 
directory called "report" in the current working directory.

To execute this sample, run the following commands assuming that 
the PHP command line executable is in your path. The following alose assumes 
that your web server deploy directory is "/var/www".

Linux:
  # Depoly application
  $ export PHPCOVERAGE_HOME=/path/to/phpcoverage/src
  $ cp -rp web /var/www
  # Instrument
  $ php ${PHPCOVERAGE_HOME}/cli/instrument.php -b /var/www/web /var/www/web/*.php
  # Execute
  $ php codeCoverageMain.php PHPCOVERAGE_APPBASE_PATH=/var/www/web

Windows: 
  Copy the web directory to the Web server deploy directory.
  C:\> set PHPCOVERAGE_HOME=\path\to\phpcoverage\src
  # Instrument
  C:\> php ${PHPCOVERAGE_HOME}\cli\instrument.php -b <ws-deploy-dir> <ws-deploy-dir>\web\*.php
  # Execute
  C:\> php codeCoverageMain.php PHPCOVERAGE_APPBASE_PATH=<ws-deploy-dir>\web


The expected output should be something like this:

[phpcoverage.inc.php] PHPCOVERAGE_HOME=/opt/cache/common/spikephpcoverage/src
[phpcoverage.inc.php] PHPCOVERAGE_REPORT_DIR=
[phpcoverage.inc.php] PHPCOVERAGE_APPBASE_PATH=/opt/oss/share/apache2/htdocs/web
[CoverageRecorder::generateReport()] Writing report.
[CoverageRecorder::generateReport()] [done]

The expected code coverage reading is 100%.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.