class SalesTest extends CDbTestCase {
private $object;
public $fixtures = array('stock' => 'Stock', 'sales'=>'Sales');
protected function setUp() {
$this->object = new Sales;
}
protected function tearDown() {
unset($this->object);
}
public function testTransact_Normal_ReturnEquals() {
//set
$model = $this->sales('sales1');
$stock =$this->stock('stok2');
//act
$model->transact();
//assert
$this->assertEquals(90, $stock->qty);
}
I got this error:
SalesTest::testTransact_Normal_ReturnEquals()
Exception: Unknown method ‘sales’ for class ‘SalesTest’.
If I remove setUp() and tearDown() no error, but I really do hope can put setUp() and tearDown().
So what is the workaround to use fixtures and setUp()/tearDown() ?