zoe             Sat May 17 13:26:51 2008 UTC

  Modified files:              
    /php-src/ext/dom/tests      DOMComment_replaceData_error1.phpt 
                                DOMComment_replaceData_basic.phpt 
                                DOMComment_replaceData_error2.phpt 
  Log:
  Tests from London test fest 2008
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMComment_replaceData_error1.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/dom/tests/DOMComment_replaceData_error1.phpt
diff -u /dev/null php-src/ext/dom/tests/DOMComment_replaceData_error1.phpt:1.2
--- /dev/null   Sat May 17 13:26:51 2008
+++ php-src/ext/dom/tests/DOMComment_replaceData_error1.phpt    Sat May 17 
13:26:51 2008
@@ -0,0 +1,24 @@
+--TEST--
+Test replacing data into a DOMComment basic test
+--CREDITS--
+Andrew Larssen <[EMAIL PROTECTED]>
+London TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+//Negative offset
+$dom = new DomDocument();
+$comment = $dom->createComment('test-comment');
+try {
+  $comment->replaceData(-1,4,'-inserted');
+} catch (DOMException $e ) {
+  if ($e->getMessage() == 'Index Size Error'){
+    echo "Throws DOMException for -ve offest\n";
+  }
+}
+
+?>
+--EXPECTF--
+Throws DOMException for -ve offest
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt
diff -u /dev/null php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt:1.2
--- /dev/null   Sat May 17 13:26:51 2008
+++ php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt     Sat May 17 
13:26:51 2008
@@ -0,0 +1,29 @@
+--TEST--
+Test replacing data into a DOMComment basic test
+--CREDITS--
+Andrew Larssen <[EMAIL PROTECTED]>
+London TestFest 2008
+--SKIPIF--
+<?php // require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$dom = new DomDocument();
+$comment = $dom->createComment('test-comment');
+$comment->replaceData(4,1,'replaced');
+$dom->appendChild($comment);
+echo $dom->saveXML();
+
+// Replaces rest of string if count is greater than length of existing string
+$dom = new DomDocument();
+$comment = $dom->createComment('test-comment');
+$comment->replaceData(0,50,'replaced');
+$dom->appendChild($comment);
+echo $dom->saveXML();
+
+?>
+--EXPECTF--
+<?xml version="1.0"?>
+<!--testreplacedcomment-->
+<?xml version="1.0"?>
+<!--replaced-->
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMComment_replaceData_error2.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/dom/tests/DOMComment_replaceData_error2.phpt
diff -u /dev/null php-src/ext/dom/tests/DOMComment_replaceData_error2.phpt:1.2
--- /dev/null   Sat May 17 13:26:51 2008
+++ php-src/ext/dom/tests/DOMComment_replaceData_error2.phpt    Sat May 17 
13:26:51 2008
@@ -0,0 +1,24 @@
+--TEST--
+Test replacing data into a DOMComment basic test
+--CREDITS--
+Andrew Larssen <[EMAIL PROTECTED]>
+London TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+//offset to large
+$dom = new DomDocument();
+$comment = $dom->createComment('test-comment');
+try {
+  $comment->replaceData(999,4,'-inserted');
+} catch (DOMException $e ) {
+  if ($e->getMessage() == 'Index Size Error'){
+    echo "Throws DOMException for offest too large\n";
+  }
+}
+
+?>
+--EXPECTF--
+Throws DOMException for offest too large
\ No newline at end of file



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

Reply via email to