diff --git a/tests/bin-info.inc b/tests/bin-info.inc deleted file mode 100644 index ad42ea897a8..00000000000 --- a/tests/bin-info.inc +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/tests/foo b/tests/foo deleted file mode 100644 index 125c655b0fe..00000000000 --- a/tests/foo +++ /dev/null @@ -1,5 +0,0 @@ -a -b -@c@ -d -e diff --git a/tests/foo2 b/tests/foo2 deleted file mode 100644 index 4cdd41e3dcf..00000000000 --- a/tests/foo2 +++ /dev/null @@ -1,3 +0,0 @@ -b(12,13)."\n"; diff --git a/tests/foo3 b/tests/foo3 deleted file mode 100644 index 08681b98c2d..00000000000 --- a/tests/foo3 +++ /dev/null @@ -1,43 +0,0 @@ -print_string($a->hello_world())."\n"; -print $b->print_string($b->hello_world())."\n"; -$a->foo = 5; -print $a->foo; -print $a->foo(); diff --git a/tests/foo4 b/tests/foo4 deleted file mode 100644 index 29df84d0e23..00000000000 --- a/tests/foo4 +++ /dev/null @@ -1,41 +0,0 @@ -asd = 5; -print $b->asd; diff --git a/tests/odbc-display.php b/tests/odbc-display.php deleted file mode 100644 index f79a854aea8..00000000000 --- a/tests/odbc-display.php +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/tests/odbc-t1.php b/tests/odbc-t1.php deleted file mode 100644 index 90cb97910f5..00000000000 --- a/tests/odbc-t1.php +++ /dev/null @@ -1,38 +0,0 @@ - - -Quick & dirty ODBC test - - -

ODBC Test 1 - Connection

-"; - $conn = odbc_connect($dsn,$dbuser,$dbpwd); - if(!$conn){ -?> -

Error connecting to database! Check DSN, username and password

- -

Connection successful

-">Proceed to next test -| Change login information - -You will need permisson to create tables for the following tests! -
- - - - -
Database (DSN):
User:
Password:
-
- - -
- - - diff --git a/tests/odbc-t2.php b/tests/odbc-t2.php deleted file mode 100644 index a500b09e8b5..00000000000 --- a/tests/odbc-t2.php +++ /dev/null @@ -1,82 +0,0 @@ - - -Quick & dirty ODBC test #2 - - -

ODBC Test 2 - Create table

- -

Error connecting to database! Check DSN, username and password

- -- OK

-Dropping table "php3_test" - -- OK

-Create table "php_test" - - - OK

-Table Info:
- - - - - - - - - - - - - -
NameTypeLength
-

-


-

-">Proceed to next test -| Change login information - - - -

- - - - -
Database (DSN):
User:
Password:
- -
- - - - diff --git a/tests/odbc-t3.php b/tests/odbc-t3.php deleted file mode 100644 index edfdc658f89..00000000000 --- a/tests/odbc-t3.php +++ /dev/null @@ -1,95 +0,0 @@ - - -Database test #3 - - -

ODBC Test 3 - Insert records

- -

Error connecting to database! Check DSN, username and password

- - - OK

-Clearing table "php_test" - - - OK

-Inserting into table "php_test" - - - OK

-

The table "php_test" should now contain the following values:

- - - - - - - - - - - - - - - - - - - -
ABCD
test-11001100.01php - values 1
test-21002200.02php - values 2
test-31003300.03php - values 3
test-41004400.04php - values 4
test-51005500.05php - values 5
- -

Actual contents of table "php_test":

- -

-


-

-">Proceed to next test -| Change login information - -

- - - - -
Database:
User:
Password:
- - -
- - - - diff --git a/tests/odbc-t4.php b/tests/odbc-t4.php deleted file mode 100644 index 10e8f4b2d96..00000000000 --- a/tests/odbc-t4.php +++ /dev/null @@ -1,91 +0,0 @@ - - -Database test #4 - - -

ODBC Test 4 - Cursors

-The following test requires your ODBC driver to support positioned updates

- -

Error connecting to database! Check DSN, username and password

- - - OK

