Forums / Developer / Testing eZ code

Testing eZ code

Author Message

Paul Forsyth

Friday 23 January 2004 3:09:04 am

Im considering how best to test code that I develop. I usually work soley with extensions, build a few libraries in to help me out, with little need of kernel changes except in specific cases.

Has anyone developed unit/integration/regression tests with systems like eZ in PHP before?

I've used apis like JUnit and I find its methodology very potent. One of its variations, PHPUnit, but it only appears to handle PHP scripts and not the client/server interaction needed to test eZ.

I notice PHPUnit now requires PHP 5, doh!

http://pear.php.net/package-info.php?package=PHPUnit

The use of JWebUnit/HttpUnit may be a type of answer as it appears to handle client/server interaction, but for the fact it requires Java unit tests.

http://jwebunit.sourceforge.net/
http://httpunit.sourceforge.net/

What are peoples experience of such testing?

Ideally I'd like to release unit tests for all code I write, both internally and publically on pubsvn.

paul

Paul Forsyth

Friday 30 January 2004 6:09:48 am

Lovely :)

http://pubsvn.ez.no/viewcvs/ezp/trunk/tests/

paul

eZ debug

Timing: Jan 18 2025 22:21:02
Script start
Timing: Jan 18 2025 22:21:02
Module start 'content'
Timing: Jan 18 2025 22:21:03
Module end 'content'
Timing: Jan 18 2025 22:21:03
Script end

Main resources:

Total runtime0.7088 sec
Peak memory usage4,096.0000 KB
Database Queries53

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.0156180.8516
Module start 'content' 0.00560.6971 769.8672429.4844
Module end 'content' 0.70270.0060 1,199.351642.1406
Script end 0.7087  1,241.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4090140.0002
Check MTime0.00120.1675140.0001
Mysql Total
Database connection0.00070.092110.0007
Mysqli_queries0.672694.8964530.0127
Looping result0.00050.0723510.0000
Template Total0.682896.320.3414
Template load0.00170.240220.0009
Template processing0.681196.096620.3406
Template load and register function0.00010.017110.0001
states
state_id_array0.00060.091710.0006
state_identifier_array0.00090.126820.0004
Override
Cache load0.00140.1965180.0001
Sytem overhead
Fetch class attribute can translate value0.00070.099710.0007
Fetch class attribute name0.00090.132220.0005
XML
Image XML parsing0.00010.016910.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00250.3565120.0002
String conversion0.00010.009430.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs