<?php

require_once 'ABaseTest.php';

class KorsupgahReportTest extends BaseTest {
    public function testReportsSuccess() {
        try {
            $this->doAPIShouldHaveHeaders(
                'GET',
                'korsupgah_report/r?id_instansi=1',
                [],
                [
                    'Content-Type' => 'application/vnd.ms-excel'
                ],
                "\ntestReportsSuccess Passed"
            );
        } catch (Exception $e) {
            self::$messages = array_merge(self::$messages, ["testReportsSuccess Failed", $e->getMessage()]);
        }
    }

    public function testIndexSuccess() {
        try {
            $this->doAPIShouldHaveHeaders(
                'GET',
                'korsupgah_report?id_instansi=1',
                [],
                [
                    'Content-Type' => 'application/vnd.ms-excel'
                ],
                "testIndexSuccess Passed"
            );
        } catch (Exception $e) {
            self::$messages = array_merge(self::$messages, ["testIndexSuccess Failed", $e->getMessage()]);
        }
    }

    // todo: Fatal error: Uncaught ArgumentCountError: Too few arguments to function KorsupgahReportController::generateExcel()
    // public function testTotalSuccess() {}

    // todo: error cannot access private method KorsupgahReportController::area_intervensi()
    // public function testAreaIntervensiSuccess() {}

    // todo: Fatal error: Uncaught ArgumentCountError: Too few arguments to function KorsupgahReportController::generateExcel()
    // public function testIndikatorSuccess() {}

    public function testSubIndikatorSuccess() {
        try {
            $url = 'korsupgah_report/sub_indikator?id_instansi=1&id_sub_indikator=1';
            $this->doAPIListShouldSuccess($url);
        } catch (Exception $e) {
            self::$messages = array_merge(self::$messages, [ $url . " Failed", $e->getMessage()]);
        }
    }

    // todo: Fatal error: Uncaught ArgumentCountError: Too few arguments to function KorsupgahReportController::generateExcel()
    // public function testProvinsiSuccess() {}

    // todo: Fatal error: Uncaught ArgumentCountError: Too few arguments to function KorsupgahReportController::generateExcel()
    // public function testKabupatenSuccess() {}
}