list($minimum_code_coverage) = $options['minimum_code_coverage']; } $base_directory = dirname(getcwd()); if (isset($options['base_directory'])) { list($base_directory) = $options['base_directory']; } list($coverage_file_path) = $options['coverage_file_path']; $report = new NaithCliReport(array('base_directory' => $base_directory, 'excluded_paths' => $excluded_paths, 'coverage_file_path' => $coverage_file_path, 'minimum_code_coverage' => $minimum_code_coverage)); } switch ($action_name) { case "run-test": if (isset($options['coverage_file_path'])) { NaithCliRunner::setCoverageFilePath($options['coverage_file_path'][0]); } if (isset($options['tests_report_path'])) { NaithCliRunner::setTestsReportPath($options['tests_report_path'][0], $options['test_file'][0]); } NaithCliRunner::bootstrapForTest(); if (isset($options['prepend_file'])) { foreach ($options['prepend_file'] as $prepended_file) { require $prepended_file; } } if (isset($options['test_file'])) { foreach ($options['test_file'] as $test_file) { require $test_file; } } break; case "make-coverage-overview": $report->makeCoverageOverview();
<?php xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); $base_directory = dirname(__FILE__) . '/../../'; require_once $base_directory . 'NaithCliRunner.class.php'; $coverage_file_path = dirname(__FILE__) . '/raw_coverage_file.txt'; $tests_report_path = dirname(__FILE__) . '/tests_report_raw.txt'; $junit_xml_path = dirname(__FILE__) . '/junit.xml'; register_shutdown_function('NaithCliRunner::onShutdown'); NaithCliRunner::setCoverageFilePath($coverage_file_path); NaithCliRunner::setTestsReportPath($tests_report_path, __FILE__); NaithCliRunner::bootstrapForTest(); assert(true);