[PHP-CVS] cvs: php-src /ext/sqlite/tests sqlite_exec_basic.phpt sqlite_exec_error.phpt sqlite_last_error_basic.phpt sqlite_last_error_error.phpt sqlite_popen_basic.phpt sqlite_popen_error.phpt sqlite_

2008-10-29 Thread Felix De Vliegher
felixdv Wed Oct 29 11:43:33 2008 UTC

  Added files: 
/php-src/ext/sqlite/tests   sqlite_popen_basic.phpt 
sqlite_popen_error.phpt 
sqlite_exec_basic.phpt 
sqlite_exec_error.phpt 
sqlite_session_001.phpt 
sqlite_session_002.phpt 
sqlite_last_error_basic.phpt 
sqlite_last_error_error.phpt 
  Log:
  Various tests for the sqlite ext.
  The sqlite session tests are by Mats Lindh mats at lindh.no.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_popen_basic.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_popen_basic.phpt
+++ php-src/ext/sqlite/tests/sqlite_popen_basic.phpt
--TEST--
SQLite: sqlite_popen() basic tests
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip; ?
--FILE--
?php
/* Prototype  : resource sqlite_popen(string filename [, int mode [, string 
error_message]])
 * Description: Opens a persistent handle to a SQLite database. Will create the 
database if it does not exist.
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions:
*/

$db1 = sqlite_popen(:memory:);
$db2 = sqlite_popen(:memory:);

var_dump($db1);
var_dump($db2);

list($resourceId1) = sscanf((string) $db1, resource(%d) of type 
(sqlite database (persistent)));
list($resourceId2) = sscanf((string) $db2, resource(%d) of type 
(sqlite database (persistent)));

var_dump($resourceId1 === $resourceId2);
?
--EXPECTF--
resource(%d) of type (sqlite database (persistent))
resource(%d) of type (sqlite database (persistent))
bool(true)

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_popen_error.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_popen_error.phpt
+++ php-src/ext/sqlite/tests/sqlite_popen_error.phpt
--TEST--
Test sqlite_popen() function : error conditions 
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip sqlite extension not 
loaded; ?
--FILE--
?php
/* Prototype  : resource sqlite_popen(string filename [, int mode [, string 
error_message]])
 * Description: Opens a persistent handle to a SQLite database. Will create the 
database if it does not exist. 
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions: 
 */

$message = '';

echo *** Testing sqlite_popen() : error conditions ***\n;

var_dump( sqlite_popen() );
var_dump( sqlite_popen(:memory:, 0666, $message, 'foobar') );
var_dump( sqlite_popen(, 0666, $message) );
var_dump( $message );

?
===DONE===
--EXPECTF--
*** Testing sqlite_popen() : error conditions ***

Warning: sqlite_popen() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: sqlite_popen() expects at most 3 parameters, 4 given in %s on line %d
NULL
bool(false)
NULL
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_exec_basic.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_exec_basic.phpt
+++ php-src/ext/sqlite/tests/sqlite_exec_basic.phpt
--TEST--
Test sqlite_exec() function : basic functionality 
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip sqlite extension not 
loaded; ?
--FILE--
?php
/* Prototype  : boolean sqlite_exec(string query, resource db[, string 
error_message])
 * Description: Executes a result-less query against a given database 
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions: 
 */

echo *** Testing sqlite_exec() : basic functionality ***\n;

// set up variables
$query = 'CREATE TABLE foobar (id INTEGER PRIMARY KEY, name CHAR(255));';
$error_message = null;

// procedural
$db = sqlite_open(':memory:');
var_dump( sqlite_exec($db, $query) );
sqlite_close($db);

// oo-style
$db = new SQLiteDatabase(':memory:');
var_dump( $db-queryExec($query, $error_message) );

?
===DONE===
--EXPECTF--
*** Testing sqlite_exec() : basic functionality ***
bool(true)
bool(true)
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_exec_error.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_exec_error.phpt
+++ php-src/ext/sqlite/tests/sqlite_exec_error.phpt
--TEST--
Test sqlite_exec() function : error behaviour and functionality 
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip sqlite extension not 
loaded; ?
--FILE--
?php
/* Prototype  : boolean sqlite_exec(string query, resource db[, string 
error_message])
 * Description: Executes a result-less query against a given database 
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions: 
 */

echo *** Testing sqlite_exec() : error functionality ***\n;

// set up variables
$fail = 'CRE ATE TABLE';
$error_message = null;

// procedural
$db = sqlite_open(':memory:');
var_dump( sqlite_exec($db, $fail, $error_message) );
var_dump( $error_message );
var_dump( sqlite_exec($db) );
sqlite_close($db);

