subject = new LtiProviderValidator(); $factory = new ValidatorsFactory(); $factory->setServiceLocator( $this->getServiceLocatorMock( [ ValidationRegistry::class => new ValidationRegistry() ] ) ); $this->subject->setServiceLocator( $this->getServiceLocatorMock( [ ValidationRegistry::class => new ValidationRegistry(), ValidatorsFactory::class => $factory, LtiProviderFieldsMapper::class => new LtiProviderFieldsMapper(), ] ) ); } public function testValidateBrokenArray(): void { $this->expectExceptionMessage('"key": This field is required'); $this->expectException(InvalidArgumentException::class); $this->subject->validateArray('1.1', []); } public function testValidateProperArray(): void { $this->assertNull( $this->subject->validateArray( '1.1', [ 'key' => '1', 'secret' => '1', 'ltiVersion' => '1', ] ) ); } }