Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repaired doc block types #245

Merged
merged 7 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/book/v4/introduction/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

Using your terminal, navigate inside the directory you want to download the project files into. Make sure that the directory is empty before proceeding to the download process. Once there, run the following command:

git clone https://github.com/dotkernel/api.git .
```shell
git clone https://github.com/dotkernel/api.git .
```
54 changes: 38 additions & 16 deletions docs/book/v4/introduction/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@

## Install dependencies

composer install
```shell
composer install
```

## Development mode

If you're installing the project for development, make sure you have development mode enabled, by running:

composer development-enable
```shell
composer development-enable
```

You can disable development mode by running:

composer development-disable
```shell
composer development-disable
```

You can check if you have development mode enabled by running:

composer development-status
```shell
composer development-status
```

## Prepare config files

Expand All @@ -34,11 +42,13 @@ Make sure you fill out the database credentials in `config/autoload/local.php` u
* create a new MySQL database - set collation to `utf8mb4_general_ci`
* run the database migrations by using the following command:

php vendor/bin/doctrine-migrations migrate
```shell
php vendor/bin/doctrine-migrations migrate
```

This command will prompt you to confirm that you want to run it.

WARNING! You are about to execute a migration in database "..." that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
> WARNING! You are about to execute a migration in database "..." that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:

Hit `Enter` to confirm the operation.

Expand All @@ -48,40 +58,52 @@ Hit `Enter` to confirm the operation.

To list all the fixtures, run:

php bin/doctrine fixtures:list
```shell
php bin/doctrine fixtures:list
```

This will output all the fixtures in the order of execution.

To execute all fixtures, run:

php bin/doctrine fixtures:execute
```shell
php bin/doctrine fixtures:execute
```

To execute a specific fixture, run:

php bin/doctrine fixtures:execute --class=FixtureClassName
```shell
php bin/doctrine fixtures:execute --class=FixtureClassName
```

More details on how fixtures work can be found here: https://github.com/dotkernel/dot-data-fixtures#creating-fixtures

## Test the installation

php -S 0.0.0.0:8080 -t public
```shell
php -S 0.0.0.0:8080 -t public
```

Sending a GET request to the [home page](http://0.0.0.0:8080/) should output the following message:

{
"message": "Welcome to DotKernel API!"
}
> {"message": "Welcome to DotKernel API!"}

## Running tests

The project has 2 types of tests : functional and unit tests, you can run both types at the same type by executing this command:

php vendor/bin/phpunit
```shell
php vendor/bin/phpunit
```

## Running unit tests

vendor/bin/phpunit --testsuite=UnitTests --testdox --colors=always
```shell
vendor/bin/phpunit --testsuite=UnitTests --testdox --colors=always
```

## Running functional tests

vendor/bin/phpunit --testsuite=FunctionalTests --testdox --colors=always
```shell
vendor/bin/phpunit --testsuite=FunctionalTests --testdox --colors=always
```
16 changes: 11 additions & 5 deletions docs/book/v4/introduction/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ The benefit of Doctrine for the programmer is the ability to focus on the object

Our documentation is Postman based. We use the following files in which we store information about every available endpoint ready to be tested:

documentation/DotKernel_API.postman_collection.json
documentation/DotKernel_API.postman_environment.json
* documentation/DotKernel_API.postman_collection.json
* documentation/DotKernel_API.postman_environment.json

## Hypertext Application Language

Expand Down Expand Up @@ -94,12 +94,18 @@ One of the best ways to ensure the quality of your product is to create and run

We have 2 types of tests: functional and unit tests, you can run both types at the same type by executing this command:

php vendor/bin/phpunit
```shell
php vendor/bin/phpunit
```

## Running unit tests

vendor/bin/phpunit --testsuite=UnitTests --testdox --colors=always
```shell
vendor/bin/phpunit --testsuite=UnitTests --testdox --colors=always
```

## Running functional tests

vendor/bin/phpunit --testsuite=FunctionalTests --testdox --colors=always
```shell
vendor/bin/phpunit --testsuite=FunctionalTests --testdox --colors=always
```
Loading
Loading