Page 1 of 1

OPINION: Make/Accessible, a lightweight PHP package that let you test singleton and encapsulated classes.

Posted: Sat Nov 04, 2017 3:48 pm
by e200
Hi everyone, its my first time here and I'm happy to finally have founded a place like this.

I bring today a solution for automated tests: Make/Accessible.

A lightweight PHP package that let you easily access and test singleton classes and inaccessible instance members like private properties and protected methods.

With this package you can now:
  • Call inaccessible methods
  • Set values into inaccessible properties
  • Get values from inaccessible properties
  • Instantiate singleton classes
And based on your feedback soon you will also be able to easily test abstract class methods too.

People complain a lot about encapsulated class members: "Their hard to test! We need to use reflection!" Blablabla... I think i solved this problem.

People also complain a lot about singleton classes: "Their hard to test! We can only have one instance! One change in the instance will also influence other tests!" Blablabla... I think i also solved this problem.

Please, read the usage to better understand witch problems this package solves, I'm open to any criticism and your feedback is really really important to me, or this project will die since I'm not helping anyone! Thanks for read and I'm waiting for your opinion if I'm loosing my time writing it or if i should continue!!! :D

Re: OPINION: Make/Accessible, a lightweight PHP package that let you test singleton and encapsulated classes.

Posted: Sun Nov 05, 2017 8:17 am
by Strider64
First of all I have been told by PHP gurus that one should not be using too many singleton classes and second if one writes a class that the class should be able to be UNIT tested without using a PHP package.