1. Go to this page and download the library: Download nette/tester library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nette / tester example snippets
class Greeting
{
function say($name)
{
if (!$name) {
throw new InvalidArgumentException('Invalid name.');
}
return "Hello $name";
}
}
use Tester\Assert;
$h = new Greeting;
// use an assertion function to test say()
Assert::same('Hello John', $h->say('John'));