Associate
Can't figure this out so early in the morning
I've started learning PHPUnit. Each function creates a new object called joe. But following DRY principles, I only want to create the single object - not sure where to instantiate the class?
I've started learning PHPUnit. Each function creates a new object called joe. But following DRY principles, I only want to create the single object - not sure where to instantiate the class?
PHP:
<?php
require_once('CustomerController.php');
class CustomerTest extends PHPUnit_Framework_TestCase {
public function testGetFirstName()
{
$joe = new Customer('Joe', 'Smith');
$this->assertEquals('Joe', $joe->getFirstName());
}
public function testGetLastName()
{
$joe = new Customer('Joe', 'Smith');
$this->assertEquals('Smith', $joe->getLastName());
}
}
?>