I can create a single php file that uses PHPunit for assertions inside one function, inside a class. Is it possible to call functions, with each function containing an assertion?
(At the moment I'm only using Xampp and notepad++ on Windows)
fileA.php:
=============
require_once ‘fileA.php’;
testA():
testB();
testC();
fileB.php:
==========
class availabletests extends \PHPUnit_Framework_TestCase
{
function testA()
{ $this->assertEquals(2,1+1); }
function testB()
{ $this->assertEquals(20,1+1); }
function testC()
{ $this->assertEquals(8,1+1); }
}
Many thanks!
$phpunit fileB.php, and then it will give you verbose information about which tests failed and which assertions failed. To that extent, it's much better to have multiple test methods in a single file/class, as it's better for isolating each test case and allows you to look at each success/failure independently.