// oo-style
$db = new SQLiteDatabase(':memory:');
var_dump( $db-queryExec($fail, 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sqlite/tests sqlite_exec_basic.phpt sqlite_exec_error.phpt sqlite_last_error_basic.phpt sqlite_last_error_error.phpt sqlite_popen_basic.phpt sqlite_popen_error.php

2008-10-29 Thread Felix De Vliegher
felixdv Wed Oct 29 11:44:34 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/sqlite/tests   sqlite_popen_basic.phpt 
sqlite_popen_error.phpt 
sqlite_exec_basic.phpt 
sqlite_exec_error.phpt 
sqlite_session_001.phpt 
sqlite_session_002.phpt 
sqlite_last_error_basic.phpt 
sqlite_last_error_error.phpt 
  Log:
  MFH: Various tests for the sqlite ext.
  The sqlite session tests are by Mats Lindh mats at lindh.no.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_popen_basic.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_popen_basic.phpt
+++ php-src/ext/sqlite/tests/sqlite_popen_basic.phpt
--TEST--
SQLite: sqlite_popen() basic tests
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip; ?
--FILE--
?php
/* Prototype  : resource sqlite_popen(string filename [, int mode [, string 
error_message]])
 * Description: Opens a persistent handle to a SQLite database. Will create the 
database if it does not exist.
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions:
*/

$db1 = sqlite_popen(:memory:);
$db2 = sqlite_popen(:memory:);

var_dump($db1);
var_dump($db2);

list($resourceId1) = sscanf((string) $db1, resource(%d) of type 
(sqlite database (persistent)));
list($resourceId2) = sscanf((string) $db2, resource(%d) of type 
(sqlite database (persistent)));

var_dump($resourceId1 === $resourceId2);
?
--EXPECTF--
resource(%d) of type (sqlite database (persistent))
resource(%d) of type (sqlite database (persistent))
bool(true)

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_popen_error.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_popen_error.phpt
+++ php-src/ext/sqlite/tests/sqlite_popen_error.phpt
--TEST--
Test sqlite_popen() function : error conditions 
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip sqlite extension not 
loaded; ?
--FILE--
?php
/* Prototype  : resource sqlite_popen(string filename [, int mode [, string 
error_message]])
 * Description: Opens a persistent handle to a SQLite database. Will create the 
database if it does not exist. 
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions: 
 */

$message = '';

echo *** Testing sqlite_popen() : error conditions ***\n;

var_dump( sqlite_popen() );
var_dump( sqlite_popen(:memory:, 0666, $message, 'foobar') );
var_dump( sqlite_popen(, 0666, $message) );
var_dump( $message );

?
===DONE===
--EXPECTF--
*** Testing sqlite_popen() : error conditions ***

Warning: sqlite_popen() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: sqlite_popen() expects at most 3 parameters, 4 given in %s on line %d
NULL
bool(false)
NULL
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_exec_basic.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_exec_basic.phpt
+++ php-src/ext/sqlite/tests/sqlite_exec_basic.phpt
--TEST--
Test sqlite_exec() function : basic functionality 
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip sqlite extension not 
loaded; ?
--FILE--
?php
/* Prototype  : boolean sqlite_exec(string query, resource db[, string 
error_message])
 * Description: Executes a result-less query against a given database 
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions: 
 */

echo *** Testing sqlite_exec() : basic functionality ***\n;

// set up variables
$query = 'CREATE TABLE foobar (id INTEGER PRIMARY KEY, name CHAR(255));';
$error_message = null;

// procedural
$db = sqlite_open(':memory:');
var_dump( sqlite_exec($db, $query) );
sqlite_close($db);

// oo-style
$db = new SQLiteDatabase(':memory:');
var_dump( $db-queryExec($query, $error_message) );

?
===DONE===
--EXPECTF--
*** Testing sqlite_exec() : basic functionality ***
bool(true)
bool(true)
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/sqlite_exec_error.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite/tests/sqlite_exec_error.phpt
+++ php-src/ext/sqlite/tests/sqlite_exec_error.phpt
--TEST--
Test sqlite_exec() function : error behaviour and functionality 
--SKIPIF--
?php if (!extension_loaded(sqlite)) print skip sqlite extension not 
loaded; ?
--FILE--
?php
/* Prototype  : boolean sqlite_exec(string query, resource db[, string 
error_message])
 * Description: Executes a result-less query against a given database 
 * Source code: ext/sqlite/sqlite.c
 * Alias to functions: 
 */

echo *** Testing sqlite_exec() : error functionality ***\n;

// set up variables
$fail = 'CRE ATE TABLE';
$error_message = null;

// procedural
$db = sqlite_open(':memory:');
var_dump( sqlite_exec($db, $fail, $error_message) );
var_dump( $error_message );
var_dump( sqlite_exec($db) );
sqlite_close($db);

// oo-style
$db = new SQLiteDatabase(':memory:');
var_dump( 

[PHP-CVS] cvs: php-src /ext/standard math.c

2008-10-29 Thread Felix De Vliegher
felixdv Wed Oct 29 21:43:30 2008 UTC

  Modified files:  
/php-src/ext/standard   math.c 
  Log:
  Fix typo.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/math.c?r1=1.148r2=1.149diff_format=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.148 php-src/ext/standard/math.c:1.149
--- php-src/ext/standard/math.c:1.148   Wed Oct 29 20:17:43 2008
+++ php-src/ext/standard/math.c Wed Oct 29 21:43:30 2008
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: math.c,v 1.148 2008/10/29 20:17:43 iliaa Exp $ */
+/* $Id: math.c,v 1.149 2008/10/29 21:43:30 felixdv Exp $ */
 
 #include php.h
 #include php_math.h
@@ -73,7 +73,7 @@
}
} else {
t = ceil(-x);
-   if ((t x)  0.501) {
+   if ((t + x)  0.501) {
t -= 1.0;
}
t = -t; 



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



[PHP-CVS] cvs: php-src /ext/sqlite3/tests sqlite3stmt_paramCount_basic.phpt sqlite3stmt_paramCount_error.phpt

2008-10-29 Thread Felix De Vliegher
felixdv Wed Oct 29 22:35:52 2008 UTC

  Added files: 
/php-src/ext/sqlite3/tests  sqlite3stmt_paramCount_basic.phpt 
sqlite3stmt_paramCount_error.phpt 
  Log:
  Tests for SQLite3Stmt::paramCount().
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_basic.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_basic.phpt
+++ php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_basic.phpt
--TEST--
SQLite3Stmt::paramCount basic test
--SKIPIF--
?php require_once(dirname(__FILE__) . '/skipif.inc'); ?
--FILE--
?php

require_once(dirname(__FILE__) . '/new_db.inc');

echo Creating Table\n;
var_dump($db-exec('CREATE TABLE foobar (id INTEGER, name STRING, city 
STRING)'));

echo INSERT into table\n;
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (1, 'john', 
'LA')));
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (2, 'doe', 
'SF')));


$queryArray = array(
SELECT * FROM foobar WHERE id = ? ORDER BY id ASC,
SELECT * FROM foobar WHERE id = 2 ORDER BY id ASC,
SELECT * FROM foobar WHERE id = :id AND name = :name ORDER BY id ASC,
SELECT * FROM foobar WHERE id = 1 AND name = :name ORDER BY id ASC,
);

echo SELECTING results\n;

foreach($queryArray as $key = $query) {
$stmt = $db-prepare($query);

echo 'Param count for query ' . ($key + 1) . :\n;
var_dump($stmt-paramCount());

$result = $stmt-execute();
}

echo Closing database\n;
$stmt = null;
$result = null;
var_dump($db-close());
echo Done\n;
?
--EXPECTF--
Creating Table
bool(true)
INSERT into table
bool(true)
bool(true)
SELECTING results
Param count for query 1:
int(1)
Param count for query 2:
int(0)
Param count for query 3:
int(2)
Param count for query 4:
int(1)
Closing database
bool(true)
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_error.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_error.phpt
+++ php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_error.phpt
--TEST--
SQLite3Stmt::paramCount error test
--SKIPIF--
?php require_once(dirname(__FILE__) . '/skipif.inc'); ?
--FILE--
?php

require_once(dirname(__FILE__) . '/new_db.inc');

echo Creating Table\n;
var_dump($db-exec('CREATE TABLE foobar (id INTEGER, name STRING, city 
STRING)'));

echo INSERT into table\n;
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (1, 'john', 
'LA')));
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (2, 'doe', 
'SF')));


$query = SELECT * FROM foobar WHERE id = ? ORDER BY id ASC;

echo SELECTING results\n;

$stmt = $db-prepare($query);

echo paramCount with wrong number of arguments\n;
var_dump($stmt-paramCount('foobar'));
$result = $stmt-execute();
echo Closing database\n;
$stmt = null;
$result = null;
var_dump($db-close());
echo Done\n;
?
--EXPECTF--
Creating Table
bool(true)
INSERT into table
bool(true)
bool(true)
SELECTING results
paramCount with wrong number of arguments

Warning: SQLite3Stmt::paramCount() expects exactly 0 parameters, 1 given in %s 
on line %d
NULL
Closing database
bool(true)
Done



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sqlite3/tests sqlite3stmt_paramCount_basic.phpt sqlite3stmt_paramCount_error.phpt

2008-10-29 Thread Felix De Vliegher
felixdv Wed Oct 29 22:36:20 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/sqlite3/tests  sqlite3stmt_paramCount_basic.phpt 
sqlite3stmt_paramCount_error.phpt 
  Log:
  MFH: Tests for SQLite3Stmt::paramCount().
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_basic.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_basic.phpt
+++ php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_basic.phpt
--TEST--
SQLite3Stmt::paramCount basic test
--SKIPIF--
?php require_once(dirname(__FILE__) . '/skipif.inc'); ?
--FILE--
?php

require_once(dirname(__FILE__) . '/new_db.inc');

echo Creating Table\n;
var_dump($db-exec('CREATE TABLE foobar (id INTEGER, name STRING, city 
STRING)'));

echo INSERT into table\n;
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (1, 'john', 
'LA')));
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (2, 'doe', 
'SF')));


$queryArray = array(
SELECT * FROM foobar WHERE id = ? ORDER BY id ASC,
SELECT * FROM foobar WHERE id = 2 ORDER BY id ASC,
SELECT * FROM foobar WHERE id = :id AND name = :name ORDER BY id ASC,
SELECT * FROM foobar WHERE id = 1 AND name = :name ORDER BY id ASC,
);

