Closed olivermack closed 7 years ago
Hey Oliver,
great, that you're offering an extra set of eyes :)
Since it's a driver, I liked the "integration" tests a lot, as they covered the complete request/response cycle, to the server.
However if you like to also write some real unit tests, please do so. The more, the better :)
Greetings
Hey @frankmayer,
as I've seen now (and I'm just scratching the surface: implementing tests for the second class) there are issues in the code which are making the implementation of good ol' unit tests a little pain in the ass (sorry). I stumbled over codes that have plenty of hardcoded dependencies which means that they cannot be mocked easily, such as static helpers called in constructors to name one (e.g. HttpResponse.php which is a very central part).
Are there any refactorings planned for this lib? Maybe when your ArangoDB-PHP-Core is finished and some of the central parts of the current driver's lib may be/are obsolete? I'd like to see the official PHP driver for arangodb to be more S.O.L.I.D. and I'm willing to support where I can (at least at some points :)).
Cheers
Closing this, as an implementation of real unit tests with the current state of the driver seems difficult. If there should be any changes to the state of the driver we may re-open this.
As for the ArangoDB-PHP-Core driver, there was no time to develop it further, but there might be some time now.
Hey,
those tests implemented yet are quite extensive and have many dependencies in one tested logical unit. The
GraphBasicTest
for example does neither test theGraph
class, nor theGraphHandler
class directly; instead it addresses an integration of both of them. TheGraphExtendedTest
does so, too.So, I'm asking myself if it would be nice to differ between unit and integration tests (or: to implement unit tests which follow some more of those best practices known).
What do you think? Any opinions on that?
Cheers