{"id":28399398,"url":"https://github.com/codeception/c3","last_synced_at":"2025-10-20T02:44:45.509Z","repository":{"id":6073981,"uuid":"7300107","full_name":"Codeception/c3","owner":"Codeception","description":"Remote CodeCoverage for Codeception. Part of Codeception testing framework.","archived":false,"fork":false,"pushed_at":"2023-12-01T11:40:39.000Z","size":121,"stargazers_count":73,"open_issues_count":9,"forks_count":46,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-06-27T12:31:29.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://codeception.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Codeception.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-12-23T23:44:20.000Z","updated_at":"2025-06-19T11:29:10.000Z","dependencies_parsed_at":"2022-09-22T14:25:29.385Z","dependency_job_id":"316a2e3a-f0d8-43cc-bc16-569d4835ec14","html_url":"https://github.com/Codeception/c3","commit_stats":{"total_commits":117,"total_committers":30,"mean_commits":3.9,"dds":0.5213675213675213,"last_synced_commit":"e23298a1cd5e7745973ea26a53572a3d9b013439"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/Codeception/c3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeception%2Fc3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeception%2Fc3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeception%2Fc3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeception%2Fc3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codeception","download_url":"https://codeload.github.com/Codeception/c3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeception%2Fc3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262483989,"owners_count":23318374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-01T08:09:00.429Z","updated_at":"2025-10-20T02:44:40.481Z","avatar_url":"https://github.com/Codeception.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"**[Issues](https://github.com/Codeception/Codeception/issues)** | **[Usage Guide](https://codeception.com/docs/11-Codecoverage)** \n\n## Remote CodeCoverage for Codeception [![Build Status](https://travis-ci.org/Codeception/c3.svg?branch=2.0)](https://travis-ci.org/Codeception/c3)\n\nThis file `c3.php` should be included into the application you are testing in the very first line.\nIt will start remote code coverage collection. Coverage data will be stored to disk and retrieved by `codeception` when tests from the suite are finished.\nThis file won't affect your application in any way. It is executed **only** when a special header `X-Codeception-CodeCoverage` is sent. Alternatively, if you use Selenium, special cookie `CODECEPTION_CODECOVERAGE` is used. In any other case your application run as usually with no overheads.\n\n### Local Code Coverage\n\nIf you don't run tests on remote server but use a webserver (Apache, Nginx, PhpWebserver) you need `c3.php` installed just the same way.\nIn this case coverage result will be merged with local code coverage.\n\n### Installation\n\nFile `c3.php` should be put in project root, into the same directory where `codeception.yml` config is located.\nAlso, make sure Codeception is available on remote server either in phar/pear/composer packages.\n\n#### Via Composer\n\nAdd to `composer.json`:\n\n```\n\"require-dev\": {\n    \"codeception/codeception\": \"3.*\",\n    \"codeception/c3\": \"2.*\"\n}\n```\n\nC3 installer will copy `c3.php` to the project root.\n\n#### Manually\n\n```\nwget https://raw.github.com/Codeception/c3/2.0/c3.php\n```\n\n### Setup\n\nNow you should include c3.php in your front script, like `index.php`.\n\nExample file: `web/index.php`:\n\n``` php\n\u003c?php\n\ndefine('C3_CODECOVERAGE_ERROR_LOG_FILE', '/path/to/c3_error.log'); //Optional (if not set the default c3 output dir will be used)\ninclude '/../c3.php';\n\ndefine('MY_APP_STARTED', true);\n// App::start();\n?\u003e\n```\n\nNow on when is Codeception launched with code coverage enabled you will receive a coverage report from this remote server.\n\n### Configuration\n\nTo enable remote (and local) codecoverage by c3.script you should edit global configuration file `codeception.yml`, or one of the suite configuration files.\n\nExample: codeception.yml\n\n``` yml\n\ncoverage:\n  enabled: true\n  remote: true\n  include:\n    - app/*\n  exclude:\n    - app/cache/*\n```\n\nThe `remote` option specifies if you run your application actually runs on another server. If your webserver runs on the same node and uses the same codebase,\ndisable this option. \n\n## Predefined Routes\n\nc3 file shouldn't break your application, but there are predefined routes that will be managed by c3.\nCodeception will access routes in order to receive collected coverage report in different formats.\n\n* `c3/report/clover`\n* `c3/report/serialized`\n* `c3/report/html`\n* `c3/report/clear`\n\n## Debug\n\nIn case you got into troubles and remote debugging still doesn't start you can try the following. Edit `c3.php` file and remove the header check\n\n``` php\n// to remove\nif (!array_key_exists('HTTP_X_CODECEPTION_CODECOVERAGE', $_SERVER)) {\n    return;\n}\n```\nthen add this line to the top of file:\n\n``` php\n$_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG'] = 1;\n```\n\nnow access `http://yourhost/c3/report/clear` url and see if it has errors. Please check that error_reporting is set to E_ALL\n\n## Temp directories\n\nIn root of your project `c3tmp` dir will be created during code coverage. \nIt will not be deleted after suite ends for testing and debugging purposes.\nSerialized data as well as xml and html code coverage reports will be stored there.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeception%2Fc3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeception%2Fc3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeception%2Fc3/lists"}