Merge pull request #350 from MyIgel/master

Fixes for unittests
This commit is contained in:
msquare 2017-11-19 12:05:31 +01:00 committed by GitHub
commit 4779771d08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,7 @@ use Engelsystem\Routing\UrlGenerator;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject as MockObject; use PHPUnit_Framework_MockObject_MockObject as MockObject;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface as StorageInterface;
class HelpersTest extends TestCase class HelpersTest extends TestCase
{ {
@ -130,7 +131,9 @@ class HelpersTest extends TestCase
*/ */
public function testSession() public function testSession()
{ {
$sessionStorage = $this->getMockForAbstractClass(StorageInterface::class);
$sessionMock = $this->getMockBuilder(Session::class) $sessionMock = $this->getMockBuilder(Session::class)
->setConstructorArgs([$sessionStorage])
->getMock(); ->getMock();
$this->getAppMock('session', $sessionMock); $this->getAppMock('session', $sessionMock);

View File

@ -109,7 +109,9 @@ class SessionServiceProviderTest extends ServiceProviderTest
*/ */
private function getSessionMock() private function getSessionMock()
{ {
$sessionStorage = $this->getMockForAbstractClass(StorageInterface::class);
return $this->getMockBuilder(Session::class) return $this->getMockBuilder(Session::class)
->setConstructorArgs([$sessionStorage])
->setMethods(['start']) ->setMethods(['start'])
->getMock(); ->getMock();
} }