This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: VOL-5103 update selfserve type of licence controller as it share…
…s the updated controller from common
- Loading branch information
Showing
3 changed files
with
13 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,31 +4,26 @@ | |
|
||
use Common\FormService\Form\Lva\TypeOfLicence\ApplicationTypeOfLicence as CommonLicenceTypeOfLicence; | ||
use Common\FormService\FormServiceManager; | ||
use Common\Rbac\Service\Permission; | ||
use Common\Service\Helper\FormHelperService; | ||
use Common\Service\Helper\GuidanceHelperService; | ||
use Laminas\Form\Form; | ||
use LmcRbacMvc\Service\AuthorizationService; | ||
|
||
/** | ||
* Application Type Of Licence Form | ||
* | ||
* @author Alex Peshkov <[email protected]> | ||
*/ | ||
class ApplicationTypeOfLicence extends CommonLicenceTypeOfLicence | ||
{ | ||
protected FormHelperService $formHelper; | ||
protected AuthorizationService $authService; | ||
protected Permission $permissionService; | ||
protected GuidanceHelperService $guidanceHelper; | ||
protected FormServiceManager $formServiceLocator; | ||
|
||
public function __construct( | ||
FormHelperService $formHelper, | ||
AuthorizationService $authService, | ||
Permission $permissionService, | ||
GuidanceHelperService $guidanceHelper, | ||
FormServiceManager $formServiceLocator | ||
) { | ||
$this->guidanceHelper = $guidanceHelper; | ||
parent::__construct($formHelper, $authService, $formServiceLocator); | ||
parent::__construct($formHelper, $permissionService, $formServiceLocator); | ||
} | ||
/** | ||
* Alter form | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
namespace OlcsTest\FormService\Form\Lva\TypeOfLicence; | ||
|
||
use Common\Rbac\Service\Permission; | ||
use Common\Service\Helper\FormHelperService; | ||
use Common\Service\Helper\GuidanceHelperService; | ||
use Laminas\Form\ElementInterface; | ||
|
@@ -10,13 +11,7 @@ | |
use Olcs\FormService\Form\Lva\TypeOfLicence\ApplicationTypeOfLicence; | ||
use Laminas\Form\Form; | ||
use Common\FormService\FormServiceManager; | ||
use LmcRbacMvc\Service\AuthorizationService; | ||
|
||
/** | ||
* Application Type of Licence Form Test | ||
* | ||
* @author Alex Peshkov <[email protected]> | ||
*/ | ||
class ApplicationTypeOfLicenceTest extends MockeryTestCase | ||
{ | ||
/** | ||
|
@@ -27,17 +22,20 @@ class ApplicationTypeOfLicenceTest extends MockeryTestCase | |
protected $fh; | ||
|
||
protected $fsm; | ||
private $permission; | ||
|
||
public function setUp(): void | ||
{ | ||
$this->fh = m::mock(FormHelperService::class)->makePartial(); | ||
$this->guidanceHelper = m::mock(GuidanceHelperService::class); | ||
$this->fsm = m::mock(FormServiceManager::class)->makePartial(); | ||
$this->sut = new ApplicationTypeOfLicence($this->fh, m::mock(AuthorizationService::class), $this->guidanceHelper, $this->fsm); | ||
$this->permission = m::mock(Permission::class); | ||
$this->sut = new ApplicationTypeOfLicence($this->fh, $this->permission, $this->guidanceHelper, $this->fsm); | ||
} | ||
|
||
public function testAlterForm() | ||
public function testAlterForm(): void | ||
{ | ||
$this->permission->expects('isInternalReadOnly')->withNoArgs()->andReturnFalse(); | ||
|
||
$mockForm = m::mock(Form::class) | ||
->shouldReceive('get') | ||
|