ben                                      Tue, 15 Jun 2010 11:20:21 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=300465

Log:
Merged SplTempFileObject tests from trunk

Changed paths:
    _U  php/php-src/branches/PHP_5_3/ext/spl/tests/
    A + 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_basic.phpt
        (from 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_basic.phpt:r300463)
    A + 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_error.phpt
        (from 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_error.phpt:r300463)
    A + 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_maxmemory_basic.phpt
        (from 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_maxmemory_basic.phpt:r300463)
    A + 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_memory_lt1_variation.phpt
        (from 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_memory_lt1_variation.phpt:r300463)


Property changes on: php/php-src/branches/PHP_5_3/ext/spl/tests
___________________________________________________________________
Added: svn:mergeinfo
   + /php/php-src/trunk:300463
/php/php-src/trunk/ext/spl/tests:284726,300463

Copied: 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_basic.phpt
 (from rev 300463, 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_basic.phpt)
===================================================================
--- 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_basic.phpt
                         (rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_basic.phpt
 2010-06-15 11:20:21 UTC (rev 300465)
@@ -0,0 +1,19 @@
+--TEST--
+SPL SplTempFileObject constructor sets correct defaults when pass 0 arguments
+--FILE--
+<?php
+var_dump(new SplTempFileObject());
+?>
+--EXPECTF--
+object(SplTempFileObject)#1 (5) {
+  ["pathName":"SplFileInfo":private]=>
+  string(10) "php://temp"
+  ["fileName":"SplFileInfo":private]=>
+  string(10) "php://temp"
+  ["openMode":"SplFileObject":private]=>
+  string(1) "w"
+  ["delimiter":"SplFileObject":private]=>
+  string(1) ","
+  ["enclosure":"SplFileObject":private]=>
+  string(1) """
+}

Copied: 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_error.phpt
 (from rev 300463, 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_error.phpt)
===================================================================
--- 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_error.phpt
                         (rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_error.phpt
 2010-06-15 11:20:21 UTC (rev 300465)
@@ -0,0 +1,12 @@
+--TEST--
+SPL SplTempFileObject constructor sets correct defaults when pass 0 arguments
+--FILE--
+<?php
+new SplTempFileObject('invalid');
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'RuntimeException' with message 
'SplTempFileObject::__construct() expects parameter 1 to be long, string given' 
in %s
+Stack trace:
+#0 %s: SplTempFileObject->__construct('invalid')
+#1 {main}
+  thrown in %s

Copied: 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_maxmemory_basic.phpt
 (from rev 300463, 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_maxmemory_basic.phpt)
===================================================================
--- 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_maxmemory_basic.phpt
                               (rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_maxmemory_basic.phpt
       2010-06-15 11:20:21 UTC (rev 300465)
@@ -0,0 +1,19 @@
+--TEST--
+SPL SplTempFileObject constructor sets correct values when passed fixed memory 
size
+--FILE--
+<?php
+var_dump(new SplTempFileObject(1024));
+?>
+--EXPECTF--
+object(SplTempFileObject)#1 (5) {
+  ["pathName":"SplFileInfo":private]=>
+  string(25) "php://temp/maxmemory:1024"
+  ["fileName":"SplFileInfo":private]=>
+  string(25) "php://temp/maxmemory:1024"
+  ["openMode":"SplFileObject":private]=>
+  string(1) "w"
+  ["delimiter":"SplFileObject":private]=>
+  string(1) ","
+  ["enclosure":"SplFileObject":private]=>
+  string(1) """
+}

Copied: 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_memory_lt1_variation.phpt
 (from rev 300463, 
php/php-src/trunk/ext/spl/tests/SplTempFileObject_constructor_memory_lt1_variation.phpt)
===================================================================
--- 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_memory_lt1_variation.phpt
                          (rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/spl/tests/SplTempFileObject_constructor_memory_lt1_variation.phpt
  2010-06-15 11:20:21 UTC (rev 300465)
@@ -0,0 +1,19 @@
+--TEST--
+SPL SplTempFileObject constructor sets correct defaults when passed a negative 
value
+--FILE--
+<?php
+var_dump(new SplTempFileObject(-1));
+?>
+--EXPECTF--
+object(SplTempFileObject)#1 (5) {
+  ["pathName":"SplFileInfo":private]=>
+  string(12) "php://memory"
+  ["fileName":"SplFileInfo":private]=>
+  string(12) "php://memory"
+  ["openMode":"SplFileObject":private]=>
+  string(1) "w"
+  ["delimiter":"SplFileObject":private]=>
+  string(1) ","
+  ["enclosure":"SplFileObject":private]=>
+  string(1) """
+}

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

Reply via email to