assertSame(5000, exportCapLimit(null, 5000)); $this->assertSame(5000, exportCapLimit('', 5000)); $this->assertSame(5000, exportCapLimit('abc', 5000)); } public function testExportCapLimitClampsZeroAndNegativeToMax(): void { $this->assertSame(5000, exportCapLimit(0, 5000)); $this->assertSame(5000, exportCapLimit(-1, 5000)); $this->assertSame(5000, exportCapLimit('-42', 5000)); } public function testExportCapLimitRespectsUserValueWhenInRange(): void { $this->assertSame(250, exportCapLimit(250, 5000)); $this->assertSame(5000, exportCapLimit(5000, 5000)); $this->assertSame(1, exportCapLimit(1, 5000)); } public function testExportCapLimitClampsAboveMaxToMax(): void { $this->assertSame(5000, exportCapLimit(9999, 5000)); $this->assertSame(100, exportCapLimit(999999, 100)); } public function testExportCapLimitHonoursCustomMax(): void { $this->assertSame(50, exportCapLimit(50, 100)); $this->assertSame(100, exportCapLimit(200, 100)); } }