|
|
@@ -102,22 +102,22 @@ class ProcessTest extends TestCase
|
|
|
|
|
|
protected function tearDown(): void
|
|
|
{
|
|
|
-// $station = Station::query()->with('parent')->where('code',$this->data['localCode'])->first();
|
|
|
-// $materialBox = MaterialBox::query()->where('code',$this->data['boxCode'])->first();
|
|
|
-// if($materialBox){
|
|
|
-// $StationTaskMaterialBoxes = StationTaskMaterialBox::query()->where('material_box_id',$materialBox['id'])->get();
|
|
|
-// foreach ($StationTaskMaterialBoxes as $stationTaskMaterialBox) {
|
|
|
-// if($stationTaskMaterialBox->stationTask) {
|
|
|
-// StationTaskChildren::query()->where('station_task_id',$stationTaskMaterialBox->stationTask['id'])->delete();
|
|
|
-// $stationTaskMaterialBox->stationTask ? $stationTaskMaterialBox->stationTask->delete() : null;
|
|
|
-// }
|
|
|
-// $stationTaskMaterialBox->delete();
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if($station){
|
|
|
-// $station->parent->delete();
|
|
|
-// $station->delete();
|
|
|
-// }
|
|
|
+ $station = Station::query()->with('parent')->where('code',$this->data['localCode'])->first();
|
|
|
+ $materialBox = MaterialBox::query()->where('code',$this->data['boxCode'])->first();
|
|
|
+ if($materialBox){
|
|
|
+ $StationTaskMaterialBoxes = StationTaskMaterialBox::query()->where('material_box_id',$materialBox['id'])->get();
|
|
|
+ foreach ($StationTaskMaterialBoxes as $stationTaskMaterialBox) {
|
|
|
+ if($stationTaskMaterialBox->stationTask) {
|
|
|
+ StationTaskChildren::query()->where('station_task_id',$stationTaskMaterialBox->stationTask['id'])->delete();
|
|
|
+ $stationTaskMaterialBox->stationTask ? $stationTaskMaterialBox->stationTask->delete() : null;
|
|
|
+ }
|
|
|
+ $stationTaskMaterialBox->delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($station){
|
|
|
+ $station->parent->delete();
|
|
|
+ $station->delete();
|
|
|
+ }
|
|
|
parent::tearDown(); // TODO: Change the autogenerated stub
|
|
|
}
|
|
|
|