-Updating table "php_test" -1002 for update'))){ - $cursor = odbc_cursor($result); - if(($upd = odbc_prepare($conn,"update php_test set a=?, b=? where current of $cursor"))){ - while(odbc_fetch_row($result)) { - $params[0] = odbc_result($result, 1) . "(*)"; - $params[1] = odbc_result($result, 2) + 2000; - odbc_execute($upd, $params); - } - odbc_commit($conn); - } - } - if($result && $upd){ -?> - - OK

-

The table "php_test" should now contain the following values:

- - - - - - - - - - - - - - - - - - - - - - -
ABCD
test-11001100.01php3 - values 1
test-21002200.02php - values 2
test-3(*)3003300.03php - values 3
test-4(*)3004400.04php - values 4
test-5(*)3005500.05php - values 5
- Note: If you reload this testpage,
- the three last rows will contain different
values in columns A and B
-
- -

Actual contents of table "php_test":

-"; - } -?> -


-">Proceed to next test - -

- - - - -
Database:
User:
Password:
- - -
- - - diff --git a/tests/odbc-t5.php b/tests/odbc-t5.php deleted file mode 100644 index 13af52d2226..00000000000 --- a/tests/odbc-t5.php +++ /dev/null @@ -1,137 +0,0 @@ - - -Database test #5 - - -

ODBC Test 5 - Blobs

- -

Please select the images (gif) you want to put into the database

-
-Image 1:

-Image 2:

-Image 3:

-Blob database type name: -

- - - - -| -

- - - -

Error connecting to database! Check DSN, username and password

- - - OK

-Images in database"; - while(odbc_fetch_into($res, &$imgs)){ - echo "$imgs[0] : \n

"; - } - }else{ - echo "Couldn't execute query"; - } - echo "\n\n"; - exit; - } -?> -Dropping table "php_test" - - - OK

-Creating table "php_test": - - - OK

-Table Info:
- - - - - - - - - - - - - -
NameTypeLength
- -Inserting data: - - - OK

-">Display Images - -

