From fb51d2fc0440a3d01b5b920c23b1c9201ff13c38 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Fri, 13 Mar 2026 21:21:06 +0100 Subject: [PATCH] test(Dashboard\Provider): remove unused method --- tests/units/Dashboard/ProviderTest.php | 111 ------------------------- 1 file changed, 111 deletions(-) diff --git a/tests/units/Dashboard/ProviderTest.php b/tests/units/Dashboard/ProviderTest.php index db8e37f8..70ab2049 100644 --- a/tests/units/Dashboard/ProviderTest.php +++ b/tests/units/Dashboard/ProviderTest.php @@ -69,117 +69,6 @@ public function setUp(): void $this->login('glpi', 'glpi'); } - protected function handledComputersCountFixture_old(): int - { - // Switch to an empty entity - $entities_id = $this->isolateInEntity('glpi', 'glpi'); - - $glpi_computer_type_empty = $this->createItem(GlpiComputerType::class); - - $glpi_computer_type = $this->createItem(GlpiComputerType::class); - - $computer_type_empty = $this->createItem(ComputerType::class, [ - 'computertypes_id' => $glpi_computer_type_empty->getID(), - 'power_consumption' => 0, - ]); - - $computer_type = $this->createItem(ComputerType::class, [ - 'computertypes_id' => $glpi_computer_type->getID(), - 'power_consumption' => 90, - ]); - - $computer_model_empty = $this->createItem(GlpiComputerModel::class, [ - 'power_consumption' => 0, - ]); - - $computer_model = $this->createItem(GlpiComputerModel::class, [ - 'power_consumption' => 150, - ]); - - $glpi_location_empty = $this->createItem(GlpiLocation::class); - $glpi_location = $this->createItem(GlpiLocation::class); - $source = $this->createItem(Source::class, [ - 'is_carbon_intensity_source' => 1, - ]); - $zone = $this->createItem(Zone::class); - $source_zone = $this->createItem(Source_Zone::class, [ - 'plugin_carbon_sources_id' => $source->getID(), - 'plugin_carbo_zones_id' => $zone->getID(), - ]); - $carbon_intensity = $this->createItem(CarbonIntensity::class, [ - 'plugin_carbon_sources_id' => $source->getID(), - 'plugin_carbon_zones_id' => $zone->getID(), - ]); - $location = $this->createItem(Location::class, [ - 'locations_id' => $glpi_location->getID(), - $source_zone::getForeignKeyField() => $source_zone->getID(), - ]); - - $usage_profile = $this->createItem(ComputerUsageProfile::class); - - $total_count = 0; - $computers_definition = [ - GlpiComputer::class => [ - [ - 'computermodels_id' => $computer_model_empty->getID(), - 'computertypes_id' => $glpi_computer_type_empty->getID(), - 'locations_id' => $glpi_location_empty->getID(), - ], - [ - 'computermodels_id' => $computer_model->getID(), - 'computertypes_id' => $glpi_computer_type_empty->getID(), - 'locations_id' => $glpi_location_empty->getID(), - ], - [ - 'computermodels_id' => $computer_model_empty->getID(), - 'computertypes_id' => $glpi_computer_type->getID(), - 'locations_id' => $glpi_location_empty->getID(), - ], - [ - 'computermodels_id' => $computer_model->getID(), - 'computertypes_id' => $glpi_computer_type->getID(), - 'locations_id' => $glpi_location_empty->getID(), - ], - - [ - 'computermodels_id' => $computer_model_empty->getID(), - 'computertypes_id' => $glpi_computer_type_empty->getID(), - 'locations_id' => $glpi_location->getID(), - ], - [ - 'computermodels_id' => $computer_model->getID(), - 'computertypes_id' => $glpi_computer_type_empty->getID(), - 'locations_id' => $glpi_location->getID(), - ], - [ - 'computermodels_id' => $computer_model_empty->getID(), - 'computertypes_id' => $glpi_computer_type->getID(), - 'locations_id' => $glpi_location->getID(), - ], - [ - 'computermodels_id' => $computer_model->getID(), - 'computertypes_id' => $glpi_computer_type->getID(), - 'locations_id' => $glpi_location->getID(), - ], - ], - ]; - $computers = $this->createItems($computers_definition); - $total_count += count($computers[GlpiComputer::class]); - - // computers with a usage profile; 3 of them are complete - $computers = $this->createItems($computers_definition); - $total_count += count($computers[GlpiComputer::class]); - foreach ($computers[GlpiComputer::class] as $computers_id => $computer) { - $impact = $this->createItem(UsageInfo::class, [ - 'itemtype' => GlpiComputer::class, - 'items_id' => $computers_id, - 'plugin_carbon_computerusageprofiles_id' => $usage_profile->getID(), - ]); - } - - return $total_count; - } - protected function handledComputersCountFixture(): int { $glpi_computers = [];