colder          Thu Jun 12 20:46:00 2008 UTC

  Added files:                 
    /php-src/ext/spl/tests      fileobject_checktype_basic.phpt 
                                fileobject_getbasename_basic.phpt 
                                fileobject_getcurrentline_basic.phpt 
                                fileobject_getfileinfo_basic.phpt 
                                fileobject_getmaxlinelen_basic.phpt 
                                fileobject_getsize_basic.phpt 
                                fileobject_setmaxlinelen_basic.phpt 
  Log:
  Add tests from testfest
  

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_checktype_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_checktype_basic.phpt
+++ php-src/ext/spl/tests/fileobject_checktype_basic.phpt
--TEST--
SPL: SplFileObject::isFile/isDir/isLink
--CREDITS--
H�vard Eide <nucleuz at gmail.com>
#Testfest php.no
--FILE--
<?php
$s = new SplFileObject(__FILE__);
var_dump($s->isFile());
var_dump($s->isDir());
var_dump($s->isLink());
?>
--EXPECT--
bool(true)
bool(false)
bool(false)

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_getbasename_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_getbasename_basic.phpt
+++ php-src/ext/spl/tests/fileobject_getbasename_basic.phpt
--TEST--
SPL: SplFileObject::getBasename 
--CREDITS--
H�vard Eide <nucleuz at gmail.com>
#Testfest php.no
--FILE--
<?php
$file = __FILE__;
$s = new SplFileObject( __FILE__ );
echo $s->getBasename();
?>
--EXPECT--
fileobject_getbasename_basic.php

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_getcurrentline_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_getcurrentline_basic.phpt
+++ php-src/ext/spl/tests/fileobject_getcurrentline_basic.phpt
--TEST--
SPL: SplFileObject::getCurrentLine
--CREDITS--
H�vard Eide <nucleuz at gmail.com>
#Testfest php.no
--FILE--
<?php
//line 2
//line 3
//line 4
//line 5
$s = new SplFileObject(__FILE__);
$s->seek(1);
echo $s->getCurrentLine();
echo $s->getCurrentLine();
?>
--EXPECT--
//line 3
//line 4

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_getfileinfo_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_getfileinfo_basic.phpt
+++ php-src/ext/spl/tests/fileobject_getfileinfo_basic.phpt
--TEST--
SPL: SplFileObject::getFileInfo
--CREDITS--
H�vard Eide <nucleuz at gmail.com>
#Testfest php.no
--INI--
include_path=.
--FILE--
<?php
$file = __FILE__;
$s = new SplFileObject( $file );
var_dump($fi = $s->getFileInfo(), (string)$fi);

$d = new SplFileInfo( __DIR__ );
echo "\n";
var_dump($fi = $d->getFileInfo(), (string)$fi);
?>
--EXPECTF--
object(SplFileInfo)#2 (2) {
  [u"pathName":u"SplFileInfo":private]=>
  %s(%d) "%sext%espl%etests"
  [u"fileName":u"SplFileInfo":private]=>
  %s(%d) "%sext%espl%etests%efileobject_getfileinfo_basic.php"
}
%s(%d) "%sext%espl%etests%efileobject_getfileinfo_basic.php"

object(SplFileInfo)#4 (2) {
  [u"pathName":u"SplFileInfo":private]=>
  %s(%d) "%sext%espl"
  [u"fileName":u"SplFileInfo":private]=>
  %s(%d) "%sext%espl%etests"
}
%s(%d) "%sext%espl%etests"

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_getmaxlinelen_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_getmaxlinelen_basic.phpt
+++ php-src/ext/spl/tests/fileobject_getmaxlinelen_basic.phpt
--TEST--
SPL: SplFileObject::getMaxLineLen()
--CREDITS--
H�vard Eide <nucleuz at gmail.com>
#Testfest php.no
--INI--
include_path=.
--FILE--
<?php
$s = new SplFileObject( __FILE__ ); 
$s->setMaxLineLen( 7 );  
echo $s->getMaxLineLen();
?>
--EXPECT--
7

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_getsize_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_getsize_basic.phpt
+++ php-src/ext/spl/tests/fileobject_getsize_basic.phpt
--TEST--
SPL: SplFileObject::getSize
--CREDITS--
H�vard Eide <nucleuz at gmail.com>
#Testfest php.no
--INI--
include_path=.
--FILE--
<?php
$file = __DIR__ ."/data.txt";
file_put_contents($file, "foobar");

$s = new SplFileObject( $file );
echo $s->getSize();
?>
--CLEAN--
$file = __DIR__ ."/data.txt";
unlink($file);
--EXPECT--
6

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_setmaxlinelen_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_setmaxlinelen_basic.phpt
+++ php-src/ext/spl/tests/fileobject_setmaxlinelen_basic.phpt
--TEST--
SPL: SplFileObject::setMaxLineLen
--CREDITS--
H�vard Eide <nucleuz at gmail.com>
#Testfest php.no
--INI--
include_path=.
--FILE--
<?php
$s = new SplFileObject( __FILE__ ); 
$s->setMaxLineLen( 3);  
echo $s->getCurrentLine();
?>
--EXPECT--
<?



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

Reply via email to