protected function tearDown() { if ($this->storedRecord) { $this->rm->scheduleDelete($this->storedRecord); } if ($this->relatedRecord) { $this->rm->scheduleDelete($this->relatedRecord); } $this->rm->commit(); parent::tearDown(); }
/** * removes records by their record alias id map * @link https://github.com/sigma-z/Dive/issues/2 */ public function removeGeneratedRecords() { foreach ($this->generatedRecords as $recordTableNameAndId) { $table = $this->rm->getTable($recordTableNameAndId['tableName']); $record = $table->findByPk($recordTableNameAndId['id']); $this->rm->scheduleDelete($record); } $this->rm->commit(); $this->clear(); }