{"id":17865883,"url":"https://github.com/ttskch/chronos-sample","last_synced_at":"2025-08-24T21:28:32.971Z","repository":{"id":66183893,"uuid":"248922456","full_name":"ttskch/chronos-sample","owner":"ttskch","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-21T12:29:22.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T12:16:25.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttskch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-21T06:48:22.000Z","updated_at":"2020-03-21T12:29:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"145e29b1-346f-49b4-91b7-98d1e129eaa7","html_url":"https://github.com/ttskch/chronos-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fchronos-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fchronos-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fchronos-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttskch%2Fchronos-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttskch","download_url":"https://codeload.github.com/ttskch/chronos-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246899639,"owners_count":20851894,"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":"2024-10-28T09:25:23.195Z","updated_at":"2025-04-02T21:43:26.665Z","avatar_url":"https://github.com/ttskch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chronos-sample\n\n明日の日付を出力するアプリ。[Chronos](https://book.cakephp.org/chronos/2/ja/index.html) を導入することでテストが簡単になることを例示。\n\n```bash\n# アプリを使う\n$ php app.php\n\n# テストする\n$ phpunit\n```\n\n## 1. テストできないパターン\n\n* [app.php](https://github.com/ttskch/chronos-sample/blob/4030355ac9c4bbf4d7af693be1a8745f1b225ad0/app.php)\n* [Tomorrow.php](https://github.com/ttskch/chronos-sample/blob/4030355ac9c4bbf4d7af693be1a8745f1b225ad0/src/Tomorrow.php)\n* [TomorrowTest.php](https://github.com/ttskch/chronos-sample/blob/4030355ac9c4bbf4d7af693be1a8745f1b225ad0/tests/TomorrowTest.php#L26-L34)\n\n## 2. Clockサービスを自作してテスト可能にしたパターン\n\n* [app.php](https://github.com/ttskch/chronos-sample/blob/988d01b4fa9a2fa418f404c2b3d068cc4110c3ce/app.php)\n* [Tomorrow.php](https://github.com/ttskch/chronos-sample/blob/988d01b4fa9a2fa418f404c2b3d068cc4110c3ce/src/Tomorrow.php)\n* [Clock.php](https://github.com/ttskch/chronos-sample/blob/988d01b4fa9a2fa418f404c2b3d068cc4110c3ce/src/Clock.php)\n* [TomorrowTest.php](https://github.com/ttskch/chronos-sample/blob/988d01b4fa9a2fa418f404c2b3d068cc4110c3ce/tests/TomorrowTest.php#L29-L37)\n\n## 3. Chronosを使ってテスト可能にしたパターン\n\n* [app.php](https://github.com/ttskch/chronos-sample/blob/93e9691132bc948b08c717707e28aab6ceddf624/app.php)\n* [Tomorrow.php](https://github.com/ttskch/chronos-sample/blob/93e9691132bc948b08c717707e28aab6ceddf624/src/Tomorrow.php)\n* [TomorrowTest.php](https://github.com/ttskch/chronos-sample/blob/93e9691132bc948b08c717707e28aab6ceddf624/tests/TomorrowTest.php#L27-L37)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttskch%2Fchronos-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttskch%2Fchronos-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttskch%2Fchronos-sample/lists"}