Calculator (Nette Tester)

NetBeans PHP Sample Application

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 intended to be used in a production environment without any changes.

This sample demonstrates the following features:

  • unit testing using Nette Tester
  • code coverage of project files

Requirements

Follow these before you run the sample:
  • Install NetBeans IDE with PHP support
  • Install and configure PHP Runtime
  • Install all dependencies using Composer (click on project and invoke Composer > Install (dev))
  • For code coverage, Xdebug PHP extension is required

What is included?

  • NetBeans PHP Application Project

Before the start

Getting Started

  1. For the very first run, Nette Tester must be installed via Composer (see Requirements).
  2. 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).
  3. For code coverage, open its report (right-click the project node and select Code Coverage > 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.
  4. Play futher with the sample :)