echo SELECTING results\n;

foreach($queryArray as $key = $query) {
$stmt = $db-prepare($query);

echo 'Param count for query ' . ($key + 1) . :\n;
var_dump($stmt-paramCount());

$result = $stmt-execute();
}

echo Closing database\n;
$stmt = null;
$result = null;
var_dump($db-close());
echo Done\n;
?
--EXPECTF--
Creating Table
bool(true)
INSERT into table
bool(true)
bool(true)
SELECTING results
Param count for query 1:
int(1)
Param count for query 2:
int(0)
Param count for query 3:
int(2)
Param count for query 4:
int(1)
Closing database
bool(true)
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_error.phpt?view=markuprev=1.1
Index: php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_error.phpt
+++ php-src/ext/sqlite3/tests/sqlite3stmt_paramCount_error.phpt
--TEST--
SQLite3Stmt::paramCount error test
--SKIPIF--
?php require_once(dirname(__FILE__) . '/skipif.inc'); ?
--FILE--
?php

require_once(dirname(__FILE__) . '/new_db.inc');

echo Creating Table\n;
var_dump($db-exec('CREATE TABLE foobar (id INTEGER, name STRING, city 
STRING)'));

echo INSERT into table\n;
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (1, 'john', 
'LA')));
var_dump($db-exec(INSERT INTO foobar (id, name, city) VALUES (2, 'doe', 
'SF')));


$query = SELECT * FROM foobar WHERE id = ? ORDER BY id ASC;

echo SELECTING results\n;

$stmt = $db-prepare($query);

echo paramCount with wrong number of arguments\n;
var_dump($stmt-paramCount('foobar'));
$result = $stmt-execute();
echo Closing database\n;
$stmt = null;
$result = null;
var_dump($db-close());
echo Done\n;
?
--EXPECTF--
Creating Table
bool(true)
INSERT into table
bool(true)
bool(true)
SELECTING results
paramCount with wrong number of arguments

Warning: SQLite3Stmt::paramCount() expects exactly 0 parameters, 1 given in %s 
on line %d
NULL
Closing database
bool(true)
Done



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



Re: [PHP-CVS] cvs: php-src /ext/fileinfo/libmagic compress.c

2008-09-06 Thread Felix De Vliegher

Hi Ilia

I might be wrong but with removing those, building actually fails with  
me.


/home/felixdv/php/cvs/php6dev/ext/fileinfo/libmagic/compress.c: In  
function 'file_zmagic':
/home/felixdv/php/cvs/php6dev/ext/fileinfo/libmagic/compress.c:106:  
error: 'ncompr' undeclared (first use in this function)
/home/felixdv/php/cvs/php6dev/ext/fileinfo/libmagic/compress.c:106:  
error: (Each undeclared identifier is reported only once
/home/felixdv/php/cvs/php6dev/ext/fileinfo/libmagic/compress.c:106:  
error: for each function it appears in.)
/home/felixdv/php/cvs/php6dev/ext/fileinfo/libmagic/compress.c: In  
function 'sread':
/home/felixdv/php/cvs/php6dev/ext/fileinfo/libmagic/compress.c:183:  
error: 'cnt' undeclared (first use in this function)


Regards,
Felix

Op 6-sep-08, om 23:32 heeft Ilia Alshanetsky het volgende geschreven:


iliaa   Sat Sep  6 21:32:32 2008 UTC

 Modified files:
   /php-src/ext/fileinfo/libmagic   compress.c
 Log:
 MFB: removed unused variables


http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/compress.c?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/fileinfo/libmagic/compress.c
diff -u php-src/ext/fileinfo/libmagic/compress.c:1.2 php-src/ext/ 
fileinfo/libmagic/compress.c:1.3
--- php-src/ext/fileinfo/libmagic/compress.c:1.2	Tue Aug 26 12:24:12  
2008

+++ php-src/ext/fileinfo/libmagic/compress.cSat Sep  6 21:32:32 2008
@@ -80,8 +80,6 @@
{ BZh,  3, { bzip2, -cd, NULL }, 1 },   /* bzip2-ed */
};

-private size_t ncompr = sizeof(compr) / sizeof(compr[0]);
-
#define NODATA ((size_t)~0)


