Reputation: 237
Just assigning null to the obj is what done in tearDown().What all the entries created in db by other function while testing that will be deleted and for that we should write in tearDown() this was I thought.
protected function setUp()
{
$this->XSCCategoryModelObj = new XSCCategoryModel();
}
protected function tearDown()
{
$this->XSCCategoryModelObj =null;
}
Upvotes: 0
Views: 48
Reputation: 67
I believe that this section from documentation answers on your question. Also, this part with explanation can help:
The setUp() and tearDown() template methods are run once for each test method (and on fresh instances) of the test case class. In addition, the setUpBeforeClass() and tearDownAfterClass() template methods are called before the first test of the test case class is run and after the last test of the test case class is run, respectively.
Upvotes: 1