diff --git a/pages/docs/contribution-handbook/developer-workflow/docker.mdx b/pages/docs/contribution-handbook/developer-workflow/docker.mdx index 1c619271..5ff319fb 100644 --- a/pages/docs/contribution-handbook/developer-workflow/docker.mdx +++ b/pages/docs/contribution-handbook/developer-workflow/docker.mdx @@ -83,7 +83,7 @@ ADD . /var/www/fossbilling Run the following command to build and start the containers: -``` +```shell docker-compose up --build -d ``` @@ -91,7 +91,7 @@ You can now interact with the containers via Docker Desktop. To destroy the containers via command line, run: -``` +```shell docker-compose down --volumes ``` @@ -112,7 +112,7 @@ Use Docker Desktop to access the `Terminal` for the `web` container. Run the following commands: -``` +```shell cd /var/www/fossbilling composer install npm install @@ -131,12 +131,22 @@ Use `mysql` as the database hostname, and `fossbilling` for the database name, u Keep this in mind if you are rapidly re-creating the development environment or reinstalling FOSSBilling. -### Running Tests +#### PHPunit -Use the following command in the `web` container to run `phpunit` tests: +FOSSBilling's unit tests are built using PHPUnit, to run them simply run the command below. +```shell +php /var/www/fossbilling/src/vendor/bin/phpunit ``` -php /var/www/fossbilling/src/vendor/phpunit/phpunit/phpunit + +#### PHPStan + +PHPStan performs static analysis on your PHP code. It will check for common mistakes such as wrong types being used, incorrect PHPDocs, references to undefined functions, and more. + +You may need to increase the memory limit when running PHPStan, in this case we've set it to 512MB as an example which is more than enough. + +```shell +php /var/www/fossbilling/src/vendor/bin/phpstan --memory-limit-512m ``` ## Summary diff --git a/pages/docs/contribution-handbook/developer-workflow/remote.mdx b/pages/docs/contribution-handbook/developer-workflow/remote.mdx index 9c1c626c..9c6474fb 100644 --- a/pages/docs/contribution-handbook/developer-workflow/remote.mdx +++ b/pages/docs/contribution-handbook/developer-workflow/remote.mdx @@ -39,19 +39,19 @@ All methods involve copying the `src/` folder from your local repository into th Utilize [rsync](https://linux.die.net/man/1/rsync) via command line to sync only files that have changed. -``` +```shell rsync -ahP src/ user@domainorip:/path/to/www ``` Add the `-I` flag to force sync all files regardless of changes: -``` +```shell rsync -ahPI src/ user@domainorip:/path/to/www ``` To skip uploading the `src/install` folder, use the `--exclude` flag: -``` +```shell rsync -ahPI --exclude 'src/install' src/ user@domainorip:/path/to/www ```