@@ -170,7 +168,7 @@
protected ssize_t
sread(int fd, void *buf, size_t n, int canbepipe)
{
-   int rv, cnt;
+   int rv;
#ifdef FIONREAD
int t = 0;
#endif



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




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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/misc browscap.ini browsernames.php get_browser_basic.phpt get_browser_error.phpt get_browser_variation1.phpt

2008-09-06 Thread Felix De Vliegher
felixdv Sat Sep  6 23:20:15 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/miscbrowscap.ini browsernames.php 
get_browser_basic.phpt 
get_browser_error.phpt 
get_browser_variation1.phpt 
  Log:
  Tests for get_browser()
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/misc/browscap.ini?view=markuprev=1.1
Index: php-src/ext/standard/tests/misc/browscap.ini
+++ php-src/ext/standard/tests/misc/browscap.ini

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/misc/browsernames.php?view=markuprev=1.1
Index: php-src/ext/standard/tests/misc/browsernames.php
+++ php-src/ext/standard/tests/misc/browsernames.php

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/misc/get_browser_basic.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/misc/get_browser_basic.phpt
+++ php-src/ext/standard/tests/misc/get_browser_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/misc/get_browser_error.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/misc/get_browser_error.phpt
+++ php-src/ext/standard/tests/misc/get_browser_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/misc/get_browser_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/misc/get_browser_variation1.phpt
+++ php-src/ext/standard/tests/misc/get_browser_variation1.phpt



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



[PHP-CVS] cvs: php-src / run-tests.php

2008-08-29 Thread Felix De Vliegher
felixdv Fri Aug 29 10:25:35 2008 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  Added %unicode_string_optional% for differences in output between PHP 5 and 6
  
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.374r2=1.375diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.374 php-src/run-tests.php:1.375
--- php-src/run-tests.php:1.374 Thu Aug 14 23:29:59 2008
+++ php-src/run-tests.php   Fri Aug 29 10:25:35 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.374 2008/08/14 23:29:59 jani Exp $ */
+/* $Id: run-tests.php,v 1.375 2008/08/29 10:25:35 felixdv Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -608,7 +608,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.374 $' . \n;
+   echo '$Revision: 1.375 $' . \n;
exit(1);
 
default:
@@ -1726,6 +1726,11 @@
if (isset($section_text['EXPECTF'])) {
$wanted_re = preg_quote($wanted_re, '/');
$wanted_re = str_replace(
+   array('%unicode_string_optional%'),
+   version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'Unicode string',
+   $wanted_re
+   );
+   $wanted_re = str_replace(
array('%unicode\|string%', '%string\|unicode%'),
version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'unicode',
$wanted_re



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



[PHP-CVS] cvs: php-src(PHP_5_3) / run-tests.php

2008-08-29 Thread Felix De Vliegher
felixdv Fri Aug 29 10:25:54 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcrun-tests.php 
  Log:
  Added %unicode_string_optional% for differences in output between PHP 5 and 6
  
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.43r2=1.226.2.37.2.35.2.44diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.43 
php-src/run-tests.php:1.226.2.37.2.35.2.44
--- php-src/run-tests.php:1.226.2.37.2.35.2.43  Thu Aug 14 20:53:56 2008
+++ php-src/run-tests.php   Fri Aug 29 10:25:54 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.43 2008/08/14 20:53:56 jani Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.44 2008/08/29 10:25:54 felixdv Exp $ 
*/
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -608,7 +608,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.35.2.43 
$' . \n;
+   echo '$Revision: 1.226.2.37.2.35.2.44 
$' . \n;
exit(1);
 
default:
@@ -1726,6 +1726,11 @@
if (isset($section_text['EXPECTF'])) {
$wanted_re = preg_quote($wanted_re, '/');
$wanted_re = str_replace(
+   array('%unicode_string_optional%'),
+   version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'Unicode string',
+   $wanted_re
+   );
+   $wanted_re = str_replace(
array('%unicode\|string%', '%string\|unicode%'),
version_compare(PHP_VERSION, '6.0.0-dev') == -1 
? 'string' : 'unicode',
$wanted_re



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/tests finfo_buffer_basic.phpt finfo_buffer_error.phpt finfo_buffer_variation1.phpt finfo_close_basic.phpt finfo_file_basic.phpt finfo_open_basic.phpt finf

2008-08-29 Thread Felix De Vliegher
felixdv Fri Aug 29 10:29:55 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/fileinfo/tests finfo_buffer_basic.phpt 
finfo_buffer_error.phpt 
finfo_buffer_variation1.phpt 
finfo_close_basic.phpt 
finfo_file_basic.phpt 
finfo_open_basic.phpt 
finfo_open_error.phpt 
finfo_open_variation1.phpt 
finfo_set_flags_basic.phpt magic 
  Log:
  Some fileinfo tests
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_buffer_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_buffer_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_buffer_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_buffer_error.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_buffer_error.phpt
+++ php-src/ext/fileinfo/tests/finfo_buffer_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_buffer_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_buffer_variation1.phpt
+++ php-src/ext/fileinfo/tests/finfo_buffer_variation1.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_close_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_close_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_close_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_file_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_file_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_file_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_open_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_open_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_error.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_open_error.phpt
+++ php-src/ext/fileinfo/tests/finfo_open_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_open_variation1.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_open_variation1.phpt
+++ php-src/ext/fileinfo/tests/finfo_open_variation1.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/tests/finfo_set_flags_basic.phpt?view=markuprev=1.1
Index: php-src/ext/fileinfo/tests/finfo_set_flags_basic.phpt
+++ php-src/ext/fileinfo/tests/finfo_set_flags_basic.phpt



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



[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2008-08-08 Thread Felix De Vliegher
felixdv Fri Aug  8 10:53:39 2008 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  MFB: Documentation fix for getClosure()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.308r2=1.309diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.308 
php-src/ext/reflection/php_reflection.c:1.309
--- php-src/ext/reflection/php_reflection.c:1.308   Tue Jul 29 08:48:16 2008
+++ php-src/ext/reflection/php_reflection.c Fri Aug  8 10:53:39 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.308 2008/07/29 08:48:16 tony2001 Exp $ */
+/* $Id: php_reflection.c,v 1.309 2008/08/08 10:53:39 felixdv Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1589,7 +1589,7 @@
 /* }}} */
 
 /* {{{ proto public mixed ReflectionFunction::getClosure()
-   Invokes the function */
+   Returns a dynamically created closure for the function */
 ZEND_METHOD(reflection_function, getClosure)
 {
reflection_object *intern;
@@ -5262,7 +5262,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.308 
2008/07/29 08:48:16 tony2001 Exp $);
+   php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.309 
2008/08/08 10:53:39 felixdv Exp $);
 
php_info_print_table_end();
 } /* }}} */



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/reflection/tests ReflectionFunction_getClosure_basic.phpt ReflectionFunction_getClosure_error.phpt ReflectionMethod_getClosure_basic.phpt ReflectionMethod_getClosu

2008-08-08 Thread Felix De Vliegher
felixdv Fri Aug  8 12:39:16 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/reflection/tests   
ReflectionMethod_getClosure_basic.phpt 
ReflectionMethod_getClosure_error.phpt 

ReflectionFunction_getClosure_basic.phpt 

ReflectionFunction_getClosure_error.phpt 
  Log:
  Tests for ReflectionMethod::getClosure() and ReflectionFunction::getClosure() 
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt
+++ php-src/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt
+++ php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionFunction_getClosure_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/ReflectionFunction_getClosure_basic.phpt
+++ php-src/ext/reflection/tests/ReflectionFunction_getClosure_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionFunction_getClosure_error.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/ReflectionFunction_getClosure_error.phpt
+++ php-src/ext/reflection/tests/ReflectionFunction_getClosure_error.phpt



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



[PHP-CVS] cvs: php-src /ext/reflection/tests ReflectionFunction_getClosure_basic.phpt ReflectionFunction_getClosure_error.phpt ReflectionMethod_getClosure_basic.phpt ReflectionMethod_getClosure_error.

2008-08-08 Thread Felix De Vliegher
felixdv Fri Aug  8 12:42:40 2008 UTC

  Modified files:  
/php-src/ext/reflection/tests   
ReflectionMethod_getClosure_basic.phpt 
ReflectionMethod_getClosure_error.phpt 

ReflectionFunction_getClosure_basic.phpt 

ReflectionFunction_getClosure_error.phpt 
  Log:
  MFB: Tests for ReflectionMethod::getClosure() and 
ReflectionFunction::getClosure()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt
diff -u /dev/null 
php-src/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt:1.2
--- /dev/null   Fri Aug  8 12:42:40 2008
+++ php-src/ext/reflection/tests/ReflectionMethod_getClosure_basic.phpt Fri Aug 
 8 12:42:40 2008
@@ -0,0 +1,55 @@
+--TEST--
+Test ReflectionMethod::getClosure() function : basic functionality 
+--FILE--
+?php
+/* Prototype  : public mixed ReflectionFunction::getClosure()
+ * Description: Returns a dynamically created closure for the method 
+ * Source code: ext/reflection/php_reflection.c
+ * Alias to functions: 
+ */
+
+echo *** Testing ReflectionMethod::getClosure() : basic functionality ***\n;
+
+class StaticExample
+{
+   static function foo()
+   {
+   var_dump( Static Example class, Hello World! );
+   }
+}
+
+class Example
+{
+   public $bar = 42;
+   public function foo()
+   {
+   var_dump( Example class, bar:  . $this-bar );
+   }
+}
+
+// Initialize classes
+$class = new ReflectionClass( 'Example' );
+$staticclass = new ReflectionClass( 'StaticExample' );
+$object = new Example();
+$fakeobj = new StdClass();
+
+
+$method = $staticclass-getMethod( 'foo' );
+$closure = $method-getClosure();
+$closure();
+
+$method = $class-getMethod( 'foo' );
+
+$closure = $method-getClosure( $object );
+$closure();
+$object-bar = 34;
+$closure();
+
+?
+===DONE===
+--EXPECTF--
+*** Testing ReflectionMethod::getClosure() : basic functionality ***
+%unicode|string%(34) Static Example class, Hello World!
+%unicode|string%(22) Example class, bar: 42
+%unicode|string%(22) Example class, bar: 34
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt
diff -u /dev/null 
php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:1.2
--- /dev/null   Fri Aug  8 12:42:40 2008
+++ php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt Fri Aug 
 8 12:42:40 2008
@@ -0,0 +1,73 @@
+--TEST--
+Test ReflectionMethod::getClosure() function : error functionality
+--FILE--
+?php
+/* Prototype  : public mixed ReflectionFunction::getClosure()
+ * Description: Returns a dynamically created closure for the method
+ * Source code: ext/reflection/php_reflection.c
+ * Alias to functions:
+ */
+
+echo *** Testing ReflectionMethod::getClosure() : error conditions ***\n;
+
+class StaticExample
+{
+   static function foo()
+   {
+   var_dump( Static Example class, Hello World! );
+   }
+}
+
+class Example
+{
+   public $bar = 42;
+   public function foo()
+   {
+   var_dump( Example class, bar:  . $this-bar );
+   }
+}
+
+// Initialize classes
+$class = new ReflectionClass( 'Example' );
+$staticclass = new ReflectionClass( 'StaticExample' );
+$method = $class-getMethod( 'foo' );
+$staticmethod = $staticclass-getMethod( 'foo' );
+$object = new Example();
+$fakeobj = new StdClass();
+
+echo \n-- Testing ReflectionMethod::getClosure() function with more than 
expected no. of arguments --\n;
+var_dump( $staticmethod-getClosure( 'foobar' ) );
+var_dump( $staticmethod-getClosure( 'foo', 'bar' ) );
+var_dump( $method-getClosure( $object, 'foobar' ) );
+
+echo \n-- Testing ReflectionMethod::getClosure() function with Zero arguments 
--\n;
+$closure = $method-getClosure();
+
+echo \n-- Testing ReflectionMethod::getClosure() function with Zero arguments 
--\n;
+try {
+var_dump( $method-getClosure( $fakeobj ) );
+} catch( Exception $e ) {
+var_dump( $e-getMessage() );
+}
+
+?
+===DONE===
+--EXPECTF--
+*** Testing ReflectionMethod::getClosure() : error conditions ***
+
+-- Testing ReflectionMethod::getClosure() function with more than expected no. 
of arguments --
+object(Closure)#%d (0) {
+}
+object(Closure)#%d (0) {
+}
+
+Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 2 given 
in %s on line %d
+NULL
+
+-- Testing ReflectionMethod::getClosure() function with Zero arguments --
+
+Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 0 given 
in %s on line %d
+
+-- Testing ReflectionMethod::getClosure() function with Zero arguments --
+%unicode|string%(72) Given object is 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/reflection php_reflection.c

