forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds files: error 1 to 5 and variation 1 to 4
tests for error1: not well formed xml tests for error2: not well formed xml attribute without colon tests for error2: not well formed xml, typo tests for error4: wrong xml version tests for error5: extra content at the end of the doc tests libxml_dtd_load tests libxml_dtd_valid tests for libdtd_noerror tests for LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS the basic behavior fix comments
- Loading branch information
1 parent
473d665
commit 24f3693
Showing
33 changed files
with
628 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() basic behavior | ||
--DESCRIPTION-- | ||
This test verifies the basic behaviour of the method | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/book.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=1 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECT-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects an opening and ending tag mismatch | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects attributes values not closed between " or ' | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed2.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects a typo in tag names | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed3.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects an unsupported xml version | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed4.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects extra content at the end of the document | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed5.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() with LIBXML_DTDLOAD option | ||
--DESCRIPTION-- | ||
This test verifies the right behaviour of the LIBXML_DTDLOAD constant | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/book_with_dtd.xml | ||
LOAD_OPTIONS=LIBXML_DTDLOAD | ||
EXPECTED_RESULT=1 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECT-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() with LIBXML_DTDVALID option | ||
--DESCRIPTION-- | ||
This test verifies the right behaviour of the LIBXML_DTDVALID constant | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/wrong_book_with_dtd.xml | ||
LOAD_OPTIONS=LIBXML_DTDVALID | ||
EXPECTED_RESULT=1 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() with LIBXML_DTDVALID and LIBXML_NOERROR options | ||
--DESCRIPTION-- | ||
This test vrifies the right behaviour of the LIBXML_NOERROR constant | ||
which avoids the display of the warning message | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/wrong_book_with_dtd.xml | ||
LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR | ||
EXPECTED_RESULT=1 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method.php | ||
--EXPECT-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
Test DOMDocument::loadXML() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS | ||
--DESCRIPTION-- | ||
This test verifies the right behaviour of the following constants: | ||
LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/book_with_dtd.xml | ||
LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS | ||
EXPECTED_RESULT=1 | ||
--FILE_EXTERNAL-- | ||
domdocumentloadxml_test_method_savexml.php | ||
--EXPECT-- | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE books SYSTEM "books.dtd"> | ||
<books><book><title default="default title">The Grapes of Wrath</title><author>John Steinbeck</author></book><book><title default="default title">The Pearl</title><author>John Steinbeck</author></book><book><title default="default title">entity is only for test purposes</title><author>data for test</author></book></books> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Test DOMDocument::load() basic behavior | ||
--DESCRIPTION-- | ||
This test verifies the basic behaviour of the method | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/book.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=1 | ||
--FILE_EXTERNAL-- | ||
domdocumentload_test_method.php | ||
--EXPECT-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
Test DOMDocument::load() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects an opening and ending tag mismatch | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentload_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--TEST-- | ||
Test DOMDocument::load() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects attributes values not closed between " or ' | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed2.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentload_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s | ||
|
||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::load() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects and opening and ending tag mismatch | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed3.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentload_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::load() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects an unsupported xml version | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed4.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentload_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test DOMDocument::load() detects not-well formed XML | ||
--DESCRIPTION-- | ||
This test verifies the method detects extra content at the end of the document | ||
Environment variables used in the test: | ||
- XML_FILE: the xml file to load | ||
- LOAD_OPTIONS: the second parameter to pass to the method | ||
- EXPECTED_RESULT: the expected result | ||
--CREDITS-- | ||
Antonio Diaz Ruiz <[email protected]> | ||
--INI-- | ||
assert.bail=true | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--ENV-- | ||
XML_FILE=/not_well_formed5.xml | ||
LOAD_OPTIONS=0 | ||
EXPECTED_RESULT=0 | ||
--FILE_EXTERNAL-- | ||
domdocumentload_test_method.php | ||
--EXPECTF-- | ||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s |
Oops, something went wrong.