PmWikiDevelopment.Testing History

Hide minor edits - Show changes to output - Cancel

 
 
February 12, 2014, at 10:59 AM by MichaelPaulukonis -
Changed line 7 from:
Issue: Chunks of PmWiki core-code will need to be mocked or something.
to:
Issue: Chunks of PmWiki core-code will need to be mocked, or a working install of pmwiki will be required. (Can such a thing be set up via a script?)
 
 
February 12, 2014, at 10:57 AM by MichaelPaulukonis -
Changed lines 1-2 from:
(:description the thing that this thing is:)
to:
(:description testing pmwiki extensions:)
Changed lines 70-71 from:

to:
[[PHP.UnitTesting]]
[[PHP.Lint]]
[[PHP.Debugging]]


Added line 77:
[[!php]] [[!development]] [[!testing]]
 
 
December 16, 2013, at 09:16 AM by OtherMichael - UNIT TEST ALL THE THINGS!
Changed lines 66-67 from:

If these problems are not readily surmounted, functions that do not use pmwiki-functions can be refactored into separate files for the purpose of testing.
to:
'''UPDATE 2013.12.16:''' I can confirm that pmwiki.php can be included and used for testing; I do not yet know what "best practices" may be... hope to have minimal updates in here this week.
 
 
December 14, 2013, at 11:25 PM by OtherMichael -
Added lines 24-64:

'''UPDATE:''' That may not be the case, as I found this 2007 message, so-far undocumented on pmwiki.org (save in the changelog @ PmWiki:ChangeLog#v22022):

>>blockq<<

(:source lang=text:)
From: Patrick R. Michaud <pmichaud <at> pobox.com>
Subject: Re: Using pmwiki's functions without building the wiki
Newsgroups: gmane.comp.web.wiki.pmwiki.user
Date: 2007-01-15 18:52:11 GMT (6 years, 47 weeks, 4 days, 21 hours and 20 minutes ago)

On Mon, Jan 15, 2007 at 05:50:57PM +0100, Wouter Groeneveld wrote:
>    I would like to use IncludeText() so I can access the text in my wiki
>    pages, but I do _NOT_ want to generate the whole skin and page.
>    So when I include("pmwiki.php") > this automatically generates my wiki. I
>    don't want that, I only want to display the includeText() output.
>
>    Is there any possibility to tell pmwiki not do do anything? I only want to
>    be able to use the function includetext()

For 2.2.0-beta22 I'm adding an $EnableActions configuration variable;
if set, then PmWiki will do all of its initialization and other work,
but won't call any $HandleActions routines.

Then you can do the following:

    $EnableActions = 0;
    include('pmwiki.php');

This will initialize PmWiki (along with any configuration/customizations
that are being made, e.g. from local/config.php), but won't actually
perform any actions.  The caller can then call the desired action
or other functions as desired.

Would that work for your needs?

Pm
(:sourceend:)

->([[http://article.gmane.org/gmane.comp.web.wiki.pmwiki.user/37694|source]])
>><<
 
 
December 14, 2013, at 06:31 PM by OtherMichael - notes on unit-testing pmwiki
Added lines 1-33:
(:description the thing that this thing is:)

[[#general]]
!! General Notes
I'm looking into unit-testing with [[PHP/UnitTesting|SimpleUnit]]

Issue: Chunks of PmWiki core-code will need to be mocked or something.

At the very least, 'pmwiki' will need to be defined, as that's usually the first check in code:

(:source lang=php:)
<?php if (!defined('PmWiki')) exit();
(:sourceend:)


however, that's pretty simple. [@pmwiki.php@] contains:

(:source lang=php:)
define('PmWiki',1);
(:sourceend:)


Not sure about other core functions or code. Including [@pmwiki.php@] is, I believe, a non-starter, as it will output an entire web-page by default, and no way of turning that off AFAIK.


If these problems are not readily surmounted, functions that do not use pmwiki-functions can be refactored into separate files for the purpose of testing.

[[#seealso]]
!! See Also


[[#categories]][[#tags]]
!! Category Tags