2008-08-08 Thread Felix De Vliegher
felixdv Fri Aug  8 10:52:49 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/reflection php_reflection.c 
  Log:
  Documentation fix for getClosure()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.26r2=1.164.2.33.2.45.2.27diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.26 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.27
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.26Sat Jul 
26 13:14:03 2008
+++ php-src/ext/reflection/php_reflection.c Fri Aug  8 10:52:48 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.26 2008/07/26 13:14:03 dmitry Exp 
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.27 2008/08/08 10:52:48 felixdv 
Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1565,7 +1565,7 @@
 /* }}} */
 
 /* {{{ proto public mixed ReflectionFunction::getClosure()
-   Invokes the function */
+   Returns a dynamically created closure for the function */
 ZEND_METHOD(reflection_function, getClosure)
 {
reflection_object *intern;
@@ -5117,7 +5117,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Id: php_reflection.c,v 
1.164.2.33.2.45.2.26 2008/07/26 13:14:03 dmitry Exp $);
+   php_info_print_table_row(2, Version, $Id: php_reflection.c,v 
1.164.2.33.2.45.2.27 2008/08/08 10:52:48 felixdv Exp $);
 
php_info_print_table_end();
 } /* }}} */



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/filters stream_filter_remove_basic.phpt stream_filter_remove_error.phpt

2008-08-07 Thread Felix De Vliegher
felixdv Thu Aug  7 22:31:10 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/filters stream_filter_remove_basic.phpt 
stream_filter_remove_error.phpt 
  Log:
  Basic and error tests for stream_filter_remove()
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/filters/stream_filter_remove_basic.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/filters/stream_filter_remove_basic.phpt
+++ php-src/ext/standard/tests/filters/stream_filter_remove_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/filters/stream_filter_remove_error.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/filters/stream_filter_remove_error.phpt
+++ php-src/ext/standard/tests/filters/stream_filter_remove_error.phpt



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



[PHP-CVS] cvs: php-src /ext/standard/tests/filters stream_filter_remove_basic.phpt stream_filter_remove_error.phpt

2008-08-07 Thread Felix De Vliegher
felixdv Thu Aug  7 22:32:43 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/filters stream_filter_remove_basic.phpt 
stream_filter_remove_error.phpt 
  Log:
  MFB: Basic and error tests for stream_filter_remove().
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/filters/stream_filter_remove_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/filters/stream_filter_remove_basic.phpt
diff -u /dev/null 
php-src/ext/standard/tests/filters/stream_filter_remove_basic.phpt:1.2
--- /dev/null   Thu Aug  7 22:32:43 2008
+++ php-src/ext/standard/tests/filters/stream_filter_remove_basic.phpt  Thu Aug 
 7 22:32:43 2008
@@ -0,0 +1,48 @@
+--TEST--
+Test stream_filter_remove() function : basic functionality 
+--SKIPIF--
+?php
+$filters = stream_get_filters();
+if(! in_array( string.rot13, $filters )) die( skip rot13 filter not 
available. );
+?
+--FILE--
+?php
+/* Prototype  : bool stream_filter_remove(resource stream_filter)
+ * Description: Flushes any data in the filter's internal buffer, removes it 
from the chain, and frees the resource 
+ * Source code: ext/standard/streamsfuncs.c
+ * Alias to functions: 
+ */
+
+echo *** Testing stream_filter_remove() : basic functionality ***\n;
+
+$file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
+touch( $file );
+
+$fp = fopen( $file, 'w+' );
+stream_encoding( $fp, 'unicode' );
+
+$filter = stream_filter_append( $fp, string.rot13, STREAM_FILTER_WRITE );
+fwrite( $fp, Testing the rot13 filter which shifts some things around. );
+
+var_dump( stream_filter_remove( $filter ) );
+fwrite( $fp, \nadd some more un-filtered foobar\n );
+
+rewind( $fp );
+fpassthru( $fp );
+fclose( $fp );
+
+?
+===DONE===
+--CLEAN--
+?php
+
+$file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
+unlink( $file );
+
+?
+--EXPECTF--
+*** Testing stream_filter_remove() : basic functionality ***
+bool(true)
+Grfgvat gur ebg13 svygre juvpu fuvsgf fbzr guvatf nebhaq.
+add some more un-filtered foobar
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/filters/stream_filter_remove_error.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/filters/stream_filter_remove_error.phpt
diff -u /dev/null 
php-src/ext/standard/tests/filters/stream_filter_remove_error.phpt:1.2
--- /dev/null   Thu Aug  7 22:32:43 2008
+++ php-src/ext/standard/tests/filters/stream_filter_remove_error.phpt  Thu Aug 
 7 22:32:43 2008
