assertMatchesRegularExpression('/^ARG PHP_VERSION=(\d+\.\d+\.\d+)\s*$/m', $this->dockerfile()); preg_match('/^ARG PHP_VERSION=(\d+\.\d+\.\d+)\s*$/m', $this->dockerfile(), $trovata); $this->assertTrue( version_compare($trovata[1], self::MINIMA, '>='), "PHP {$trovata[1]} รจ vulnerabile a CVE-2026-109618/109619: serve almeno " . self::MINIMA . '.', ); } public function test_la_mitigazione_delle_sessioni_resta_nel_php_ini(): void { // Indicata da Sansec per CVE-2026-109618/109619; all'applicazione non // serve, quindi resta anche dopo la patch. $ini = (string) file_get_contents(dirname(__DIR__, 2) . '/docker/php/php.ini'); $this->assertMatchesRegularExpression('/^session\.upload_progress\.enabled\s*=\s*0\s*$/m', $ini); $this->assertMatchesRegularExpression('/^session\.use_strict_mode\s*=\s*1\s*$/m', $ini); } public function test_l_immagine_usa_la_versione_fissata_e_non_un_tag_mobile(): void { preg_match_all('/^FROM php:(\S+)/m', $this->dockerfile(), $basi); $this->assertNotEmpty($basi[1]); foreach ($basi[1] as $tag) { $this->assertStringStartsWith('${PHP_VERSION}', $tag, "FROM php:{$tag}: usa ARG PHP_VERSION, non un tag che si sposta."); } } }