From 92f3ba71c5c11c752ddd68d614f5f0665e759220 Mon Sep 17 00:00:00 2001 From: Stefan Roehle Date: Thu, 5 Jan 2017 18:52:43 +0100 Subject: [PATCH] updates for Laravel 5.4 --- composer.json | 3 ++- src/FormBuilder.php | 10 +++++----- tests/FormBuilderTest.php | 16 ++++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index fd6e53a..926e9ca 100755 --- a/composer.json +++ b/composer.json @@ -37,5 +37,6 @@ "files": [ "src/helpers.php" ] - } + }, + "minimum-stability": "dev" } diff --git a/src/FormBuilder.php b/src/FormBuilder.php index 9b2fe1c..b10b808 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -7,7 +7,7 @@ use BadMethodCallException; use Illuminate\Support\Collection; use Illuminate\Support\HtmlString; use Illuminate\Contracts\View\Factory; -use Illuminate\Session\SessionInterface; +use Illuminate\Contracts\Session\Session; use Illuminate\Support\Traits\Macroable; use Illuminate\Contracts\Routing\UrlGenerator; @@ -49,7 +49,7 @@ class FormBuilder /** * The session store implementation. * - * @var \Illuminate\Session\SessionInterface + * @var \Illuminate\Contracts\Session\Session */ protected $session; @@ -1164,7 +1164,7 @@ class FormBuilder /** * Get the session store implementation. * - * @return \Illuminate\Session\SessionInterface $session + * @return \Illuminate\Contracts\Session\Session $session */ public function getSessionStore() { @@ -1174,11 +1174,11 @@ class FormBuilder /** * Set the session store implementation. * - * @param \Illuminate\Session\SessionInterface $session + * @param \Illuminate\Contracts\Session\Session $session * * @return $this */ - public function setSessionStore(SessionInterface $session) + public function setSessionStore(Session $session) { $this->session = $session; diff --git a/tests/FormBuilderTest.php b/tests/FormBuilderTest.php index e60212c..ff7b37e 100644 --- a/tests/FormBuilderTest.php +++ b/tests/FormBuilderTest.php @@ -78,7 +78,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testPasswordsNotFilled() { - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $session->shouldReceive('getOldInput')->never(); @@ -89,7 +89,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testFilesNotFilled() { - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $session->shouldReceive('getOldInput')->never(); @@ -113,7 +113,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testFormTextRepopulation() { - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $this->setModel($model = ['relation' => ['key' => 'attribute'], 'other' => 'val']); $session->shouldReceive('getOldInput')->twice()->with('name_with_dots')->andReturn('some value'); @@ -319,7 +319,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testFormSelectRepopulation() { $list = ['L' => 'Large', 'M' => 'Medium', 'S' => 'Small']; - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $this->setModel($model = ['size' => ['key' => 'S'], 'other' => 'val']); $session->shouldReceive('getOldInput')->twice()->with('size')->andReturn('M'); @@ -405,7 +405,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testFormCheckbox() { - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $session->shouldReceive('getOldInput')->withNoArgs()->andReturn([]); $session->shouldReceive('getOldInput')->with('foo')->andReturn(null); @@ -423,7 +423,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testFormCheckboxRepopulation() { - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $session->shouldReceive('getOldInput')->withNoArgs()->andReturn([1]); $session->shouldReceive('getOldInput')->once()->with('check')->andReturn(null); @@ -446,7 +446,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testFormCheckboxWithModelRelation() { - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $session->shouldReceive('getOldInput')->withNoArgs()->andReturn([]); $session->shouldReceive('getOldInput')->with('items')->andReturn(null); @@ -491,7 +491,7 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase public function testFormRadioRepopulation() { - $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); + $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session')); $session->shouldReceive('getOldInput')->with('radio')->andReturn(1);