@@ -0,0 +1,80 @@
+--TEST--
+Test stream_filter_remove() function : error conditions 
+--SKIPIF--
+?php
+$filters = stream_get_filters();
+if(! in_array( string.rot13, $filters )) die( skip rot13 filter not 
available. );
+?
+--FILE--
+?php
+/* Prototype  : bool stream_filter_remove(resource stream_filter)
+ * Description: Flushes any data in the filter's internal buffer, removes it 
from the chain, and frees the resource 
+ * Source code: ext/standard/streamsfuncs.c
+ * Alias to functions: 
+ */
+
+$file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
+touch( $file );
+$fp = fopen( $file, 'w+' );
+$filter = stream_filter_append( $fp, string.rot13, STREAM_FILTER_WRITE );
+
+echo *** Testing stream_filter_remove() : error conditions ***\n;
+
+echo \n-- Testing stream_filter_remove() function with Zero arguments --\n;
+var_dump( stream_filter_remove() );
+
+echo \n-- Testing stream_filter_remove() function with more than expected no. 
of arguments --\n;
+$arg = 'bogus arg';
+var_dump( stream_filter_remove( $filter, $arg ) );
+
+echo \n-- Testing stream_filter_remove() function with unexisting stream 
filter --\n;
+var_dump( stream_filter_remove( fakefilter ) );
+
+echo \n-- Testing stream_filter_remove() function with bad resource --\n;
+var_dump( stream_filter_remove( $fp ) );
+
+echo \n-- Testing stream_filter_remove() function with an already removed 
filter --\n;
+// Double remove it
+var_dump( stream_filter_remove( $filter ) );
+var_dump( stream_filter_remove( $filter ) );
+
+fclose( $fp );
+
+?
+===DONE===
+--CLEAN--
+?php
+
+$file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
+unlink( $file );
+
+?
+--EXPECTF--
+*** Testing stream_filter_remove() : error conditions ***
+
+-- Testing stream_filter_remove() function with Zero arguments --
+
+Warning: stream_filter_remove() expects exactly 1 parameter, 0 given in %s on 
line %d
+bool(false)
+
+-- Testing stream_filter_remove() function with more than expected no. of 
arguments --
+
+Warning: stream_filter_remove() expects exactly 1 parameter, 2 given in %s on 
line %d
+bool(false)
+
+-- Testing stream_filter_remove() function with unexisting stream filter --
+
+Warning: stream_filter_remove() expects parameter 1 to be resource, Unicode 
string given in %s on line %d
+bool(false)
+
+-- Testing stream_filter_remove() function with bad resource --
+
+Warning: stream_filter_remove(): Invalid resource given, not a stream filter 
in %s on line 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/strings strpbrk_basic.phpt strpbrk_error.phpt

2008-07-15 Thread Felix De Vliegher
felixdv Tue Jul 15 11:14:42 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings strpbrk_basic.phpt 
strpbrk_error.phpt 
  Log:
  Tests for strpbrk(), testfest.php.net task #91 and #92.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strpbrk_basic.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/strings/strpbrk_basic.phpt
+++ php-src/ext/standard/tests/strings/strpbrk_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strpbrk_error.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/strings/strpbrk_error.phpt
+++ php-src/ext/standard/tests/strings/strpbrk_error.phpt



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



[PHP-CVS] cvs: php-src /ext/standard/tests/strings strpbrk_basic.phpt strpbrk_error.phpt

2008-07-15 Thread Felix De Vliegher
felixdv Tue Jul 15 11:15:32 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/strings strpbrk_basic.phpt 
strpbrk_error.phpt 
  Log:
  MFB: Tests for strpbrk(), testfest.php.net task #91 and #92.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strpbrk_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/strings/strpbrk_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/strpbrk_basic.phpt:1.2
--- /dev/null   Tue Jul 15 11:15:32 2008
+++ php-src/ext/standard/tests/strings/strpbrk_basic.phpt   Tue Jul 15 
11:15:32 2008
@@ -0,0 +1,41 @@
+--TEST--
+Test strpbrk() function : basic functionality 
+--FILE--
+?php
+/* Prototype  : array strpbrk(string haystack, string char_list)
+ * Description: Search a string for any of a set of characters 
+ * Source code: ext/standard/string.c
+ * Alias to functions: 
+ */
+
+echo *** Testing strpbrk() : basic functionality ***\n;
+
+// Initialise all required variables
+$text = 'This is a Simple text.';
+var_dump( strpbrk($text, 'mi') );
+var_dump( strpbrk($text, 'ZS') );
+var_dump( strpbrk($text, 'Z') );
+var_dump( strpbrk($text, 'H') );
+
+$text = '';
+var_dump( strpbrk($text, 'foo') );
+
+$text =   aaa aaaSLR;
+var_dump( strpbrk($text, ' ') );
+
+var_dump( strpbrk(5, 5) );
+var_dump( strpbrk(5, 5) );
+
+?
+===DONE===
+--EXPECT--
+*** Testing strpbrk() : basic functionality ***
+unicode(20) is is a Simple text.
+unicode(12) Simple text.
+bool(false)
+bool(false)
+bool(false)
+unicode(12)   aaa aaaSLR
+unicode(1) 5
+unicode(1) 5
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strpbrk_error.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/strings/strpbrk_error.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/strpbrk_error.phpt:1.2
--- /dev/null   Tue Jul 15 11:15:32 2008
+++ php-src/ext/standard/tests/strings/strpbrk_error.phpt   Tue Jul 15 
11:15:32 2008
@@ -0,0 +1,57 @@
+--TEST--
+Test strpbrk() function : error conditions 
+--FILE--
+?php
+/* Prototype  : array strpbrk(string haystack, string char_list)
+ * Description: Search a string for any of a set of characters 
+ * Source code: ext/standard/string.c
+ * Alias to functions: 
+ */
+
+echo *** Testing strpbrk() : error conditions ***\n;
+
+$haystack = 'This is a Simple text.';
+$char_list = 'string_val';
+$extra_arg = 10;
+
+echo \n-- Testing strpbrk() function with more than expected no. of arguments 
--\n;
+var_dump( strpbrk($haystack, $char_list, $extra_arg) );
+
+echo \n-- Testing strpbrk() function with less than expected no. of arguments 
--\n;
+var_dump( strpbrk($haystack) );
+
+echo \n-- Testing strpbrk() function with empty second argument --\n;
+var_dump( strpbrk($haystack, '') );
+
+echo \n-- Testing strpbrk() function with arrays --\n;
+var_dump( strpbrk($haystack, array('a', 'b', 'c') ) );
+var_dump( strpbrk(array('foo', 'bar'), 'b') );
+
+?
+===DONE===
+--EXPECTF--
+*** Testing strpbrk() : error conditions ***
+
+-- Testing strpbrk() function with more than expected no. of arguments --
+
+Warning: strpbrk() expects exactly 2 parameters, 3 given in %s on line %d
+bool(false)
+
+-- Testing strpbrk() function with less than expected no. of arguments --
+
+Warning: strpbrk() expects exactly 2 parameters, 1 given in %s on line %d
+bool(false)
+
+-- Testing strpbrk() function with empty second argument --
+
+Warning: strpbrk(): The character list cannot be empty in %s on line %d
+bool(false)
+
+-- Testing strpbrk() function with arrays --
+
+Warning: strpbrk() expects parameter 2 to be string (Unicode or binary), array 
given in %s on line %d
+bool(false)
+
+Warning: strpbrk() expects parameter 1 to be string (Unicode or binary), array 
given in %s on line %d
+bool(false)
+===DONE===



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/file lchown_basic.phpt lchown_error.phpt

2008-06-26 Thread Felix De Vliegher
felixdv Thu Jun 26 09:10:54 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/filelchown_basic.phpt 
lchown_error.phpt 
  Log:
  Tests for lchown(), testfest.php.net task number 129.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/lchown_basic.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/lchown_basic.phpt
+++ php-src/ext/standard/tests/file/lchown_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/lchown_error.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/lchown_error.phpt
+++ php-src/ext/standard/tests/file/lchown_error.phpt



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



[PHP-CVS] cvs: php-src /ext/standard/tests/file lchown_basic.phpt lchown_error.phpt

2008-06-26 Thread Felix De Vliegher
felixdv Thu Jun 26 09:12:40 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/filelchown_basic.phpt 
lchown_error.phpt 
  Log:
  MFB: tests for lchown(), testfest.php.net task number 129.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/lchown_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/file/lchown_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/file/lchown_basic.phpt:1.2
