https://github.com/yiisolutions/vk-user-friends
VK sample web application
https://github.com/yiisolutions/vk-user-friends
Last synced: 12 months ago
JSON representation
VK sample web application
- Host: GitHub
- URL: https://github.com/yiisolutions/vk-user-friends
- Owner: yiisolutions
- License: other
- Created: 2016-10-29T17:43:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T15:22:51.000Z (over 8 years ago)
- Last Synced: 2025-05-21T16:12:46.455Z (about 1 year ago)
- Language: PHP
- Homepage: https://vk-user-friends-memclutter.herokuapp.com
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
VK User Friends
===============
[](https://travis-ci.org/memclutter/vk-user-friends)
REQUIREMENTS
------------
The minimum requirement by this project that your Web server supports PHP 5.4.0.
INSTALLATION
------------
### Install via Composer
If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).
You can then install this project template using the following command:
~~~
composer global require "fxp/composer-asset-plugin:^1.2.0"
composer install
~~~
Copy `.env.dist` as `.env` and edit this file. Set database settings and vkontakte client id and secret.
Next, apply migrations
~~~
./yii migrate --interactive=0
~~~
Start built-in web-server
~~~
./yii serve
~~~
TESTING
-------
Tests are located in `tests` directory. They are developed with [Codeception PHP Testing Framework](http://codeception.com/).
By default there are 3 test suites:
- `unit`
- `functional`
- `acceptance`
Tests can be executed by running
```
composer exec codecept run
```
The command above will execute unit and functional tests. Unit tests are testing the system components, while functional
tests are for testing user interaction. Acceptance tests are disabled by default as they require additional setup since
they perform testing in real browser.
### Running acceptance tests
To execute acceptance tests do the following:
1. Rename `tests/acceptance.suite.yml.example` to `tests/acceptance.suite.yml` to enable suite configuration
2. Replace `codeception/base` package in `composer.json` with `codeception/codeception` to install full featured
version of Codeception
3. Update dependencies with Composer
```
composer update
```
4. Download [Selenium Server](http://www.seleniumhq.org/download/) and launch it:
```
java -jar ~/selenium-server-standalone-x.xx.x.jar
```
5. (Optional) Create `yii2_basic_tests` database and update it by applying migrations if you have them.
```
tests/bin/yii migrate
```
The database configuration can be found at `config/test_db.php`.
6. Start web server:
```
tests/bin/yii serve
```
7. Now you can run all available tests
```
# run all available tests
composer exec codecept run
# run acceptance tests
composer exec codecept run acceptance
# run only unit and functional tests
composer exec codecept run unit,functional
```
### Code coverage support
By default, code coverage is disabled in `codeception.yml` configuration file, you should uncomment needed rows to be able
to collect code coverage. You can run your tests and collect coverage with the following command:
```
#collect coverage for all tests
composer exec codecept run -- --coverage-html --coverage-xml
#collect coverage only for unit tests
composer exec codecept run unit -- --coverage-html --coverage-xml
#collect coverage for unit and functional tests
composer exec codecept run functional,unit -- --coverage-html --coverage-xml
```
You can see code coverage output under the `tests/_output` directory.