From 9505bd0c8b12d0b822076a48b4e8a554a1d4f5fa Mon Sep 17 00:00:00 2001 From: "tobiasz.cudnik" Date: Sat, 10 Oct 2009 08:55:05 +0000 Subject: [PATCH] - fixed ajax() notices - fixed #132 DOMDocumentWrapper typo - fixed load() when no mb_string extension - added new ajax test case for #130 git-svn-id: http://phpquery.googlecode.com/svn/branches/dev@392 afc5ee8f-4a33-0410-9214-8715c29b7d85 --- phpQuery/phpQuery.php | 2 ++ phpQuery/phpQuery/DOMDocumentWrapper.php | 2 +- phpQuery/phpQuery/phpQueryObject.php | 2 +- test-cases/test_ajax.php | 28 +++++++++++++++++++++--- test-cases/test_ajax_data_1 | 1 + 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 test-cases/test_ajax_data_1 diff --git a/phpQuery/phpQuery.php b/phpQuery/phpQuery.php index 5d214ad..08f22fc 100644 --- a/phpQuery/phpQuery.php +++ b/phpQuery/phpQuery.php @@ -94,6 +94,8 @@ abstract class phpQuery { 'data' => null, 'username' => null, 'password' => null, + 'dataType' => null, + 'ifModified' => null, 'accepts' => array( 'xml' => "application/xml, text/xml", 'html' => "text/html", diff --git a/phpQuery/phpQuery/DOMDocumentWrapper.php b/phpQuery/phpQuery/DOMDocumentWrapper.php index 0b6a7fd..13038cb 100644 --- a/phpQuery/phpQuery/DOMDocumentWrapper.php +++ b/phpQuery/phpQuery/DOMDocumentWrapper.php @@ -386,7 +386,7 @@ protected function charsetAppendToHTML($html, $charset, $xhtml = false) { .($xhtml ? '/' : '') .'>'; if (strpos($html, ' 'http://'.$_SERVER['SERVER_NAME'].preg_replace('@/[^/]+$@', '/test_ajax_data_1', $_SERVER['REQUEST_URI']), + 'success' => 'a789fhasdui3124', + 'error' => 'jhdbg786213u8dsfg7y' +)); +function a789fhasdui3124($html) { + $testName = 'AJAX request text node'; + if ( $html == 'hello world' ) + print "Test '$testName' PASSED :)"; + else { + print "Test '$testName' FAILED !!! "; + } + print "\n"; +} + +function jhdbg786213u8dsfg7y() { + $testName = 'AJAX request text node'; + print "Test '$testName' FAILED !!! "; +} + + //$testName = 'gdata plugin'; //phpQuery::extend('gdata'); //$xhr = phpQuery::$plugins->gdata('tobiasz.cudnik@gmail.com', 'XXX'); diff --git a/test-cases/test_ajax_data_1 b/test-cases/test_ajax_data_1 new file mode 100644 index 0000000..95d09f2 --- /dev/null +++ b/test-cases/test_ajax_data_1 @@ -0,0 +1 @@ +hello world \ No newline at end of file