--- /dev/null   Thu Jun 26 09:12:40 2008
+++ php-src/ext/standard/tests/file/lchown_basic.phpt   Thu Jun 26 09:12:40 2008
@@ -0,0 +1,43 @@
+--TEST--
+Test lchown() function : basic functionality 
+--SKIPIF--
+?php
+if (substr(PHP_OS, 0, 3) == 'WIN') die('Skip: no windows support');
+?
+--FILE--
+?php
+/* Prototype  : bool lchown (string filename, mixed user)
+ * Description: Change file owner of a symlink
+ * Source code: ext/standard/filestat.c
+ * Alias to functions: 
+ */
+
+echo *** Testing lchown() : basic functionality ***\n;
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
+$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
+
+$uid = posix_getuid();
+
+var_dump( touch( $filename ) );
+var_dump( symlink( $filename, $symlink ) );
+var_dump( lchown( $filename, $uid ) );
+var_dump( fileowner( $symlink ) === $uid );
+
+?
+===DONE===
+--CLEAN--
+?php
+
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
+$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
+unlink($filename);
+unlink($symlink);
+
+?
+--EXPECTF--
+*** Testing lchown() : basic functionality ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/lchown_error.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/file/lchown_error.phpt
diff -u /dev/null php-src/ext/standard/tests/file/lchown_error.phpt:1.2
--- /dev/null   Thu Jun 26 09:12:40 2008
+++ php-src/ext/standard/tests/file/lchown_error.phpt   Thu Jun 26 09:12:40 2008
@@ -0,0 +1,68 @@
+--TEST--
+Test lchown() function : error functionality 
+--SKIPIF--
+?php
+if (substr(PHP_OS, 0, 3) == 'WIN') die('Skip: no windows support');
+?
+--FILE--
+?php
+/* Prototype  : bool lchown (string filename, mixed user)
+ * Description: Change file owner of a symlink
+ * Source code: ext/standard/filestat.c
+ * Alias to functions: 
+ */
+
+echo *** Testing lchown() : error functionality ***\n;
+
+// Set up
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
+touch( $filename );
+$uid = posix_getuid();
+
+
+// Less than expected arguments
+var_dump( lchown( $filename ) );
+
+// More than expected arguments
+var_dump( lchown( $filename, $uid, 'foobar' ) );
+
+// Non-existant filename
+var_dump( lchown( 'foobar_lchown.txt', $uid ) );
+
+// Wrong argument types
+var_dump( lchown( new StdClass(), $uid ) );
+var_dump( lchown( array(), $uid ) );
+
+// Bad user
+var_dump( lchown( $filename, -5 ) );
+
+?
+===DONE===
+--CLEAN--
+?php
+
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
+unlink($filename);
+
+?
+--EXPECTF--
+*** Testing lchown() : error functionality ***
+
+Warning: lchown() expects exactly 2 parameters, 1 given in %s on line %d
+bool(true)
+
+Warning: lchown() expects exactly 2 parameters, 3 given in %s on line %d
+bool(true)
+
+Warning: lchown(): No such file or directory in %s on line %d
+bool(false)
+
+Warning: lchown() expects parameter 1 to be string (Unicode or binary), object 
given in %s on line %d
+bool(true)
+
+Warning: lchown() expects parameter 1 to be string (Unicode or binary), array 
given in %s on line %d
+bool(true)
+
+Warning: lchown(): Operation not permitted in %s on line %d
+bool(false)
+===DONE===



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/general_functions ob_get_flush_basic.phpt ob_get_flush_error.phpt

2008-06-24 Thread Felix De Vliegher
felixdv Tue Jun 24 10:31:03 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/general_functions   
ob_get_flush_basic.phpt 
ob_get_flush_error.phpt 
  Log:
  Tests for ob_get_flush(), testfest task number #131.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/ob_get_flush_basic.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/general_functions/ob_get_flush_basic.phpt
+++ php-src/ext/standard/tests/general_functions/ob_get_flush_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/ob_get_flush_error.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/general_functions/ob_get_flush_error.phpt
+++ php-src/ext/standard/tests/general_functions/ob_get_flush_error.phpt



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



