diff --git a/test/Olcs/src/FormService/Form/Lva/OperatingCentres/VariationOperatingCentresTest.php b/test/Olcs/src/FormService/Form/Lva/OperatingCentres/VariationOperatingCentresTest.php index 6fee025b6..0ed798512 100644 --- a/test/Olcs/src/FormService/Form/Lva/OperatingCentres/VariationOperatingCentresTest.php +++ b/test/Olcs/src/FormService/Form/Lva/OperatingCentres/VariationOperatingCentresTest.php @@ -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); @@ -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') diff --git a/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/ApplicationSoleTraderTest.php b/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/ApplicationSoleTraderTest.php index 5486a5e12..1bde0b95e 100644 --- a/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/ApplicationSoleTraderTest.php +++ b/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/ApplicationSoleTraderTest.php @@ -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); diff --git a/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/LicenceSoleTraderTest.php b/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/LicenceSoleTraderTest.php index 315fc50e5..3707458e8 100644 --- a/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/LicenceSoleTraderTest.php +++ b/test/Olcs/src/FormService/Form/Lva/People/SoleTrader/LicenceSoleTraderTest.php @@ -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); @@ -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);