Skip to content

Commit

Permalink
-testing the tests
Browse files Browse the repository at this point in the history
-moved tests/dirname.phpt to tests/run-test/test007.phpt because many
 tests use this to find their additional files.
-no more tests in tests directly only in subdirectories
  • Loading branch information
helly25 committed Nov 4, 2002
1 parent abdf302 commit 2b92754
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/run-test/test001.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--TEST--
EXPECT
--FILE--
abc
--EXPECT--
abc
18 changes: 18 additions & 0 deletions tests/run-test/test002.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
EXPECTF
--FILE--
123
-123
+123
+1.1
abc
0abc
x
--EXPECTF--
%d
%i
%i
%f
%s
%x
%c
6 changes: 6 additions & 0 deletions tests/run-test/test003.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--TEST--
EXPECTREGEX
--FILE--
abcde12314235xyz34264768286abcde
--EXPECTREGEX--
[abcde]+[0-5]*xyz[2-8]+abcde
10 changes: 10 additions & 0 deletions tests/run-test/test004.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--TEST--
INI section allows '='
--INI--
arg_separator.input==
--FILE--
<?php
var_dump(ini_get('arg_separator.input'));
?>
--EXPECT--
string(1) "="
28 changes: 28 additions & 0 deletions tests/run-test/test005.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
Error message handling
--FILE--
<?php
// If this test fails ask the developers of run-test.php
//
// We check the general ini settings which affect error handling
// and than verify if a message is given by a division by zero.
// EXPECTF is used here since the error format may change but ut
// should always contain 'Division by zero'.
var_dump(ini_get('display_errors'));
var_dump(ini_get('error_reporting'));
var_dump(ini_get('log_errors'));
var_dump(ini_get('track_errors'));
ini_set('display_errors', 0);
var_dump(ini_get('display_errors'));
var_dump($php_errormsg);
$error = 1 / 0;
var_dump($php_errormsg);
?>
--EXPECTF--
string(1) "1"
string(4) "2047"
string(1) "0"
string(1) "1"
string(1) "0"
NULL
string(%d) "%sivision by zer%s"
9 changes: 9 additions & 0 deletions tests/run-test/test006.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--TEST--
Error messages are shown
--FILE--
<?php
// If this test fails ask the developers of run-test.php
$error = 1 / 0;
?>
--EXPECTREGEX--
.*Division by zero.*
File renamed without changes.

0 comments on commit 2b92754

Please sign in to comment.