refundFeeStack(3, 2, 380.0, 280.0); $this->assertSame([280.0], $fees); } public function testRefundKeepsReversingAdditionalFeesBeforeFirstStudentFee(): void { $fees = $this->refundFeeStack(3, 0, 380.0, 280.0); $this->assertSame([280.0, 280.0, 380.0], $fees); } public function testSingleStudentWithdrawalRefundsFirstStudentFee(): void { $fees = $this->refundFeeStack(1, 0, 380.0, 280.0); $this->assertSame([380.0], $fees); } /** * @return array */ private function refundFeeStack( int $originalStudentCount, int $remainingStudentCount, float $firstStudentFee, float $additionalStudentFee ): array { $method = new \ReflectionMethod(FeeCalculationService::class, 'reverseTuitionRefundFeeStack'); $method->setAccessible(true); return $method->invoke( new FeeCalculationService(), $originalStudentCount, $remainingStudentCount, $firstStudentFee, $additionalStudentFee ); } }