[b]app/classes/model/job.php[/b]
class Model_Job extends Model_Crud {
[b]/** .... snip out all details of this model's properties .... **/[/b]
public function mock()
{
$object = new stdClass;
foreach(self::$_properties as $key=>$properties)
{
if (!empty($properties['default']))
$object->$key = $properties['default'];
}
$object->deleted = 0;
return $object;
}
}
and my test case..[b]app/tests/job.php[/b]
class Test_Job extends Fuel\Core\TestCase
{
protected function setUp()
{
$this->job = Model_Job::mock();
}
public function test_job_is_not_deleted()
{
$expected = 0;
$this->assertEquals($expected, $this->job->deleted);
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!