[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions ob_get_flush_basic.phpt ob_get_flush_error.phpt

2008-06-24 Thread Felix De Vliegher
felixdv Tue Jun 24 10:33:38 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   
ob_get_flush_basic.phpt 
ob_get_flush_error.phpt 
  Log:
  MFB: tests for ob_get_flush(), testfest task number #131
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/ob_get_flush_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/general_functions/ob_get_flush_basic.phpt
diff -u /dev/null 
php-src/ext/standard/tests/general_functions/ob_get_flush_basic.phpt:1.2
--- /dev/null   Tue Jun 24 10:33:38 2008
+++ php-src/ext/standard/tests/general_functions/ob_get_flush_basic.phpt
Tue Jun 24 10:33:38 2008
@@ -0,0 +1,42 @@
+--TEST--
+Test ob_get_flush() function : basic functionality 
+--INI--
+output_buffering=0
+--FILE--
+?php
+/* Prototype  : bool ob_get_flush(void)
+ * Description: Get current buffer contents, flush (send) the output buffer, 
and delete current output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo *** Testing ob_get_flush() : basic functionality ***\n;
+
+ob_start();
+
+echo testing ob_get_flush() with some\nNewlines too\n;
+$string = ob_get_flush();
+
+var_dump( this is printed before returning the string );
+var_dump( $string );
+var_dump( ob_list_handlers() );
+
+// Empty string expected
+ob_start();
+$string = ob_get_flush();
+var_dump($string)
+
+?
+===DONE===
+--EXPECT--
+*** Testing ob_get_flush() : basic functionality ***
+testing ob_get_flush() with some
+Newlines too
+unicode(43) this is printed before returning the string
+string(46) testing ob_get_flush() with some
+Newlines too
+
+array(0) {
+}
+string(0) 
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/ob_get_flush_error.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/general_functions/ob_get_flush_error.phpt
diff -u /dev/null 
php-src/ext/standard/tests/general_functions/ob_get_flush_error.phpt:1.2
--- /dev/null   Tue Jun 24 10:33:38 2008
+++ php-src/ext/standard/tests/general_functions/ob_get_flush_error.phpt
Tue Jun 24 10:33:38 2008
@@ -0,0 +1,32 @@
+--TEST--
+Test ob_get_flush() function : error conditions 
+--INI--
+output_buffering=0
+--FILE--
+?php
+/* Prototype  : bool ob_get_flush(void)
+ * Description: Get current buffer contents, flush (send) the output buffer, 
and delete current output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo *** Testing ob_get_flush() : error conditions ***\n;
+
+// One extra argument
+$extra_arg = 10;
+var_dump( ob_get_flush( $extra_arg ) );
+
+// No ob_start() executed
+var_dump( ob_get_flush() );
+
+?
+===DONE===
+--EXPECTF--
+*** Testing ob_get_flush() : error conditions ***
+
+Warning: ob_get_flush() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+
+Notice: ob_get_flush(): failed to delete and flush buffer. No buffer to delete 
or flush in %s on line %d
+bool(false)
+===DONE===



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/general_functions ob_get_length_basic.phpt

2008-06-22 Thread Felix De Vliegher
felixdv Sun Jun 22 12:29:42 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/general_functions   

ob_get_length_basic.phpt 
  Log:
  Basic test for ob_get_length(), testfest.php.net task #132 
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/ob_get_length_basic.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/general_functions/ob_get_length_basic.phpt
+++ php-src/ext/standard/tests/general_functions/ob_get_length_basic.phpt



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



[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions ob_get_length_basic.phpt

2008-06-22 Thread Felix De Vliegher
felixdv Sun Jun 22 12:51:37 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   

ob_get_length_basic.phpt 
  Log:
  Basic test for ob_get_length(), testfest.php.net task #132
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/ob_get_length_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/general_functions/ob_get_length_basic.phpt
diff -u /dev/null 
php-src/ext/standard/tests/general_functions/ob_get_length_basic.phpt:1.2
--- /dev/null   Sun Jun 22 12:51:37 2008
+++ php-src/ext/standard/tests/general_functions/ob_get_length_basic.phpt   
Sun Jun 22 12:51:37 2008
@@ -0,0 +1,51 @@
+--TEST--
+Test ob_get_length() function : basic functionality 
+--INI--
+output_buffering=0
+--FILE--
+?php
+/* Prototype  : int ob_get_length(void)
+ * Description: Return the length of the output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+function dump_string_length( $string )
+{
+   ob_start();
+   echo $string;
+   $len = ob_get_length();
+   ob_end_clean();
+   var_dump( $len );
+}
+
+echo *** Testing ob_get_length() : basic functionality ***\n;
+
+// No buffering active
+var_dump( ob_get_length() );
+
+dump_string_length( 'foo bar length of a string' );
+dump_string_length( 'plus one' );
+dump_string_length( \0 );
+dump_string_length( 'lsf' );
+dump_string_length( '' );
+dump_string_length( null );
+
+// Extra argument
+var_dump( ob_get_length( 'foobar' ) );
+
+?
+===DONE===
+--EXPECTF--
+*** Testing ob_get_length() : basic functionality ***
+bool(false)
+int(26)
+int(8)
+int(1)
+int(15)
+int(0)
+int(0)
+
+Warning: ob_get_length() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+===DONE===



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



[PHP-CVS] cvs: php-src /ext/standard/tests/strings vfprintf_basic.phpt vfprintf_error1.phpt vfprintf_error2.phpt vfprintf_error3.phpt vfprintf_error4.phpt vfprintf_variation1.phpt

2008-06-22 Thread Felix De Vliegher
felixdv Sun Jun 22 13:31:10 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/strings vfprintf_basic.phpt 
vfprintf_error1.phpt 
vfprintf_error2.phpt 
vfprintf_error3.phpt 
vfprintf_error4.phpt 
vfprintf_variation1.phpt 
  Log:
  Testcases for vfprintf(), testfest task #133.
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/vfprintf_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/strings/vfprintf_basic.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/vfprintf_basic.phpt:1.2
--- /dev/null   Sun Jun 22 13:31:10 2008
+++ php-src/ext/standard/tests/strings/vfprintf_basic.phpt  Sun Jun 22 
13:31:10 2008
@@ -0,0 +1,72 @@
+--TEST--
+Test vfprintf() function : basic functionality 
+--INI--
+precision=14
+--FILE--
+?php
+/* Prototype  : int vfprintf(resource stream, string format, array args)
+ * Description: Output a formatted string into a stream 
+ * Source code: ext/standard/formatted_print.c
+ * Alias to functions: 
+ */
+
+function writeAndDump($fp, $format, $args)
+{
+   ftruncate( $fp, 0 );
+   $length = vfprintf( $fp, $format, $args );
+   rewind( $fp );
+   $content = stream_get_contents( $fp );
+   var_dump( $content );
+   var_dump( $length );
+}
+
+echo *** Testing vfprintf() : basic functionality ***\n;
+
+// Open handle
+$file = 'vfprintf_test.txt';
+$fp = fopen( $file, a+ );
+
+// Set unicode encoding
+stream_encoding( $fp, 'unicode' );
+
+// Test vfprintf()
+writeAndDump( $fp, Foo is %d and %s, array( 30, 'bar' ) );
+writeAndDump( $fp, %s %s %s, array( 'bar', 'bar', 'bar' ) );
+writeAndDump( $fp, %d digit, array( '54' ) );
+writeAndDump( $fp, %b %b, array( true, false ) );
+writeAndDump( $fp, %c %c %c, array( 65, 66, 67 ) );
+writeAndDump( $fp, %e %E %e, array( 1000, 2e4, +2e2 ) );
+writeAndDump( $fp, %02d, array( 50 ) );
+writeAndDump( $fp, Testing %b %d %f %s %x %X, array( 9, 6, 2.5502, foobar, 
15, 65 ) );
+
+// Close handle
+fclose( $fp );
+
+?
+===DONE===
+--CLEAN--
+?php
+
+$file = 'vfprintf_test.txt';
+unlink( $file );
+
+?
+--EXPECTF--
+*** Testing vfprintf() : basic functionality ***
+unicode(17) Foo is 30 and bar
+int(17)
+unicode(11) bar bar bar
+int(11)
+unicode(8) 54 digit
+int(8)
+unicode(3) 1 0
+int(3)
+unicode(5) A B C
+int(5)
+unicode(35) 1.00e+3 2.00E+4 2.00e+2
+int(35)
+unicode(2) 50
+int(2)
+unicode(35) Testing 1001 6 2.550200 foobar f 41
+int(35)
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/vfprintf_error1.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/strings/vfprintf_error1.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/vfprintf_error1.phpt:1.2
--- /dev/null   Sun Jun 22 13:31:10 2008
+++ php-src/ext/standard/tests/strings/vfprintf_error1.phpt Sun Jun 22 
13:31:10 2008
@@ -0,0 +1,47 @@
+--TEST--
+Test vfprintf() function : error conditions (more than expected arguments) 
+--INI--
+precision=14
+--FILE--
+?php
+/* Prototype  : int vfprintf(resource stream, string format, array args)
+ * Description: Output a formatted string into a stream 
+ * Source code: ext/standard/formatted_print.c
+ * Alias to functions: 
+ */
+
+// Open handle
+$file = 'vfprintf_test.txt';
+$fp = fopen( $file, a+ );
+
+// Set unicode encoding
+stream_encoding( $fp, 'unicode' );
+
+echo \n-- Testing vfprintf() function with more than expected no. of 
arguments --\n;
+$format = 'string_val';
+$args = array( 1, 2 );
+$extra_arg = 10;
+var_dump( vfprintf( $fp, $format, $args, $extra_arg ) );
+var_dump( vfprintf( $fp, Foo %d, array(6), bar ) );
+
+// Close handle
+fclose($fp);
+
+?
+===DONE===
+--CLEAN--
+?php
+
+$file = 'vfprintf_text.txt';
+unlink( $file );
+
+?
+--EXPECTF--
+-- Testing vfprintf() function with more than expected no. of arguments --
+
+Warning: Wrong parameter count for vfprintf() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for vfprintf() in %s on line %d
+NULL
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/vfprintf_error2.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/strings/vfprintf_error2.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/vfprintf_error2.phpt:1.2
--- /dev/null   Sun Jun 22 13:31:10 2008
+++ php-src/ext/standard/tests/strings/vfprintf_error2.phpt Sun Jun 22 
13:31:10 2008
@@ -0,0 +1,49 @@
+--TEST--
+Test vfprintf() function : error conditions (less than expected arguments) 
+--INI--
+precision=14
+--FILE--
+?php
+/* Prototype  : int vfprintf(resource stream, string format, array args)
+ * Description: Output a formatted string into a stream 
+ * Source code: ext/standard/formatted_print.c
+ * Alias to functions: 
+ */
+
+// Open handle
+$file = 'vfprintf_test.txt';
+$fp = fopen( $file, a+ );
+
+// Set unicode