Yes, SRF does not have a lot of testing, so thx for improving and sorry for not 
having much to copy from! Maybe [0] could give you an idea on how to create 
your mock object. See [1] for documentation on how to work with mock objects.
Cheers
Stephan
[0] 
https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/master/tests/phpunit/Unit/Formats/TreeTest.php#L56
[1] https://phpunit.de/manual/4.8/en/test-doubles.html#test-doubles.mock-objects

> -------- Original Message --------
> Subject: [SMW-devel] SMWQueryResult mock object for testing 
> SemanticResultFormat
> Local Time: August 3, 2017 9:40 AM
> UTC Time: August 3, 2017 7:40 AM
> From: planeten...@web.de
> To: Semediawiki-devel@lists.sourceforge.net
> I want to enhance existing SRF graph format test. My idea is, to create
> a mock SMWQueryResult (=test data) that will be passed to function
> getResultText (at the moment, could be getGraphvizCode or something later).
> I had a look at existing tests [1] and docs [2][3] as well as
> CoreMockObjectRepository Class [4] but could not find an example how to
> create a mock for SMWQueryResult.
> Is creating a mock for SMWQueryResult a good idea at all?
> Could someone help with an example?
> Many thx!
> [1]
> https://github.com/SemanticMediaWiki/SemanticResultFormats/tree/master/tests/phpunit/Unit/Formats
> [2] https://www.semantic-mediawiki.org/wiki/Help:Using_mock_objects
> [3]
> https://www.semantic-mediawiki.org/wiki/Writing_result_printers#Writing_tests
> [4]
> https://doc.semantic-mediawiki.org/classSMW_1_1Tests_1_1Utils_1_1Mock_1_1CoreMockObjectRepository.html#a0346be0a0d6284eaea8e79228455ac09
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world"s most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to