Skip to content
Snippets Groups Projects
Select Git revision
  • f0b2422c37ec9987eb8748fb82bee53b75f46c48
  • main default protected
2 results

README.md

Blame
  • DummyLDAPApiProvider.php 829 B
    <?php
    
    declare(strict_types=1);
    
    namespace Dbp\Relay\BasePersonConnectorLdapBundle\TestUtils;
    
    use Dbp\Relay\BasePersonBundle\Entity\Person;
    use Dbp\Relay\BasePersonConnectorLdapBundle\API\LDAPApiProviderInterface;
    use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
    
    class DummyLDAPApiProvider implements LDAPApiProviderInterface
    {
        /**
         * Allows manipulation of the person with a hash array of $attributes at the end of "personFromUserItem".
         */
        public function personFromUserItemPostHook(array $attributes, Person $person, bool $full = false)
        {
            $person->setExtraData('test', 'my-test-string');
        }
    
        public function getPersonForExternalServiceHook(string $service, string $serviceID): Person
        {
            throw new BadRequestHttpException("Unknown service: $service");
        }
    }