-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #309 from mesilov/dev
v2.alpha.7
- Loading branch information
Showing
204 changed files
with
8,831 additions
and
630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
custom: ["https://boosty.to/bitrix24-php-sdk"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.idea* | ||
/app | ||
vendor | ||
composer.phar | ||
composer.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# A quick guide to contribute to the project: | ||
|
||
## Installing the dev environment | ||
|
||
1. Fork the repo | ||
2. Clone the repo to local | ||
3. Install dependencies: `composer update` (this assumes you have 'composer' aliased to wherever your composer.phar lives) | ||
4. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: | ||
`composer phpstan-analyse` | ||
`composer phpunit-run-unit-tests` | ||
`composer phpunit-run-integration-tests` | ||
|
||
## Adding new features | ||
|
||
Pull requests with new features needs to be created against master branch. | ||
|
||
If new feature require BC Break please note that in your PR comment, it will added in next major version. | ||
New features that does not have any BC Breaks are going to be added in next minor version. | ||
|
||
## Codding standards | ||
|
||
In order to fix codding standards please exeecute: | ||
|
||
```shell | ||
composer phpstan-analyse | ||
``` | ||
|
||
## Patches and bugfixes | ||
|
||
1. Check the oldest version that patch/bug fix can be applied. | ||
2. Create PR against that version | ||
|
||
|
||
## The actual contribution | ||
|
||
1. Make the changes/additions to the code, committing often and making clear what you've done | ||
2. Make sure you write tests for your code, located in the folder structure | ||
3. Run your tests (often and while coding) | ||
4. Create Pull Request on github to against proper branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,10 @@ Performance improvements 🚀 | |
- test coverage: unit, integration, contract | ||
- typical examples typical for different modes of operation and they are optimized for memory \ performance | ||
|
||
### Sponsors | ||
|
||
Help bitrix24-php-sdk by [boosty.to/bitrix24-php-sdk](https://boosty.to/bitrix24-php-sdk) its development! | ||
|
||
### Architecture | ||
|
||
### Abstraction layers | ||
|
@@ -121,7 +125,8 @@ Add `"mesilov/bitrix24-php-sdk": "2.x"` to `composer.json` of your application. | |
|
||
### Tests | ||
|
||
Tests locate in folder `tests` and we have two test types | ||
Tests locate in folder `tests` and we have two test types. | ||
In folder tests create file `.env.local` and fill environment variables from `.env`. | ||
|
||
#### Unit tests | ||
|
||
|
@@ -184,7 +189,6 @@ See also the list of [contributors](https://github.com/mesilov/bitrix24-php-sdk/ | |
|
||
email: <[email protected]> | ||
|
||
### Sponsors | ||
|
||
### Documentation | ||
|
||
|
@@ -217,6 +221,10 @@ email: <[email protected]> | |
- покрытие тестами: unit, интеграционные, контрактные | ||
- есть типовые примеры характерные для разных режимов работы и они оптимизированы по памяти \ быстродействию | ||
|
||
### Спонсоры | ||
|
||
Помогите развитию bitrix24-php-sdk подписавшись на [boosty.to/bitrix24-php-sdk](https://boosty.to/bitrix24-php-sdk)! | ||
|
||
### Ключевые особенности | ||
|
||
### Слои SDK | ||
|
@@ -331,4 +339,53 @@ Symfony HttpClient | |
|
||
JSON по HTTP/2 или HTTP/1.1 | ||
|
||
## Спонсоры | ||
## Спонсоры | ||
|
||
### Тесты | ||
|
||
Тесты расположены в папке `tests` и бывают двух типов: юнит и интеграционные. | ||
В папке `tests` создайте файл `.env.local` и заполните переменные из файла `.env`. | ||
|
||
#### Юнит тесты | ||
|
||
**Быстрые**, выполняются без сетевого взаимодействия с Битрикс 24. | ||
|
||
```shell | ||
composer phpunit-run-unit-test | ||
``` | ||
|
||
#### Интеграционные тесты | ||
|
||
**Медленные** тесты покрывают полный жизненный цикл CRUD операций подключение к Битрикс 24 происходи с помощью веб-хука. | ||
|
||
❗ Не запускайте интеграционные тесты на ваших production порталах они удалят все ваши данные ❗️ | ||
|
||
Для запуска интеграционных тестов вам нужно: | ||
|
||
1. Создать [Новый портал Битрикс 24](https://www.bitrix24.ru/create.php?p=255670) для запуска тестов. | ||
2. Перейти в левое меню и нажать "Карта сайта". | ||
3. Найти меню для "Разработчиков" | ||
4. Кликнуть в меню «Другое» | ||
5. Кликнуть в меню «Входящий веб-хук» | ||
6. Выбрать все нужные расширения и нажать кнопку "сохранить". | ||
7. Создать файл `/tests/.env.local` с переменными окружения которые скопировать из файла `/tests/.env` . | ||
|
||
```yaml | ||
APP_ENV=dev | ||
BITRIX24_WEBHOOK=https:// your portal webhook url | ||
INTEGRATION_TEST_LOG_LEVEL=500 | ||
``` | ||
|
||
8. Запуск из командной строки. | ||
|
||
```shell | ||
composer composer phpunit-run-integration-tests | ||
``` | ||
|
||
#### Статический анализ кодовой базы – phpstan | ||
|
||
Запуск из командной строки. | ||
|
||
```shell | ||
composer phpstan-analyse | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Создание Локального приложения | ||
## Предусловия | ||
1. Создайте 2 файла в корне рабочей папки например app: это `install.php` и `index.php`. | ||
2. Содержимое файла `install.php`. | ||
```php | ||
``` | ||
3. Для работы локального серверного приложения требуется рабочий веб сервер на машине разработчика. | ||
4. Запускаем локальный веб-сервер, например так: | ||
```shell | ||
php -S 127.0.0.1:8080 | ||
``` | ||
3. Пробрасываем порт в большой интернет через сервис ngrok. | ||
```shell | ||
ngrok http 127.0.0.1:8080 | ||
``` | ||
4. После запуска ngrok будет выдан временный публичный адрес типо `https://7949-178-34-183-66.eu.ngrok.io`, который после выключения сервиса перестанет существовать. Этот адрес исчезнет после завершения ngrok. | ||
5. Зарегистрируйте новый портал битрикс 24. | ||
6. Включите тестовый период для маркет плейса и тарифного плана. | ||
7. Открой портал и перейдите в меню. | ||
1. Откройте левое меню, выберите "Разработчикам" | ||
2. Выберите "Другое" | ||
3. Откройте "Локальное приложение" | ||
4. Зарегистрируйте новое локальное приложение с нужным вам скоупом. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.