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

Commit

Permalink
test(refactor): getServiceLocator call to return LaminasServiceManager
Browse files Browse the repository at this point in the history
  • Loading branch information
sanakhandvsa committed Jan 10, 2024
1 parent e5bc57a commit bad07b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class VariationOperatingCentresTest extends MockeryTestCase

public function setUp(): void
{
$sm = m::mock('\Laminas\ServiceManager\ServiceManager')
->makePartial()
->setAllowOverride(true);
$this->tableBuilder = m::mock();
$this->translator = m::mock(TranslationHelperService::class);
$this->form = m::mock(Form::class);
Expand All @@ -47,7 +50,7 @@ public function setUp(): void
$fsm->setService('Table', $this->tableBuilder);
$fsm->setService('Helper\Translation', $this->translator);
$fsm->allows('getServiceLocator')
->andReturns($this->form);
->andReturns($sm);

$lvaVariation = m::mock(Form::class);
$lvaVariation->shouldReceive('alterForm')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ class ApplicationSoleTraderTest extends MockeryTestCase
public function setUp(): void
{
$this->formHelper = m::mock('\Common\Service\Helper\FormHelperService');
$this->sm = m::mock('\Laminas\ServiceManager\ServiceManager')
->makePartial()
->setAllowOverride(true);
$this->form = m::mock(Form::class);

/** @var FormServiceManager fsm */
$this->fsm = m::mock('\Common\FormService\FormServiceManager')->makePartial();
$this->fsm->allows('getServiceLocator')
->andReturns($this->form);
$this->fsm->setServiceLocator($this->sm);

$this->peopleLvaService = m::mock(PeopleLvaService::class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class LicenceSoleTraderTest extends MockeryTestCase
public function setUp(): void
{
$this->formHelper = m::mock('\Common\Service\Helper\FormHelperService');

$this->sm = m::mock('\Laminas\ServiceManager\ServiceManager')
->makePartial()
->setAllowOverride(true);

$this->form = m::mock(Form::class);

$this->mockLicenceService = m::mock(Form::class);
Expand All @@ -41,7 +46,7 @@ public function setUp(): void
/** @var FormServiceManager fsm */
$this->fsm = m::mock('\Common\FormService\FormServiceManager')->makePartial();
$this->fsm->allows('getServiceLocator')
->andReturns($this->form);
->andReturns($this->sm);
$this->fsm->setService('lva-licence', $this->mockLicenceService);

$this->sut = new Sut($this->formHelper, m::mock(AuthorizationService::class), $this->peopleLvaService, $this->fsm);
Expand Down

0 comments on commit bad07b6

Please sign in to comment.