Re: [PHP-CVS] cvs: php4 /ext/xslt/tests xslt_process-001.phpt xslt_set_object.phpt xslt_setopt.phpt

2002-10-30 Thread Melvyn Sopacua
At 22:57 29-10-2002, Marcus Börger wrote:


  --use var_dump()


Why?

Please Marcus - discuss with the person who developed the test before 
altering it's behavior.
What's the positive side of using var_dump?

Here are the negatives:
-- iconv could be unsupported (which was on my list of things to fix for 
this and other tests)
   If the entity fails, it fails in both cases and so the meta test 
succeeds but, just because
   a character misses the test fails for no good reason.
-- indenting is something being discussed on the Sablist and so may change 
and can be
   platform specific. However indenting is handled, it will be handled 
consistently for a
   platform.

IMO comparison is the way to do it here, not var_dump.

Let's here the positives?



Met vriendelijke groeten / With kind regards,

Webmaster IDG.nl
Melvyn Sopacua


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php4 /ext/xslt/tests xslt_process-001.phpt xslt_set_object.phpt xslt_setopt.phpt

2002-10-30 Thread Marcus Boerger
At 11:38 30.10.2002, Melvyn Sopacua wrote:

At 22:57 29-10-2002, Marcus Börger wrote:


  --use var_dump()


Why?

Please Marcus - discuss with the person who developed the test before 
altering it's behavior.
What's the positive side of using var_dump?

I saw no need in first comparing results and then compare the result of the 
compare
again in run-test.php. The far better way seems to present the output and 
compare the
expected output in run-test.php. The reason i did was that i was wondering 
what i would
do when i got any .diff .out from a user for whom the test faild? I would 
receive somthing
like unexpected result. Wow that would be a good help in finding the bug.

Here are the negatives:
-- iconv could be unsupported (which was on my list of things to fix for 
this and other tests)
   If the entity fails, it fails in both cases and so the meta test 
succeeds but, just because
   a character misses the test fails for no good reason.

We can rewrite the test so it becomes independant from iconv.


-- indenting is something being discussed on the Sablist and so may change 
and can be
   platform specific. However indenting is handled, it will be handled 
consistently for a
   platform.

If above is reason enough to display the full result we could use 
--EXPECTREGEX--
und skip over any whitespace. But your original compare would be much easier.
Perhaps use your compare and var_dump on failure?


IMO comparison is the way to do it here, not var_dump.

Let's here the positives?



Met vriendelijke groeten / With kind regards,

Webmaster IDG.nl
Melvyn Sopacua




--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/xslt/tests xslt_process-001.phpt xslt_set_object.phpt xslt_setopt.phpt

2002-10-30 Thread Melvyn Sopacua
On Wed, 30 Oct 2002, Marcus Boerger wrote:

 At 11:38 30.10.2002, Melvyn Sopacua wrote:
 At 22:57 29-10-2002, Marcus Börger wrote:
 
--use var_dump()
 
 Why?
 
 Please Marcus - discuss with the person who developed the test before 
 altering it's behavior.
 What's the positive side of using var_dump?
 
 I saw no need in first comparing results and then compare the result of the 
 compare
 again in run-test.php. The far better way seems to present the output and 
 compare the
 expected output in run-test.php. The reason i did was that i was wondering 
 what i would
 do when i got any .diff .out from a user for whom the test faild? I would 
 receive somthing
 like unexpected result. Wow that would be a good help in finding the bug.

Ok - good point.
 
 Here are the negatives:
 -- iconv could be unsupported (which was on my list of things to fix for 
 this and other tests)
 If the entity fails, it fails in both cases and so the meta test 
  succeeds but, just because
 a character misses the test fails for no good reason.
 
 We can rewrite the test so it becomes independant from iconv.

I'm looking into some stuff, to get this done in the best way. I think
I'll change sablot.c to reflect if --with-iconv-dir was given and provide
the information xslt_sab_libs() (same for js).
The main reason, is not this test by the way - but in a hosting
environment, it may also be very convenient, to know if you have iconv
recoding available in Sablotron, and js support and what the expat version
is. 

It may also be possible to get this via the Sablotron library. Anyhow - it
depends what can be done in which timeframe.

 -- indenting is something being discussed on the Sablist and so may change 
 and can be
 platform specific. However indenting is handled, it will be handled 
  consistently for a
 platform.
 
 If above is reason enough to display the full result we could use 
 --EXPECTREGEX--
 und skip over any whitespace. But your original compare would be much easier.
 Perhaps use your compare and var_dump on failure?

That's the best compromise I think.

-- 
With kind regards,

Melvyn Sopacua
?php include(not_reflecting_employers_views.txt); ?


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/xslt/tests xslt_process-001.phpt xslt_set_object.phpt xslt_setopt.phpt

