yapro/symfony-http-test-ext

v1.0.1 2021-09-04 07:18 UTC

This package is not auto-updated.

Last update: 2024-04-24 09:56:35 UTC


README

Traits for solving the most common problems.

How to use

Create a class with the getHttpClient method, example: src/ExampleTestCase.php

What inside

When you write "YourTest extends \YaPro\SymfonyHttpTestExt\BaseTestCase" you will get the function:

  • $this->getHttpClient() - for working with http client
  • $this->getJsonHelper() - for working with json
  • $this->assertXXX() - for working with assert, example: assertJsonResponse($json)
  • etc: AssertionsTrait, ExtTrait

Useful information

Tests

docker build -t yapro/symfony-http-test-ext:latest -f ./Dockerfile ./
docker run --rm -v $(pwd):/app yapro/symfony-http-test-ext:latest bash -c "cd /app \
  && composer install --optimize-autoloader --no-scripts --no-interaction \
  && /app/vendor/bin/phpunit /app/tests"

Dev

docker build -t yapro/symfony-http-test-ext:latest -f ./Dockerfile ./
docker run -it --rm -v $(pwd):/app -w /app yapro/symfony-http-test-ext:latest bash
composer install -o