Compare commits

..

1 Commits

Author SHA1 Message Date
Armel van Ravels
0dcffc50e1 Add startup instructions
Some checks failed
PHP Composer / build (pull_request) Failing after 7m1s
2024-08-30 22:43:30 +02:00
5 changed files with 15 additions and 20 deletions

View File

@@ -23,23 +23,12 @@ jobs:
- name: Validate composer.json
run: composer validate
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: get-hash
with:
patterns: |-
go.sum
**/composer.json
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ steps.get-hash.outputs.hash }}
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-

View File

@@ -1,17 +1,19 @@
EXEC="docker compose exec php"
up:
docker compose up -d
start: up composer-install
composer-install:
docker compose exec -T php composer install
"$(EXEC)" composer install
stop:
docker compose stop
cmd:
docker compose exec php sh
"$(EXEC)" sh
phpstan:
docker compose exec -T php vendor/bin/phpstan analyse src --level 8
"$(EXEC)" vendor/bin/phpstan analyse src --level 8
cs-fix:
docker compose exec -T php vendor/bin/php-cs-fixer fix --allow-risky=yes
"$(EXEC)" vendor/bin/php-cs-fixer fix --allow-risky=yes
test:
docker compose exec -T php vendor/bin/pest
"$(EXEC)" vendor/bin/pest

View File

@@ -7,8 +7,6 @@ cp .env.example .env
make start
```
You will now have a webserver running on localhost:443 and localhost:80
### How to stop
```
make stop

View File

@@ -16,4 +16,4 @@ it('view is rendered', function (): void {
$body->rewind();
expect($body->getContents())->toBe('Welkom');
});
});

View File

@@ -8,6 +8,12 @@ use Psr\Http\Message\ResponseInterface;
function get(string $uri, array $headers = [], array $cookies = []): ResponseInterface
{
try {
app(\App\Core\EnvironmentLoader::class)->load(\App\Enums\Environment::Testing);
} catch (\Exception) {
app(\App\Core\EnvironmentLoader::class)->load();
}
$router = app(Router::class);
$request = new ServerRequest(uri: $uri, method: 'GET', headers: $headers, cookieParams: $cookies);