{"id":19141530,"url":"https://github.com/julian-b90/yii2-codeception-tutorial","last_synced_at":"2026-05-15T11:34:44.637Z","repository":{"id":95284466,"uuid":"72940957","full_name":"Julian-B90/yii2-codeception-tutorial","owner":"Julian-B90","description":"Tutorial over testing in Yii2 with Codeception","archived":false,"fork":false,"pushed_at":"2017-01-20T19:54:37.000Z","size":496,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-03T15:14:57.365Z","etag":null,"topics":["codeception","yii"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Julian-B90.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-11-05T17:07:46.000Z","updated_at":"2020-05-04T08:32:18.000Z","dependencies_parsed_at":"2023-03-20T12:58:31.305Z","dependency_job_id":null,"html_url":"https://github.com/Julian-B90/yii2-codeception-tutorial","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/Julian-B90%2Fyii2-codeception-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-B90%2Fyii2-codeception-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-B90%2Fyii2-codeception-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-B90%2Fyii2-codeception-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Julian-B90","download_url":"https://codeload.github.com/Julian-B90/yii2-codeception-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240222500,"owners_count":19767458,"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":["codeception","yii"],"created_at":"2024-11-09T07:23:43.411Z","updated_at":"2026-05-15T11:34:39.618Z","avatar_url":"https://github.com/Julian-B90.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii 2 Basic Project Template\n============================\n\nYii 2 Basic Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for\nrapidly creating small projects.\n\nThe template contains the basic features including user login/logout and a contact page.\nIt includes all commonly used configurations that would allow you to focus on adding new\nfeatures to your application.\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-app-basic/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-app-basic)\n[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-app-basic/downloads.png)](https://packagist.org/packages/yiisoft/yii2-app-basic)\n[![Build Status](https://travis-ci.org/yiisoft/yii2-app-basic.svg?branch=master)](https://travis-ci.org/yiisoft/yii2-app-basic)\n\nDIRECTORY STRUCTURE\n-------------------\n\n      assets/             contains assets definition\n      commands/           contains console commands (controllers)\n      config/             contains application configurations\n      controllers/        contains Web controller classes\n      mail/               contains view files for e-mails\n      models/             contains model classes\n      runtime/            contains files generated during runtime\n      tests/              contains various tests for the basic application\n      vendor/             contains dependent 3rd-party packages\n      views/              contains view files for the Web application\n      web/                contains the entry script and Web resources\n\n\n\nREQUIREMENTS\n------------\n\nThe minimum requirement by this project template that your Web server supports PHP 5.4.0.\n\n\nINSTALLATION\n------------\n\n### Install via Composer\n\nIf you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions\nat [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).\n\nYou can then install this project template using the following command:\n\n~~~\nphp composer.phar global require \"fxp/composer-asset-plugin:^1.2.0\"\nphp composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic\n~~~\n\nNow you should be able to access the application through the following URL, assuming `basic` is the directory\ndirectly under the Web root.\n\n~~~\nhttp://localhost/basic/web/\n~~~\n\n\n### Install from an Archive File\n\nExtract the archive file downloaded from [yiiframework.com](http://www.yiiframework.com/download/) to\na directory named `basic` that is directly under the Web root.\n\nSet cookie validation key in `config/web.php` file to some random secret string:\n\n```php\n'request' =\u003e [\n    // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation\n    'cookieValidationKey' =\u003e '\u003csecret random string goes here\u003e',\n],\n```\n\nYou can then access the application through the following URL:\n\n~~~\nhttp://localhost/basic/web/\n~~~\n\n\nCONFIGURATION\n-------------\n\n### Database\n\nEdit the file `config/db.php` with real data, for example:\n\n```php\nreturn [\n    'class' =\u003e 'yii\\db\\Connection',\n    'dsn' =\u003e 'mysql:host=localhost;dbname=yii2basic',\n    'username' =\u003e 'root',\n    'password' =\u003e '1234',\n    'charset' =\u003e 'utf8',\n];\n```\n\n**NOTES:**\n- Yii won't create the database for you, this has to be done manually before you can access it.\n- Check and edit the other files in the `config/` directory to customize your application as required.\n- Refer to the README in the `tests` directory for information specific to basic application tests.\n\n\n\nTESTING\n-------\n\nTests are located in `tests` directory. They are developed with [Codeception PHP Testing Framework](http://codeception.com/).\nBy default there are 3 test suites:\n\n- `unit`\n- `functional`\n- `acceptance`\n\nTests can be executed by running\n\n```\ncomposer exec codecept run\n``` \n\nThe command above will execute unit and functional tests. Unit tests are testing the system components, while functional\ntests are for testing user interaction. Acceptance tests are disabled by default as they require additional setup since\nthey perform testing in real browser. \n\n\n### Running  acceptance tests\n\nTo execute acceptance tests do the following:  \n\n1. Rename `tests/acceptance.suite.yml.example` to `tests/acceptance.suite.yml` to enable suite configuration\n\n2. Replace `codeception/base` package in `composer.json` with `codeception/codeception` to install full featured\n   version of Codeception\n\n3. Update dependencies with Composer \n\n    ```\n    composer update  \n    ```\n\n4. Download [Selenium Server](http://www.seleniumhq.org/download/) and launch it:\n\n    ```\n    java -jar ~/selenium-server-standalone-x.xx.x.jar\n    ``` \n\n5. (Optional) Create `yii2_basic_tests` database and update it by applying migrations if you have them.\n\n   ```\n   tests/bin/yii migrate\n   ```\n\n   The database configuration can be found at `config/test_db.php`.\n\n\n6. Start web server:\n\n    ```\n    tests/bin/yii serve\n    ```\n\n7. Now you can run all available tests\n\n   ```\n   # run all available tests\n   composer exec codecept run\n\n   # run acceptance tests\n   composer exec codecept run acceptance\n\n   # run only unit and functional tests\n   composer exec codecept run unit,functional\n   ```\n\n### Code coverage support\n\nBy default, code coverage is disabled in `codeception.yml` configuration file, you should uncomment needed rows to be able\nto collect code coverage. You can run your tests and collect coverage with the following command:\n\n```\n#collect coverage for all tests\ncomposer exec codecept run -- --coverage-html --coverage-xml\n\n#collect coverage only for unit tests\ncomposer exec codecept run unit -- --coverage-html --coverage-xml\n\n#collect coverage for unit and functional tests\ncomposer exec codecept run functional,unit -- --coverage-html --coverage-xml\n```\n\nYou can see code coverage output under the `tests/_output` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulian-b90%2Fyii2-codeception-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulian-b90%2Fyii2-codeception-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulian-b90%2Fyii2-codeception-tutorial/lists"}