Skip to content

Commit

Permalink
Merge pull request #245 from dotkernel/issue-243
Browse files Browse the repository at this point in the history
Repaired doc block types
  • Loading branch information
arhimede authored May 8, 2024
2 parents 05de6e4 + 69ac09f commit 051fbd4
Show file tree
Hide file tree
Showing 4 changed files with 588 additions and 516 deletions.
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

0 comments on commit 051fbd4

Please sign in to comment.