[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl/tests fileobject_005.phpt

2008-05-25 Thread Sebastian Bergmann
sebastian   Sun May 25 06:05:57 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/spl/tests  fileobject_005.phpt 
  Log:
  MFH: Drop SKIPIF check for ext/spl.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_005.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/spl/tests/fileobject_005.phpt
diff -u php-src/ext/spl/tests/fileobject_005.phpt:1.1.2.2 
php-src/ext/spl/tests/fileobject_005.phpt:1.1.2.3
--- php-src/ext/spl/tests/fileobject_005.phpt:1.1.2.2   Sat May 24 16:49:04 2008
+++ php-src/ext/spl/tests/fileobject_005.phpt   Sun May 25 06:05:57 2008
@@ -1,7 +1,5 @@
 --TEST--
 SPL: SplFileObject truncate tests
---SKIPIF--
-?php if (!extension_loaded(spl)) print skip; ?
 --CREDITS--
 Mark Ammann
 #Hackday Webtuesday 2008-05-24



-- 
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/spl/tests fileobject_005.phpt heap_009.phpt

2008-05-24 Thread Etienne Kneuss
colder  Sat May 24 16:49:04 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  heap_009.phpt fileobject_005.phpt 
  Log:
  New tests from testfest
  

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/heap_009.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/heap_009.phpt
+++ php-src/ext/spl/tests/heap_009.phpt
--TEST--
SPL: SplHeap and friends, throw: An iterator cannot be used with foreach by 
reference
--CREDITS--
Thomas Koch [EMAIL PROTECTED]
#Hackday Webtuesday 2008-05-24
--SKIPIF--
?php if (!extension_loaded(spl)) print skip; ?
--FILE--
?php
function testForException( $heap )
{
try
{
foreach( $heap as $item );
}
catch( RuntimeException $e )
{
echo $e-getMessage(),\n;
}
}

// 1. SplMinHeap emtpy
$heap = new SplMinHeap;
testForException( $heap );

// 2. SplMinHeap non-emtpy
$heap = new SplMinHeap;
$heap-insert( 1 );
testForException( $heap );

// 3. SplMaxHeap emtpy
$heap = new SplMaxHeap;
testForException( $heap );

// 4. SplMaxHeap non-emtpy
$heap = new SplMaxHeap;
$heap-insert( 1 );
testForException( $heap );

// 5. SplPriorityQueue empty
$heap = new SplPriorityQueue;
testForException( $heap );

// 6. SplPriorityQueue non-empty
$heap = new SplPriorityQueue;
$heap-insert( 1, 2 );
testForException( $heap );

?
==DONE==
--EXPECT--
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
==DONE==

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_005.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fileobject_005.phpt
+++ php-src/ext/spl/tests/fileobject_005.phpt
--TEST--
SPL: SplFileObject truncate tests
--SKIPIF--
?php if (!extension_loaded(spl)) print skip; ?
--CREDITS--
Mark Ammann
#Hackday Webtuesday 2008-05-24
--FILE--
?php

set_include_path(dirname(dirname(__FILE__)));

$path = dirname(__FILE__).DIRECTORY_SEPARATOR.'fileobject_005.txt';
touch($path);

$fo = new SplFileObject('tests'.DIRECTORY_SEPARATOR.'fileobject_005.txt', 'w+', 
true);
$fo-fwrite(blahlubba);
var_dump($fo-ftruncate(4));

$fo-rewind();
var_dump($fo-fgets(8));

$fo-rewind();
$fo-fwrite(blahlubba);

// This should throw a warning and return NULL since an argument is missing 
var_dump($fo-ftruncate());

?
==DONE==
--CLEAN--
?php
$path = dirname(__FILE__).DIRECTORY_SEPARATOR.'fileobject_005.txt';
unlink($path);
?
--EXPECTF--
bool(true)
string(4) blah

Warning: SplFileObject::ftruncate() expects exactly 1 parameter, 0 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