Skip to content

Commit

Permalink
Merge pull request #29 from GawainLynch/symfony-5
Browse files Browse the repository at this point in the history
Symfony 5
  • Loading branch information
yannickl88 committed Mar 6, 2020
2 parents 0d2cb34 + 55fe584 commit e8e7a78
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
],
"require": {
"php": "^7.2",
"symfony/form": "^4.0",
"symfony/http-foundation": "^4.0"
"symfony/form": "^4.0||^5.0",
"symfony/http-foundation": "^4.0||^5.0"
},
"require-dev": {
"hostnet/phpcs-tool": "^8.3.11",
"phpunit/phpunit": "^8.0",
"symfony/debug": "^4.0",
"symfony/phpunit-bridge": "^4.0"
"symfony/debug": "^4.0||^5.0",
"symfony/phpunit-bridge": "^4.0||^5.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
21 changes: 21 additions & 0 deletions test/Form/Simple/SimpleFormProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Hostnet\Component\Form\FormHandlerInterface;
use Hostnet\Component\Form\NamedFormHandlerInterface;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -125,6 +126,11 @@ public function testNoForm(): void
->method('setForm')
->with($this->form);

$this->handler
->expects(self::once())
->method('getType')
->willReturn(FormType::class);

$provider = new SimpleFormProvider($this->factory);
$provider->handle(new Request(), $this->handler);
}
Expand Down Expand Up @@ -152,6 +158,11 @@ public function testNamedForm(): void
->method('setForm')
->with($this->form);

$named_handler
->expects(self::once())
->method('getType')
->willReturn(FormType::class);

$provider = new SimpleFormProvider($this->factory);
$provider->handle(new Request(), $named_handler);
}
Expand Down Expand Up @@ -179,6 +190,11 @@ public function testNamedFormWithNoName(): void
->method('setForm')
->with($this->form);

$named_handler
->expects(self::once())
->method('getType')
->willReturn(FormType::class);

$provider = new SimpleFormProvider($this->factory);
$provider->handle(new Request(), $named_handler);
}
Expand All @@ -190,6 +206,11 @@ public function testNoFormNotFound(): void
->method('getOptions')
->willReturn([]);

$this->handler
->expects(self::any())
->method('getType')
->willReturn(FormType::class);

$provider = new SimpleFormProvider($this->factory);

$this->expectException(FormNotFoundException::class);
Expand Down
1 change: 0 additions & 1 deletion test/FormHandler/HandlerTypeAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Hostnet\Component\FormHandler\Fixtures\TestType;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;

/**
Expand Down

0 comments on commit e8e7a78

Please sign in to comment.