Skip to content

Commit

Permalink
Upgrade to Symfony 4.3 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoalves-kununu authored May 31, 2019
1 parent 251273f commit 3b80087
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"type": "library",
"require": {
"php": "^7.2",
"symfony/framework-bundle": "^4.2",
"symfony/framework-bundle": "^4.3",
"kununu/data-fixtures": "^1.0.1",
"symfony/config": "^4.2",
"symfony/dependency-injection": "^4.2",
"symfony/http-kernel": "^4.2"
"symfony/config": "^4.3",
"symfony/dependency-injection": "^4.3",
"symfony/http-kernel": "^4.3"
},
"require-dev": {
"phpunit/phpunit": "^8.1",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"doctrine/doctrine-bundle": "^1.10",
"symfony/browser-kit": "^4.2"
"symfony/browser-kit": "^4.3"
},
"suggest": {
"ext-pdo_sqlite": "To run Integration Tests."
Expand Down
19 changes: 13 additions & 6 deletions src/Test/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

namespace Kununu\TestingBundle\Test;

use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Component\HttpFoundation\Response;

abstract class WebTestCase extends FixturesAwareTestCase
{
final protected function getClient() : Client
final protected function doRequest(RequestBuilder $builder): Response
{
return static::createClient();
}
$this->initClient();

/** @var KernelBrowser $client */
$client = static::$client;

final protected function doRequest(Client $client, RequestBuilder $builder): Response
{
$client->request(...$builder->build());

$response = $client->getResponse();
Expand All @@ -30,4 +30,11 @@ final protected function doRequest(Client $client, RequestBuilder $builder): Res

return $response;
}

private function initClient() : void
{
if (!static::$client) {
static::createClient();
}
}
}
1 change: 0 additions & 1 deletion tests/Test/WebTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ final class WebTestCaseTest extends WebTestCase
public function testDoRequest()
{
$response = $this->doRequest(
$this->getClient(),
RequestBuilder::aGetRequest()->withUri('/app/response')
);

Expand Down

0 comments on commit 3b80087

Please sign in to comment.