Skip to content

Commit

Permalink
Merge pull request #6169 from junichi11/php-update-php-sample-for-php…
Browse files Browse the repository at this point in the history
…unit

Update the PHP sample project for PHPUnit
  • Loading branch information
junichi11 authored Jul 9, 2023
2 parents a872ceb + 7939c99 commit e418ee1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

},
"require-dev": {
"phpunit/phpunit": "~8"
"phpunit/phpunit": "~10"
},
"autoload": {
"classmap": ["src/"]
Expand Down
20 changes: 15 additions & 5 deletions php/php.samples/samples_src/Calculator-PHPUnit/readme.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
Expand All @@ -18,12 +19,11 @@
under the License.
-->
<!DOCTYPE html>
<html>
<head>
<title>Calculator (PHPUnit) - sample application for NetBeans IDE</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
<style>
/** general **/
* {
margin: 0;
Expand Down Expand Up @@ -234,11 +234,21 @@ <h3 id="getting_started">Getting Started</h3>
<li>Play futher with the sample :)</li>
</ol>

<h3 id="coverage">Coverage</h3>
<p class="p">
To get the result of code coverage, please set the following to the ini file. e.g. <i>php.ini, xdebug.ini</i>
</p>
<pre>
<code>xdebug.mode=coverage
xdebug.client_host=localhost
xdebug.client_port=9003
xdebug.idekey="netbeans-xdebug"</code>
</pre>

<h3 id="debugging">Debugging</h3>
<p class="p">
These steps should enable you the debugging option at the sample project,
<a href="http://wiki.netbeans.org/HowToConfigureXDebug" target="_blank">if you already have PHP debugger (Xdebug)
installed and configured</a>.<br>
if you already have PHP debugger (Xdebug) installed and configured.<br>
For demonstrating the PHP debugger in NetBeans, try the following:
</p>
<ol class="p">
Expand All @@ -254,7 +264,7 @@ <h3 id="debugging">Debugging</h3>
<!-- footer -->
<div id="footer">
<div class="indent">
<div class="fleft">2019 &copy; Copyright The Apache Software Foundation, All rights reserved</div>
<div class="fleft">2023 &copy; Copyright The Apache Software Foundation, All rights reserved</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
-->
<phpunit bootstrap="../vendor/autoload.php">
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<coverage>
<include>
<directory suffix=".php">../src</directory>
</whitelist>
</filter>
</include>
</coverage>
</phpunit>

0 comments on commit e418ee1

Please sign in to comment.