Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
test(refactor): TestCase reverted to MockeryTestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
sanakhandvsa committed Feb 2, 2024
1 parent 8aa4ff9 commit 1658796
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
12 changes: 7 additions & 5 deletions test/Olcs/src/Controller/Auth/LoginControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace OlcsTest\Controller\Auth;
Expand All @@ -22,14 +23,14 @@
use Laminas\Stdlib\Parameters;
use Laminas\View\Model\ViewModel;
use Mockery as m;
use Mockery\Adapter\Phpunit\MockeryTestCase;
use Mockery\MockInterface;
use Olcs\Auth\Adapter\SelfserveCommandAdapter;
use Olcs\Controller\Auth\LoginController;
use Olcs\Form\Model\Form\Auth\Login;
use Olcs\Logging\Log\Logger;
use PHPUnit\Framework\TestCase;

class LoginControllerTest extends TestCase
class LoginControllerTest extends MockeryTestCase
{
/**
* @var SelfserveCommandAdapter
Expand Down Expand Up @@ -493,6 +494,7 @@ public function postAction_FailedAuthentication_FlashesInvalidUsernameOrPassword

// Expect
$this->flashMessengerMock->expects('addMessage')
->times(2)
->withAnyArgs();

// Execute
Expand All @@ -517,7 +519,7 @@ public function postAction_FailedAuthentication_FlashesInvalidUsernameOrPassword
$this->redirectHelperMock->allows()->toRoute(LoginController::ROUTE_AUTH_LOGIN_GET)->andReturn($this->redirect());

// Expect
$this->flashMessengerMock->expects('addMessage')->withAnyArgs();
$this->flashMessengerMock->expects('addMessage')->times(2)->withAnyArgs();

// Execute
$this->sut->postAction($request, new RouteMatch([]), new Response());
Expand All @@ -541,7 +543,7 @@ public function postAction_FailedAuthentication_FlashesInvalidUsernameOrPassword
$this->redirectHelperMock->allows()->toRoute(LoginController::ROUTE_AUTH_LOGIN_GET)->andReturn($this->redirect());

// Expect
$this->flashMessengerMock->expects('addMessage')->withAnyArgs();
$this->flashMessengerMock->expects('addMessage')->times(2)->withAnyArgs();

// Execute
$this->sut->postAction($request, new RouteMatch([]), new Response());
Expand All @@ -565,7 +567,7 @@ public function postAction_FailedAuthentication_FlashesAccountDisabledWhenAuthen
$this->redirectHelperMock->allows()->toRoute(LoginController::ROUTE_AUTH_LOGIN_GET)->andReturn($this->redirect());

// Expect
$this->flashMessengerMock->expects('addMessage')->withAnyArgs();
$this->flashMessengerMock->expects('addMessage')->times(2)->withAnyArgs();

// Execute
$this->sut->postAction($request, new RouteMatch([]), new Response());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@
use Laminas\Validator\Translator\TranslatorInterface;
use Laminas\View\Model\ViewModel;
use Mockery as m;
use Mockery\Adapter\Phpunit\MockeryTestCase;
use Mockery\MockInterface;
use Olcs\Controller\Licence\Vehicle\ListVehicleController;
use Olcs\Form\Model\Form\Vehicle\ListVehicleSearch;
use Olcs\Table\TableEnum;
use PHPUnit\Framework\TestCase;

/**
* @see ListVehicleController
*/
class ListVehicleControllerTest extends TestCase
class ListVehicleControllerTest extends MockeryTestCase
{
protected const ROUTE_CONFIGURATION_FOR_LICENCE_WITH_REMOVED_VEHICLES_SHOWING_AND_FOCUSED = [
'licence/vehicle/list/GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
use Laminas\Stdlib\Parameters;
use Laminas\View\Model\ViewModel;
use Mockery as m;
use Mockery\Adapter\Phpunit\MockeryTestCase;
use Mockery\MockInterface;
use Olcs\Controller\Licence\Vehicle\ListVehicleController;
use Olcs\Controller\Licence\Vehicle\SwitchBoardController;
use Olcs\Form\Model\Form\Vehicle\SwitchBoard;
use Olcs\Session\LicenceVehicleManagement;
use PHPUnit\Framework\TestCase;

class SwitchBoardControllerTest extends TestCase
class SwitchBoardControllerTest extends MockeryTestCase
{
/**
* @var FlashMessenger
Expand Down
6 changes: 3 additions & 3 deletions test/Olcs/src/Controller/SessionTimeoutControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
use Laminas\Uri\Http;
use Laminas\View\Model\ViewModel;
use Mockery as m;
use Mockery\Adapter\Phpunit\MockeryTestCase;
use Olcs\Controller\SessionTimeoutController;
use LmcRbacMvc\Identity\IdentityProviderInterface;
use PHPUnit\Framework\TestCase;

/**
* @see SessionTimeoutController
*/
class SessionTimeoutControllerTest extends TestCase
class SessionTimeoutControllerTest extends MockeryTestCase
{
protected const COOKIE_NAME = 'cookie';
private $identityProviderClass = JWTIdentityProvider::class;
private IdentityProviderInterface $identityProviderMock;
protected Redirect $redirectHelperMock;
protected SessionTimeoutController $sut;
protected SessionTimeoutController $sut;

/**
* @test
Expand Down

0 comments on commit 1658796

Please sign in to comment.