- - - - -
Database:
User:
Password:
- - -
- - - diff --git a/tests/recurse b/tests/recurse deleted file mode 100644 index 5b8c646f6b7..00000000000 --- a/tests/recurse +++ /dev/null @@ -1,21 +0,0 @@ - - -
- -
- -
- - - diff --git a/tests/run.php b/tests/run.php deleted file mode 100644 index a6792b5af72..00000000000 --- a/tests/run.php +++ /dev/null @@ -1,17 +0,0 @@ - - - -Executing:
-"); -?> -
- - - \ No newline at end of file diff --git a/tests/scan_cases b/tests/scan_cases deleted file mode 100644 index d562230fde1..00000000000 --- a/tests/scan_cases +++ /dev/null @@ -1,28 +0,0 @@ -# Test file used by testscanf.php. Feel free to add additional cases -# sscanf test cases. formatted to be slurped and split by explode -%d|48| valid decimal (positive) -%d|-98| valid signed decimal (negative) -%d|56a| integer scan : decimal digit followed by alpha -%4d|558071|decimal integer with width specification -%i|-5489|valid signed integer (negative) -%s| the rain in spain | plain ole string matched with %s -%10s|jabberwocky| string with width specifier -%f|289.071| valid float (%f) -%f|-0.403| valid negative (%f) -%3f|76.4|Float with width specifier ending at decimal point -%3f"|789.4|Float with width specifier -%o|0321|octal with leading 0 -%o|327| valid octal digits -%o|380| octal scan with octal digit followed by non-octal -%x|fe| valid hex| -%x|0xfe| "c" style hex with leading 0x| -%x|455| hex with all single digits < f -%x|-98| hex (negative signed int) -%c|y| single char -%4c|tulips|Character with width specification (4) -%e|10e-9| signed floating point with negative exponent -%e|10e+9| signed floating point with explicit positive exponent -%e|10e9| signed floating point with positive exponent (no + sign) -# next we test multiple cases - %d %i %o %u %x %s %c %e %f %g | 19 84 0666 2000 0xface your x 31e+9 0.912 2.4 |multiple specifiers - diff --git a/tests/test.pl b/tests/test.pl deleted file mode 100644 index 2502cb12981..00000000000 --- a/tests/test.pl +++ /dev/null @@ -1,34 +0,0 @@ -class_name; - } -}; - - -class ChildClass { - var $class_name = "ChildClass"; - - function ChildClass($value, $new_value) { - BaseClass::BaseClass($value); - print "new value is '$new_value'\n"; - } - function MyClassName($a_value) { - return BaseClass::MyClassName()." and the value is '$a_value'"; - } -}; - - -$obj = new ChildClass("Test", "Another test"); -print $obj->MyClassName("not interesting"); \ No newline at end of file diff --git a/tests/testarray b/tests/testarray deleted file mode 100644 index bee5cca546c..00000000000 --- a/tests/testarray +++ /dev/null @@ -1,21 +0,0 @@ -This is a small test.... -Version}\n"; -$word->Visible = 1; -$word->Documents->Add(); -$word->Selection->TypeText("This is a test..."); -$word->Quit(); -/* -$word->Documents[1]->SaveAs("Useless test.doc"); -*/ -?> \ No newline at end of file diff --git a/tests/testcpdf b/tests/testcpdf deleted file mode 100644 index a74087d18e0..00000000000 --- a/tests/testcpdf +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/tests/testcpdfclock b/tests/testcpdfclock deleted file mode 100644 index c885cc8e09d..00000000000 --- a/tests/testcpdfclock +++ /dev/null @@ -1,87 +0,0 @@ - 0) { - cpdf_page_init($pdf, $pagecount+1, 0, 2 * ($radius + $margin), 2 * ($radius + $margin), 1.0); - - cpdf_set_page_animation($pdf, 4, 0.5, 0, 0, 0); /* wipe */ - - cpdf_translate($pdf, $radius + $margin, $radius + $margin); - cpdf_save($pdf); - cpdf_setrgbcolor($pdf, 0.0, 0.0, 1.0); - - /* minute strokes */ - cpdf_setlinewidth($pdf, 2.0); - for ($alpha = 0; $alpha < 360; $alpha += 6) - { - cpdf_rotate($pdf, 6.0); - cpdf_moveto($pdf, $radius, 0.0); - cpdf_lineto($pdf, $radius-$margin/3, 0.0); - cpdf_stroke($pdf); - } - - cpdf_restore($pdf); - cpdf_save($pdf); - - /* 5 minute strokes */ - cpdf_setlinewidth($pdf, 3.0); - for ($alpha = 0; $alpha < 360; $alpha += 30) - { - cpdf_rotate($pdf, 30.0); - cpdf_moveto($pdf, $radius, 0.0); - cpdf_lineto($pdf, $radius-$margin, 0.0); - cpdf_stroke($pdf); - } - - $ltime = getdate(); - - /* draw hour hand */ - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['minutes']/60.0) + $ltime['hours'] - 3.0) * 30.0); - cpdf_moveto($pdf, -$radius/10, -$radius/20); - cpdf_lineto($pdf, $radius/2, 0.0); - cpdf_lineto($pdf, -$radius/10, $radius/20); - cpdf_closepath($pdf); - cpdf_fill($pdf); - cpdf_restore($pdf); - - /* draw minute hand */ - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['seconds']/60.0) + $ltime['minutes'] - 15.0) * 6.0); - cpdf_moveto($pdf, -$radius/10, -$radius/20); - cpdf_lineto($pdf, $radius * 0.8, 0.0); - cpdf_lineto($pdf, -$radius/10, $radius/20); - cpdf_closepath($pdf); - cpdf_fill($pdf); - cpdf_restore($pdf); - - /* draw second hand */ - cpdf_setrgbcolor($pdf, 1.0, 0.0, 0.0); - cpdf_setlinewidth($pdf, 2); - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['seconds'] - 15.0) * 6.0)); - cpdf_moveto($pdf, -$radius/5, 0.0); - cpdf_lineto($pdf, $radius, 0.0); - cpdf_stroke($pdf); - cpdf_restore($pdf); - - /* draw little circle at center */ - cpdf_circle($pdf, 0, 0, $radius/30); - cpdf_fill($pdf); - - cpdf_restore($pdf); - - cpdf_finalize_page($pdf, $pagecount+1); -} - -cpdf_finalize($pdf); -cpdf_save_to_file($pdf, $pdffilename); -$pdf = cpdf_close($pdf); -?> diff --git a/tests/testdom b/tests/testdom deleted file mode 100644 index c7012e0e3c1..00000000000 --- a/tests/testdom +++ /dev/null @@ -1,73 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -echo "Test 1: accessing single nodes from php\n"; -$dom = xmldoc($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$children = $dom->childNodes(); -print_r($children); - -echo "--------- root\n"; -$rootnode = $dom->documentElement(); -print_r($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->childNodes(); -print_r($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->lastChild(); -print_r($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parent(); -print_r($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->childNodes(); -print_r($children); - -echo "--------- creating a new attribute\n"; -$attr = $dom->createAttribute("src", "picture.gif"); -print_r($attr); - -$rootnode->setAttributeNode($attr); /* Not implemented */ -$attr = $rootnode->setAttribute("src", "picture.gif"); -$attr = $rootnode->getAttribute("src"); -print_r($attr); - -echo "--------- attribute of rootnode\n"; -$attrs = $rootnode->attributes(); -print_r($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs[0]->childNodes(); -print_r($children); - -?> diff --git a/tests/testfe b/tests/testfe deleted file mode 100644 index ea627606353..00000000000 --- a/tests/testfe +++ /dev/null @@ -1,18 +0,0 @@ -"ge:Hier der Titel", "Author"=>"Hier der Autor")); - echo $objrec."\n"; - $objrec .= "\nTitle=en:Here the title"; - echo "Add another title and convert it back to an object array\n"; - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_4 == "yes") { - echo "TEST 4 ----------------------------------------------\n"; - echo "Get the object array of document with id 0x".dechex($id)."\n"; - $objrec = hw_getobject($connect, $id); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_5 == "yes") { - echo "TEST 5 ----------------------------------------------\n"; - echo "List the children of collection 0x".dechex($collid)."\n"; - $children = hw_childrenobj($connect, $collid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $c_children = count($children) - 1; - for($i=0; $i<$c_children; $i++) { - $objarr = hw_objrec2array($children[$i]); - list_attr($objarr); - } - list_attr($children[$c_children]); - } - - if($test_6 == "yes") { - echo "TEST 6 ----------------------------------------------\n"; - echo "List the parents of object 0x".dechex($id)."\n"; - $parents = hw_getparentsobj($connect, $collid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $c_parents = count($parents) - 1; - for($i=0; $i<$c_parents; $i++) { - $objarr = hw_objrec2array($parents[$i]); - list_attr($objarr); - } - list_attr($parents[$c_parents]); - } - - if($test_7 == "yes") { - echo "TEST 7 ----------------------------------------------\n"; - echo "Inserting a new text document into 0x".dechex($collid)."\n"; - $objrec = "Type=Document\nDocumentType=text\nName=HWTest\nTitle=en:Component\nMimeType=text/plain\nAuthor=".$username; - $contents = "Ein bischen Text"; - $doc = hw_new_document($objrec, $contents, strlen($contents)+1); - $objid = hw_insertdocument($connect, $collid, $doc); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objrec = hw_getobject($connect, $objid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_8 == "yes") { - echo "TEST 8 ----------------------------------------------\n"; - echo "Removing text document just inserted\n"; - $kk[0] = (int) $objid; - hw_mv($connect, $kk, $collid, 0); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - echo "If the document was really deleted you should see an error now\n"; - $objrec = hw_getobject($connect, $objid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - } else { - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - } - - if($test_9 == "yes") { - echo "TEST 9 ----------------------------------------------\n"; - echo "Searching for objects with $query\n"; - $objrecs = hw_getobjectbyqueryobj($connect, $query, -1); - $c_objrecs = count($objrecs) - 1; - echo "$c_objrecs found\n"; - for($i=0; $i<$c_objrecs; $i++) { - $objarr = hw_objrec2array($objrecs[$i]); - list_attr($objarr); - } - list_attr($objrecs[$c_objrecs]); - } - - if($test_10 == "yes") { - $anchors = hw_getanchorsobj($connect, $id); - $countanchors = count($anchors) - 1; - echo "$countanchors Anchors of Object $id\n"; - for($i=0; $i<$countanchors; $i++) { - $arr = hw_objrec2array($anchors[$i]); - list_attr($arr); - } - } - - if($test_11 == "yes") { - $doc = hw_new_document_from_file("ObjectRecord", "hw_document.txt"); - hw_output_document($doc); - } - - if($test_12 == "yes") { - $doc = hw_new_document_from_file("ObjectRecord", "hw_document.txt"); - hw_insertanchors($doc, array("Position=0x2 0x7\nObjectID=0x3\nTAnchor=Src\nDest=0x5"), array("ObjectID=0x5\nName=DestDoc")); - hw_output_document($doc); - } - - hw_close($connect); -?> diff --git a/tests/testinclude b/tests/testinclude deleted file mode 100644 index 1e9854370d1..00000000000 --- a/tests/testinclude +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/testobj b/tests/testobj deleted file mode 100644 index 66b003ce9c6..00000000000 --- a/tests/testobj +++ /dev/null @@ -1,29 +0,0 @@ -initialized = 1; - } -}; - -class barbara extends foobar { - -}; - -$name = "foobar"; -$foo = new $name; // or die("Unable to construct foobar\n"); -//print $foo->initialized; - -$boo = new barbara; -print get_class($foo).endl; -print get_parent_class($foo).endl; -print get_class($boo).endl; -print get_parent_class($boo).endl; -print method_exists($foo,"foobar").endl; -print method_exists($boo,"foobar").endl; -print method_exists($boo,"barbara").endl; -//$word = new COm("word.application"); -//$word->visible = true; -//sleep(5); -//$word->quit(); diff --git a/tests/testpfpro.php b/tests/testpfpro.php deleted file mode 100644 index ffb1784bdca..00000000000 --- a/tests/testpfpro.php +++ /dev/null @@ -1,39 +0,0 @@ -\n\n"; - -echo "Payflow Pro library is version ".pfpro_version()."\n"; - -pfpro_init(); - -$transaction = array(USER => 'mylogin', - PWD => 'mypassword', - TRXTYPE => 'S', - TENDER => 'C', - AMT => 1.50, - ACCT => '4111111111111111', - EXPDATE => '0900' - ); - -$response = pfpro_process($transaction); - -if (!$response) { - die("Couldn't establish link to signio software.\n"); -} - -echo "Signio response code was ".$response[RESULT]; -echo ", which means: ".$response[RESPMSG]."\n"; - -echo "\nDump of the transaction request "; -print_r($transaction); - -echo "\nDump of the response "; -print_r($response); - -pfpro_cleanup(); - -?> diff --git a/tests/tests.dsp b/tests/tests.dsp deleted file mode 100644 index fc19dcfe431..00000000000 --- a/tests/tests.dsp +++ /dev/null @@ -1,61 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tests" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=tests - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tests.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tests.mak" CFG="tests - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tests - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "." -# PROP BASE Intermediate_Dir "." -# PROP BASE Cmd_Line "NMAKE /f tests.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "tests.exe" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Cmd_Line "nmake /nologo /f tests.mak" -# PROP Rebuild_Opt "/a" -# PROP Target_File "__test_run_complete__" -# PROP Bsc_Name "" -# PROP Target_Dir "" -# Begin Target - -# Name "tests - Win32 Debug" - -!IF "$(CFG)" == "tests - Win32 Debug" - -!ENDIF - -# Begin Source File - -SOURCE="..\run-tests.php" -# End Source File -# Begin Source File - -SOURCE=.\tests.mak -# End Source File -# End Target -# End Project diff --git a/tests/tests.mak b/tests/tests.mak deleted file mode 100644 index 8b471435440..00000000000 --- a/tests/tests.mak +++ /dev/null @@ -1,27 +0,0 @@ -# -# Win32 Makefile to run the PHP unit tests. -# -# TEST_PHP_EXECUTABLE -# Required - must point to the PHP executable to test. -# -# TEST_PHP_ERROR_STYLE -# Optional - specifies error format to output so IDE can jump to test source and log. -# Values: MSVC (Microsoft Visual C++), Emacs -# -# TEST_PHP_DETAILED -# Optional - generates a more complete and detailed log if set. -# Values: 0 or unset - no details; 1 - detailed. -# - -all : run-tests - -BIN=Debug_TS - -# Specific test(s) to run (all if not specified). -TESTS= - -run-tests : - set TEST_PHP_EXECUTABLE=$(BIN)\php-cgi.exe - set TEST_PHP_ERROR_STYLE=MSVC - set TEST_PHP_DETAILED=0 - cd .. && $(BIN)\php-cgi.exe -c tests -f run-tests.php $(TESTS) | tee tests.log diff --git a/tests/testscanf.php b/tests/testscanf.php deleted file mode 100644 index ad530978c52..00000000000 --- a/tests/testscanf.php +++ /dev/null @@ -1,113 +0,0 @@ -") { - if (is_array($val)) { - for ($i = 0;$i< count($val);$i++) { - echo $val[$i] . $postfix; - } - } else { - echo $val . $postfix; - } -} - -function do_sscanf($string, $format) { - $s = "sscanf(\"" . $string . ",\"" . $format ."\")."; - echo "$s
"; - $s = str_repeat("-", strlen($s)); - echo "$s
"; - $output = sscanf($string,$format); - echo "Result : "; - print_value( $output ); - echo "$s

