PHPackages                             zvoanhkietz/phpunit\_tutorial - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. zvoanhkietz/phpunit\_tutorial

ActiveStudy[Testing &amp; Quality](/categories/testing)

zvoanhkietz/phpunit\_tutorial
=============================

Simple project using PHPUnit.

v1.0.2(9y ago)0211[4 PRs](https://github.com/zvoanhkietz/phpunit_tutorial/pulls)GPLPHP

Since Jul 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/zvoanhkietz/phpunit_tutorial)[ Packagist](https://packagist.org/packages/zvoanhkietz/phpunit_tutorial)[ RSS](/packages/zvoanhkietz-phpunit-tutorial/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (12)Used By (0)

PHPUnit Tutorial - Calculator
=============================

[](#phpunit-tutorial---calculator)

[![Software License](https://camo.githubusercontent.com/23eb90fa51ed7f8314e61b554aa3a6318338e10ba5417ee63bf6e42116281eaf/68747470733a2f2f696d672e736869656c64732e696f2f6175722f6c6963656e73652f79616f7572742e737667)](LICENSE.txt)[![Build Status](https://camo.githubusercontent.com/6b631563e37a6dd0bf1e6958ee88af6d15712f78ec5c5fd909e26480a85b6e5c/68747470733a2f2f7472617669732d63692e6f72672f7a766f616e686b6965747a2f706870756e69745f7475746f7269616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zvoanhkietz/phpunit_tutorial)[![Coverage Status](https://camo.githubusercontent.com/70e6dbaddc674ae521c63036ba08ee0589ba52b61c3c9f3c3c665510d59a8f9a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f7a766f616e686b6965747a2f706870756e69745f7475746f7269616c2e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/zvoanhkietz/phpunit_tutorial)[![Latest Stable Version](https://camo.githubusercontent.com/79a182965428797b0511db8158f94c5697eeacb2f1d63624c20bd859d3aabf07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a766f616e686b6965747a2f706870756e69745f7475746f7269616c2e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65)](https://packagist.org/packages/zvoanhkietz/phpunit_tutorial#1.0.0)

NetBeans PHP Sample Application
-------------------------------

[](#netbeans-php-sample-application)

### What is Calculator?

[](#what-is-calculator)

Calculator is a simple calculator that supports basic arithmetical operations. This PHP application is created to highlight PHP features supported by NetBeans IDE.

**This sample is not intented to be used in a production environment without any changes.**

### This sample demonstrates the following features:

[](#this-sample-demonstrates-the-following-features)

- unit testing using PHPUnit
- creating unit tests using PHPUnit Skeleton Generator
- code coverage of project files

### Requirements

[](#requirements)

Follow these before you run the sample:

- Install NetBeans IDE with PHP support
- Install and configure PHP Runtime
- Install all dependencies using [Composer](https://getcomposer.org/) (click on project and invoke *Composer* &gt; *Install (dev)*)
    *Note:* PHPUnit can also be installed [globally as PHAR file](https://github.com/sebastianbergmann/phpunit/#installation)
- Install and configure [PHPUnit Skeleton Generator](https://github.com/sebastianbergmann/phpunit-skeleton-generator)
- For debugging and code coverage, [Xdebug](http://www.xdebug.org/) PHP extension is required

### What is included?

[](#what-is-included)

- NetBeans *PHP Application* Project

### Before the start

[](#before-the-start)

- If you want to try the sample out, follow [Getting Started](#getting_started) guidelines.
- In case if you want to try debugging features of the NetBeans IDE, follow the [Debugging](#debugging) guidelines.

### Getting Started

[](#getting-started)

1. For the very first run, PHPUnit must be installed via Composer and PHPUnit Skeleton Generator globally (see Requirements).
2. Now, create a unit test for Calculator class - open it in the editor and select *Tools &gt; Create Tests*.
3. Simply test the project. Right-click the project node and select *Test*. IDE will inform you about the test results (window with test results can be opened manually).
4. For code coverage, open its report (right-click the project node and select *Code Coverage &gt; Show Report...*) and *Run All Tests* if there are no data available yet. Open *Calculator.php* file from the list of the files to see which lines are and which lines are not tested.
5. Play futher with the sample :)

### Debugging

[](#debugging)

These steps should enable you the debugging option at the sample project, [if you already have PHP debugger (Xdebug) installed and configured](http://wiki.netbeans.org/HowToConfigureXDebug).
For demonstrating the PHP debugger in NetBeans, try the following:

1. Open source class *Calculator.php* or generated *CalculatorTest.php* in the editor.
2. Put breakpoint on some line with PHP code.
3. To debug, right-click *CalculatorTest.php* and select *Debug*.

[NetBeans PHP team](https://blogs.oracle.com/netbeansphp/), 2013 © Copyright Oracle corp., All rights reserved

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

3623d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3472980?v=4)[zvoanhkietz](/maintainers/zvoanhkietz)[@zvoanhkietz](https://github.com/zvoanhkietz)

---

Top Contributors

[![zvoanhkietz](https://avatars.githubusercontent.com/u/3472980?v=4)](https://github.com/zvoanhkietz "zvoanhkietz (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zvoanhkietz-phpunit-tutorial/health.svg)

```
[![Health](https://phpackages.com/badges/zvoanhkietz-phpunit-tutorial/health.svg)](https://phpackages.com/packages/zvoanhkietz-phpunit-tutorial)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M358](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
