Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added interfaces for Connector and Powerdns #72

Merged
merged 4 commits into from
Jun 7, 2021
Merged

Added interfaces for Connector and Powerdns #72

merged 4 commits into from
Jun 7, 2021

Conversation

frankvanhest
Copy link
Contributor

@frankvanhest frankvanhest commented May 27, 2021

This will PR will add interface for Connector and PowerDNS.

Description

The ConnectorInterface will improve implementing your own connector. In the current version you can only extend the class Connector and make modifications, but you're still limited to the use of Guzzle.

The PowerdnsInterface makes it easier for applications which uses this package to deal with testing when communication with PowerDNS without having to run PowerDNS when running tests.

Motivation and context

This fixes #71

When using dependency injection within your own application it is useful to have interfaces as typehints for function arguments. This way the service container can injection the needed implementation for each situation. When testing your own application you can inject a dummy Powerdns class which implements the interface, so you don't have to run PowerDNS locally. This is extremely useful for behaviour tests which only deals with an applications behaviour and not with infrastructure.

How has this been tested?

n/a

Screenshots (if appropriate)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests pass.

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • [n/a] I have added tests to cover my changes.
  • [n/a] If my change requires a change to the documentation, I have updated it accordingly.

If you're unsure about any of these, don't hesitate to ask. We're here to help!

@trizz
Copy link
Member

trizz commented May 31, 2021

Hi @frankvanhest,

Thanks for your PR! The changes are looking fine by me, I see no potential problems with this approach. I want to test some other stuff this week, and then I'll merge your PR.

@trizz trizz merged commit 1ea298f into exonet:master Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define interfaces for classes PowerDNS and Connector for easy integration with testsuites
2 participants