expectException(ValidationException::class); $rule = new Max(5); self::assertValidationRulePassed($rule, true); } public function testRuleThrowsExceptionForNonPositiveSize() { $this->expectException(InvalidArgumentException::class); new Max(0); } }