Skip to content

Commit

Permalink
Merge pull request #438 from org-SCAN/issue-437-_REFACTOR_Use_Laravel…
Browse files Browse the repository at this point in the history
…_Sail

Issue 437  refactor use laravel sail
  • Loading branch information
lduf authored Nov 23, 2023
2 parents fa658ad + c9c0b97 commit 6a2df9a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ Site web du projet :)

# Start the project

## Using SAIL

To run the project, you must have docker and docker-compose installed on your machine.

Following the [laravel sail documentation](https://laravel.com/docs/10.x/sail#installing-sail-into-existing-applications.




## Using docker

### Using portainer on your machine
Expand Down Expand Up @@ -163,7 +172,14 @@ chmod -R 777 storage/
php artisan migrate:refresh --seed
```

# N4P API
# Configure your IDE

- We recommend using PHPStorm as IDE

## Run tests with PHPStorm

This configuration works if you have set up the project with sail.

You can find the API documentation
here : [https://documenter.getpostman.com/view/15399454/2s83tJGAMW](https://documenter.getpostman.com/view/15399454/2s83tJGAMW)
1. Go to `Run > Edit Configurations`
2. Add a new cli configuration
3.
2 changes: 1 addition & 1 deletion src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"require-dev": {
"brianium/paratest": "*",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^6.3",
"phpunit/phpunit": "^9.3.3",
Expand Down
3 changes: 1 addition & 2 deletions src/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
<server name="DB_DATABASE" value="testing"/>
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
Expand Down
5 changes: 3 additions & 2 deletions src/tests/Feature/PersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Models\Crew;
use App\Models\Refugee;
use App\Models\FieldRefugee;

class PersonTest extends PermissionsTest
{
Expand Down Expand Up @@ -31,9 +32,9 @@ public function test_get_person_api() {
// create 10 persons (associated to the default team)
$refugees = Refugee::factory()->count(10)->create();
// add content to these persons
/*foreach ($refugees as $refugee) {
foreach ($refugees as $refugee) {
$refugee->fields()->attach(FieldRefugee::random_fields());
}*/
}

// call the API
$response = $this->withHeader('Authorization',
Expand Down

0 comments on commit 6a2df9a

Please sign in to comment.