"; -} - - -function run_sscanf_test_cases($filename="scan_cases") -{ - - echo "


Running Test Cases from $filename

"; - $arr = file($filename); - for ($i=0;$i < count($arr);$i++) { - $line_arr = explode("|",$arr[$i]); - - $format = $line_arr[0]; - $string = $line_arr[1]; - if (count($arr) > 2) { - $comment = $line_arr[2]; - } else { - $comment = ""; - } - if ( empty($format) || empty($string) ) { - continue; - } - print("

** Case : $comment ******************************

"); - do_sscanf($string,$format); - } -} - -function simple_tests() { - echo "Testing sscanf with standard ANSI syntax (values returned by -reference)-
"; - $decimal = -1; - $string = ""; - $hex = 0; - $float = 0.0; - $octal = 0.0; - $int = -1; - - echo "


Simple Test

"; - echo "sscanf('10','%d',&\$decimal)
"; - echo "
BEFORE :
decimal = $decimal."; - $foo = sscanf("10","%d",&$decimal); - echo "
AFTER :
decimal = $decimal
"; - - - echo "


Simple Test 2

"; - echo "sscanf(\"ghost 0xface\",\"%s %x\",&\$string, &\$int)
"; - echo "
BEFORE :
string = $string, int = $int
"; - $foo = sscanf("ghost 0xface","%s %x",&$string, &$int); - echo "
AFTER :
string = $string, int = $int
"; - echo " sscan reports : "; - print_value( $foo,""); - echo " conversions
"; - - echo "


Multiple specifiers

"; - echo "sscanf(\"jabberwocky 1024 0xFF 1.024 644 10\", - \"%s %d %x %f %o %i\", - &\$string,&\$decimal,&\$hex,&\$float,&\$octal,&\$int);
"; - echo "
BEFORE :
"; - echo "Decimal = $decimal, String = $string, Hex = $hex
"; - echo "Octal = $octal , Float = $float, Int = $int
"; - $foo = sscanf( "jabberwocky 1024 0xFF 1.024 644 10", - "%s %d %x %f %o %i", - &$string,&$decimal,&$hex,&$float,&$octal,&$int); - echo "
AFTER :
"; - echo "decimal = $decimal, string = $string, hex = $hex
"; - echo "octal = $octal , float = $float, int = $int
"; - - echo " sscan reports : "; - print_value( $foo,""); - echo " conversions
"; - echo "----------------------------------------
"; -} - - - -?> - - - Test of sscanf() - - -

Testing sscanf() support in PHP


- I'm sorry but sscanf() does not exist !i
"; - } else { - simple_tests(); - run_sscanf_test_cases(); - } - ?> - - diff --git a/tests/testswf b/tests/testswf deleted file mode 100644 index e26733237d8..00000000000 --- a/tests/testswf +++ /dev/null @@ -1,120 +0,0 @@ -