resolverNotFoundException example

return $map;
    }

    private function getResolver(string $key): AbstractFkResolver
    {
        foreach ($this->resolvers as $resolver) {
            if ($resolver::getName() === $key) {
                return $resolver;
            }
        }

        throw ApiException::resolverNotFoundException($key);
    }
}
public function testInvalidSyncOperationException(): void
    {
        $exception = ApiException::invalidSyncOperationException('message');

        static::assertEquals(ApiException::API_INVALID_SYNC_OPERATION_EXCEPTION, $exception->getErrorCode());
        static::assertEquals('message', $exception->getMessage());
    }

    public function testResolverNotFoundException(): void
    {
        $exception = ApiException::resolverNotFoundException('name');

        static::assertEquals(ApiException::API_RESOLVER_NOT_FOUND_EXCEPTION, $exception->getErrorCode());
        static::assertEquals('Foreign key resolver for key name not found', $exception->getMessage());
    }

    public function testUnsupportedAssociation(): void
    {
        $exception = ApiException::unsupportedAssociation('name');

        static::assertEquals(ApiException::API_UNSUPPORTED_ASSOCIATION_FIELD, $exception->getErrorCode());
        static::assertEquals('Unsupported association for field name', $exception->getMessage());
    }
Home | Imprint | This part of the site doesn't use cookies.