{"id":21660574,"url":"https://github.com/shimotaroo/hands-on-phpunit","last_synced_at":"2026-04-07T08:01:32.183Z","repository":{"id":45286983,"uuid":"438910380","full_name":"shimotaroo/hands-on-phpunit","owner":"shimotaroo","description":"PHPUnitでのテストコード実装入門ハンズオン用","archived":false,"fork":false,"pushed_at":"2021-12-24T08:26:30.000Z","size":100,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T05:29:49.947Z","etag":null,"topics":["docker","docker-compose","laravel8","php8","phpunit"],"latest_commit_sha":null,"homepage":"","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/shimotaroo.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}},"created_at":"2021-12-16T08:12:30.000Z","updated_at":"2022-09-30T01:49:54.000Z","dependencies_parsed_at":"2022-09-21T13:24:02.593Z","dependency_job_id":null,"html_url":"https://github.com/shimotaroo/hands-on-phpunit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shimotaroo/hands-on-phpunit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimotaroo%2Fhands-on-phpunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimotaroo%2Fhands-on-phpunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimotaroo%2Fhands-on-phpunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimotaroo%2Fhands-on-phpunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shimotaroo","download_url":"https://codeload.github.com/shimotaroo/hands-on-phpunit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimotaroo%2Fhands-on-phpunit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","docker-compose","laravel8","php8","phpunit"],"created_at":"2024-11-25T09:34:32.480Z","updated_at":"2026-04-07T08:01:32.161Z","avatar_url":"https://github.com/shimotaroo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPUnitでのテストコード実装超入門ハンズオン用 環境構築\n\nぜひStarつけてください！！\n\n## 環境・バージョン\n\n- PHP: 8.0.13\n- Laravel: 8.76.2\n- Nginx: 1.19.x\n- Mysql: 8.0.x\n\n## Dockerインストール\n以下記事を参考にインストール\n\n### Macユーザー\n[DockerをMacにインストールする（更新: 2019/7/13）](https://qiita.com/kurkuru/items/127fa99ef5b2f0288b81)\n\n### Windowsユーザー\n[Windows 10 HomeへのDocker Desktop (ver 3.0.0) インストールが何事もなく簡単にできるようになっていた (2020.12時点)](https://qiita.com/zaki-lknr/items/db99909ba1eb27803456)\n\n- Docker Desktopが起動しない場合は、Hyper-Vを有効化にしてみてください。\n- 参考記事：[【入門】はじめての Docker Desktop for Windows のインストールと CentOS の仮想環境構築のセットアップ](https://qiita.com/gahoh/items/7b21377b5c9e3ffddf4a#hyper-v%E3%81%AE%E6%9C%89%E5%8A%B9%E5%8C%96-%E3%81%AB%E3%81%99%E3%82%8B)\n\n以下コマンドを実行してバージョンが表示されたらインストール完了\n\n```sh\ndocker -v\ndocker-compose -v\n```\n\n## Docker環境起動\n\n```sh\ndocker-compose up -d --build\n```\n\n以下が出力されたら起動完了\n\n```sh\nSuccessfully built e310c39612cdffd4617eb3c21e02534f372c6ea8234230011e123afd0be4dfbb\nCreating hands-on-phpunit_db_1  ... done\nCreating hands-on-phpunit_app_1 ... done\nCreating hands-on-phpunit_web_1 ... done\n```\n\n念のため以下のコマンドでコンテナの起動状態を確認。\n\n```sh\ndocker-compose ps\n```\n\n全てのコンテナのSTATUSが`running`になっていたらOK。\n\n```sh\nNAME                     SERVICE             STATUS              PORTS\nhands-on-phpunit_app_1   app                 running             9000/tcp\nhands-on-phpunit_db_1    db                  running             0.0.0.0:3306-\u003e3306/tcp, 33060/tcp\nhands-on-phpunit_web_1   web                 running             0.0.0.0:80-\u003e80/tcp\n```\n\n## Laravel設定\n\n[既存のLaravelプロジェクトをgit cloneしてローカルで開発準備をする時の手順（Docker、Docker Compose使用）](https://zenn.dev/shimotaroo/articles/4ee537dbed319e)にまとめているが、以下にも記載↓\n\n### .envの作成\n\n`src`ディレクトリの中の`.env.example`をコピーして`.env`という名前で作成\n\n### composerパッケージのインストール\n\n以降のコマンドはルートディレクトリで実行する\n\n```sh\ndocker-compose exec app composer install\n```\n\n### APP_KEYの作成\n\n```sh\ndocker-compose exec app php artisan key:generate\n```\n\n### マイグレーションとシーダーの実行\n\n```sh\ndocker-compose exec app php artisan migrate --seed\n```\n\n### Laravelへのアクセス\n\nhttp://localhost:80 にアクセスして以下の画面が表示されたらOK\n\n![ハンズオントップ画面](https://user-images.githubusercontent.com/58982088/146734840-f10978dd-446e-4809-8bce-2872e15d0f83.png)\n\n※実際のコードでは「入門」ではなく「超入門」に変更しています。\n\n## ハンズオン\n\nハンズオン用資料はSpeaker Deckのアップしています。\n\nhttps://speakerdeck.com/shimotaroo/php-hands-on\n\nテストコードの実装等は以下のPRをご参照ください。\n\nhttps://github.com/shimotaroo/hands-on-phpunit/pull/1/files","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimotaroo%2Fhands-on-phpunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshimotaroo%2Fhands-on-phpunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimotaroo%2Fhands-on-phpunit/lists"}