expectException(Psl\Exception\InvariantViolationException::class); $this->expectExceptionMessage('If start < end, the step must be positive.'); Iter\range(0, 10, -2); } public function testRandomThrowsIfStartIsGreaterThanEndAndStepIsPositive(): void { $this->expectException(Psl\Exception\InvariantViolationException::class); $this->expectExceptionMessage('If start > end, the step must be negative.'); Iter\range(20, 10, 2); } }