2002-10-29 Thread Marcus Börger
helly   Tue Oct 29 16:57:50 2002 EDT

  Modified files:  
/php4/ext/xslt/testsxslt_process-001.phpt xslt_set_object.phpt 
xslt_setopt.phpt 
  Log:
  -add reason to --SKIPIF--
  -add magic_quotes_runtime to --INI--
  --use var_dump()
  
  
Index: php4/ext/xslt/tests/xslt_process-001.phpt
diff -u php4/ext/xslt/tests/xslt_process-001.phpt:1.1 
php4/ext/xslt/tests/xslt_process-001.phpt:1.2
--- php4/ext/xslt/tests/xslt_process-001.phpt:1.1   Fri Oct 25 15:17:15 2002
+++ php4/ext/xslt/tests/xslt_process-001.phpt   Tue Oct 29 16:57:50 2002
 -4,9 +4,11 
 ?php
 include(skipif.inc);
 if(!function_exists('utf8_encode')) {
-   die(skip\n);
+   die(skip function utf8_encode() not available);
 }
 ?
+--INI--
+magic_quotes_runtime=0
 --FILE--
 ?php
 error_reporting(E_ALL);
Index: php4/ext/xslt/tests/xslt_set_object.phpt
diff -u php4/ext/xslt/tests/xslt_set_object.phpt:1.1 
php4/ext/xslt/tests/xslt_set_object.phpt:1.2
--- php4/ext/xslt/tests/xslt_set_object.phpt:1.1Fri Oct 25 15:17:15 2002
+++ php4/ext/xslt/tests/xslt_set_object.phptTue Oct 29 16:57:50 2002
 -4,9 +4,11 
 ?php
 include(skipif.inc);
 if(!function_exists('xslt_set_object')) {
-   die(skip\n);
+   die(skip function xslt_set_object() not available);
 }
 ?
+--INI--
+magic_quotes_runtime=0
 --FILE--
 ?php
 error_reporting(E_ALL);
Index: php4/ext/xslt/tests/xslt_setopt.phpt
diff -u php4/ext/xslt/tests/xslt_setopt.phpt:1.1 
php4/ext/xslt/tests/xslt_setopt.phpt:1.2
--- php4/ext/xslt/tests/xslt_setopt.phpt:1.1Fri Oct 25 15:17:15 2002
+++ php4/ext/xslt/tests/xslt_setopt.phptTue Oct 29 16:57:50 2002
 -4,14 +4,16 
 ?php
 include(skipif.inc);
 if(!function_exists('xslt_setopt')) {
-   die(skip\n);
+   die(skip function xslt_setopt() is not available\n);
 }
 ?
+--INI--
+magic_quotes_runtime=0
 --FILE--
 ?php
 error_reporting(E_ALL);
-$xmlfile = 'ext/xslt/tests/public.xml';
-$xslfile = 'ext/xslt/tests/args.xsl';
+$xmlfile = dirname(__FILE__).'/public.xml';
+$xslfile = dirname(__FILE__).'/args.xsl';
 
 $xh = xslt_create();
 // Tell Sablotron to process public entities
 -26,22 +28,33 
 // DEBUG: print $xslstring;
 
 xslt_setopt($xh, XSLT_SABOPT_PARSE_PUBLIC_ENTITIES | XSLT_SABOPT_DISABLE_ADDING_META);
-$result_nometa = xslt_process($xh, $xmlfile, 'arg:/_xsl', NULL, array('/_xsl' = 
$xslstring));
-// DEBUG: print $result_nometa\n;
+var_dump(xslt_process($xh, $xmlfile, 'arg:/_xsl', NULL, array('/_xsl' = 
+$xslstring)));
+
 
 xslt_setopt($xh, XSLT_SABOPT_PARSE_PUBLIC_ENTITIES);
-$result_meta = xslt_process($xh, $xmlfile, 'arg:/_xsl', NULL, array('/_xsl' = 
$xslstring));
+var_dump(xslt_process($xh, $xmlfile, 'arg:/_xsl', NULL, array('/_xsl' = 
+$xslstring)));
 // DEBUG: print $result_meta\n;
 
-/* Also test if they're equal. That would mean, that disable-adding-meta is set to off
-   at compile time and our call to xslt_setopt failed to reset that */
-if($result_meta != $result_nometa  FALSE === stristr($result_nometa, 'meta 
http-equiv=Content-Type'))
-{
-   print OK\n;
-}
-
 xslt_free($xh);
 ?
 --EXPECT--
 PHP QA®
-OK
+string(95) html
+  head
+titlefoo/title
+  /head
+  body
+pPHP QA®/p
+  /body
+/html
+
+string(172) html
+  head
+meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1
+titlefoo/title
+  /head
+  body
+pPHP QA®/p
+  /body
+/html
+
\ No newline at end of file



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php