expectException(ImmutableMapException::class); unset($immutableMap[0]); } public function testOffsetSet(): void { $immutableMap = ImmutableMap::create(KeyType::INTEGER, ValueType::CHAR, range('A', 'Z')); $this->expectException(ImmutableMapException::class); $immutableMap[0] = 1; } public function test__construct(): void { $values = [ 'A' => 1, 'C' => 2, '3' => 4, ]; $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Invalid types for map [string => int], they should be [int => string]'); $immutableMap = ImmutableMap::create(KeyType::INT, ValueType::STRING, $values); } }