31. Person.php
<?php
class Person
{
protected $_name = '';
public function __construct($name)
{
$this->_name = (string) $name;
}
public function sayHelloTo($name)
{
return 'Hello, ' . $name . '. I am ' . $this->_name . '.';
}
}
64. # phpunit AddTest.php
PHPUnit 3.3.17 by Sebastian Bergmann.
...F
Time: 0 seconds
There was 1 failure:
1) testAdd(AddTest) with data set #3 (1, 1, 3)
Failed asserting that <integer:2> matches expected value
<integer:3>.
xxxxxxxxAddTest.php:15
FAILURES!
Tests: 4, Assertions: 4, Failures: 1.
101. Package/Class1Test.php
<?php
require_once 'PHPUnit/Framework.php';
class Package_Class1Test extends PHPUnit_Framework_TestCase
{
public function testOne() {}
public function testTwo() {}
}
Package/Class2Test.php
<?php
require_once 'PHPUnit/Framework.php';
class Package_Class2Test extends PHPUnit_Framework_TestCase
{
public function testThree() {}
public function testFour() {}
}
154. # phpunit --coverage-html ./report SubjectTest.php
PHPUnit 3.3.17 by Sebastian Bergmann.
.
Time: 0 seconds
OK (1 test, 1 assertion)
Generating code coverage report, this may take a moment.
155. # phpunit --coverage-html ./report SubjectTest.php
PHPUnit 3.3.17 by Sebastian Bergmann.
.
Time: 0 seconds
OK (1 test, 1 assertion)
Generating code coverage report, this may take a moment.