[Owncloud] Making internal methods public for unit testing

Frank Karlitschek frank at owncloud.org
Mon Jun 4 10:53:02 UTC 2012


On 04.06.2012, at 12:50, Bart Visscher <bartv at thisnet.nl> wrote:

> On Fri, Jun 01, 2012 at 06:38:12PM +0100, Sam Tuke wrote:
>> OCP\User currently provides access to user-related methods commonly used by 
>> apps. For unit testing however, access to more methods are required, such as 
>> useBackend(), in order to make use of the dummy OC_User_Dummy user management 
>> backend.
>> 
>> I imagine that other methods will also require access via a public interface 
>> for unit testing other functionality (not just relating to user.php).
>> 
>> Therefore, although I can provide access to unit tests by simply adding 
>> wrappers for methods like useBackend() to OCP\User, I wonder whether there is 
>> a better option which doesn't result in a slew of new wrappers duplicating 
>> input and output?
> 
> What are you testing, if it is the core, why not use the core OC_ classes?

Same question from me :-)
I donĀ“t think we should make our public API bigger than needed only because we want to use unit tests.
Calling internal classes for unit tests is totally fine. As long as we are not surprised when they break sometimes ;-)



> Bart
> 
>> 
>> Best,
>> 
>> Sam.
>> -- 
>> Sam Tuke
>> British Team Coordinator
>> Free Software Foundation Europe
>> IM : samtuke at jabber.fsfe.org
>> Latest UK Free Software news: uk.fsfe.org
>> Is freedom important to you? Join the fellowship.fsfe.org
> 
> 
> 
>> _______________________________________________
>> Owncloud mailing list
>> Owncloud at kde.org
>> https://mail.kde.org/mailman/listinfo/owncloud
> 
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud




More information about the Owncloud mailing list