MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:uwendel Date:July 16 2007 12:56pm
Subject:PHP mysqlnd svn commit: r759 - trunk/tests/ext/mysqli
View as plain text  
Author: uwendel
Date: 2007-07-16 14:56:25 +0200 (Mon, 16 Jul 2007)
New Revision: 759

Modified:
   trunk/tests/ext/mysqli/mysqli_class_mysqli_driver_reflection.phpt
   trunk/tests/ext/mysqli/mysqli_class_mysqli_result_reflection.phpt
   trunk/tests/ext/mysqli/mysqli_class_mysqli_warning.phpt
   trunk/tests/ext/mysqli/reflection_tools.inc
Log:
Space2Tab for php.net


Modified: trunk/tests/ext/mysqli/mysqli_class_mysqli_driver_reflection.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_class_mysqli_driver_reflection.phpt	2007-07-16 12:15:02
UTC (rev 758)
+++ trunk/tests/ext/mysqli/mysqli_class_mysqli_driver_reflection.phpt	2007-07-16 12:56:25
UTC (rev 759)
@@ -1,29 +1,29 @@
 --TEST--
 Interface of the class mysqli_driver - Reflection
 --SKIPIF--
-<?php 
-require_once('skipif.inc'); 
+<?php
+require_once('skipif.inc');
 require_once('skipifemb.inc');
 require_once('connect.inc');
 if (($tmp = substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.'))) && ($tmp < 5))
-    die("skip Reflection not available before PHP 5 (found PHP $tmp)");
-    
-/* 
-    Let's not deal with cross-version issues in the EXPECTF/UEXPECTF.
-    Most of the things which we test are covered by mysqli_class_*_interface.phpt.
-    Those tests go into the details and are aimed to be a development tool, no more.
-*/    
+	die("skip Reflection not available before PHP 5 (found PHP $tmp)");
+
+/*
+Let's not deal with cross-version issues in the EXPECTF/UEXPECTF.
+Most of the things which we test are covered by mysqli_class_*_interface.phpt.
+Those tests go into the details and are aimed to be a development tool, no more.
+*/
 if (!$IS_MYSQLND)
-    die("skip Test has been written for the latest version of mysqlnd only");
+	die("skip Test has been written for the latest version of mysqlnd only");
 if ($MYSQLND_VERSION < 576)
-    die("skip Test requires mysqlnd Revision 576 or newer");
+	die("skip Test requires mysqlnd Revision 576 or newer");
 ?>
 --FILE--
-<?php    
-    require_once('reflection_tools.inc');
-    $class = new ReflectionClass('mysqli_driver');
-    inspectClass($class);    
-    print "done!";
+<?php
+	require_once('reflection_tools.inc');
+	$class = new ReflectionClass('mysqli_driver');
+	inspectClass($class);
+	print "done!";
 ?>
 --EXPECTF--
 Inspecting class 'mysqli_driver'

Modified: trunk/tests/ext/mysqli/mysqli_class_mysqli_result_reflection.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_class_mysqli_result_reflection.phpt	2007-07-16 12:15:02
UTC (rev 758)
+++ trunk/tests/ext/mysqli/mysqli_class_mysqli_result_reflection.phpt	2007-07-16 12:56:25
UTC (rev 759)
@@ -1,30 +1,30 @@
 --TEST--
 Interface of the class mysqli_result - Reflection
 --SKIPIF--
-<?php 
-require_once('skipif.inc'); 
+<?php
+require_once('skipif.inc');
 require_once('skipifemb.inc');
 require_once('connect.inc');
 
 if (($tmp = substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.'))) && ($tmp < 5))
-    die("skip Reflection not available before PHP 5 (found PHP $tmp)"); 
-    
-/* 
-    Let's not deal with cross-version issues in the EXPECTF/UEXPECTF.
-    Most of the things which we test are covered by mysqli_class_*_interface.phpt.
-    Those tests go into the details and are aimed to be a development tool, no more.
-*/    
+	die("skip Reflection not available before PHP 5 (found PHP $tmp)");
+
+/*
+Let's not deal with cross-version issues in the EXPECTF/UEXPECTF.
+Most of the things which we test are covered by mysqli_class_*_interface.phpt.
+Those tests go into the details and are aimed to be a development tool, no more.
+*/
 if (!$IS_MYSQLND)
-    die("skip Test has been written for the latest version of mysqlnd only");
+	die("skip Test has been written for the latest version of mysqlnd only");
 if ($MYSQLND_VERSION < 576)
-    die("skip Test requires mysqlnd Revision 576 or newer");    
+	die("skip Test requires mysqlnd Revision 576 or newer");
 ?>
 --FILE--
-<?php    
-    require_once('reflection_tools.inc');
-    $class = new ReflectionClass('mysqli_result');
-    inspectClass($class);    
-    print "done!";
+<?php
+	require_once('reflection_tools.inc');
+	$class = new ReflectionClass('mysqli_result');
+	inspectClass($class);
+	print "done!";
 ?>
 --EXPECTF--
 Inspecting class 'mysqli_result'

Modified: trunk/tests/ext/mysqli/mysqli_class_mysqli_warning.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_class_mysqli_warning.phpt	2007-07-16 12:15:02 UTC (rev
758)
+++ trunk/tests/ext/mysqli/mysqli_class_mysqli_warning.phpt	2007-07-16 12:56:25 UTC (rev
759)
@@ -1,93 +1,92 @@
 --TEST--
 Interface of the class mysqli_warning - TODO
 --SKIPIF--
-<?php 
+<?php
 require_once('skipif.inc');
-require_once('skipifemb.inc'); 
+require_once('skipifemb.inc');
 require_once('connect.inc');
 
 if (!$TEST_EXPERIMENTAL)
-    die("skip - experimental (= unsupported) feature");
+	die("skip - experimental (= unsupported) feature");
 ?>
 --FILE--
 <?php
-    require('connect.inc');     
-    
-    $warning = new mysqli_warning();
-    $warning = new mysqli_warning(null);
-    $warning = new mysqli_warning(null, null);
-    
-    $mysqli = new mysqli();
-    $warning = new mysqli_warning($mysqli);
-    
-    $mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket);
-    $stmt = new mysqli_stmt($mysqli);
-    $warning = new mysqli_warning($stmt);
-    
-    $stmt = $mysqli->stmt_init();
-    $warning = new mysqli_warning($stmt);
-       
-    $obj = new stdClass();
-    $warning = new mysqli_warning($obj);
-    
-    include("table.inc");
-    $mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket);
-    $res = $mysqli->query('INSERT INTO test(id, label) VALUES (1, "zz")');
-    $warning = mysqli_get_warnings($mysqli);
-    
-    printf("Parent class:\n");
-    var_dump(get_parent_class($warning));
+	require('connect.inc');
 
-    printf("\nMethods:\n");
-    $methods = get_class_methods($warning);
-    $expected_methods = array(        
-        'next'                      => true,
-    );
-    
-    foreach ($methods as $k => $method) {
-        if (isset($expected_methods[$method])) {
-            unset($methods[$k]);
-            unset($expected_methods[$method]);
-        }
-    }
-    if (!empty($methods)) {
-        printf("Dumping list of unexpected methods.\n");
-        var_dump($methods);
-    }
-    if (!empty($expected_methods)) {
-        printf("Dumping list of missing methods.\n");
-        var_dump($expected_methods);
-    }
-    if (empty($methods) && empty($expected_methods))
-        printf("ok\n");
-    
-    printf("\nClass variables:\n");    
-    $variables = get_class_vars(get_class($mysqli));
-    sort($variables);
-    foreach ($variables as $k => $var)
-      printf("%s\n", $var);
-    
-    printf("\nObject variables:\n");
-    $variables = get_object_vars($mysqli);
-    foreach ($variables as $k => $var)
-      printf("%s\n", $var);
-      
-    printf("\nMagic, magic properties:\n");
-    
-    assert('' === $warning->message);
-    printf("warning->message = '%s'\n", $warning->message);
-    
-    assert('' === $warning->sqlstate);
-    printf("warning->sqlstate= '%s'\n", $warning->sqlstate);
-    
-    assert(0 === $warning->errno);
-    printf("warning->errno = '%s'\n", $warning->errno); 
-    
-    printf("\nAccess to undefined properties:\n");
-    printf("warning->unknown = '%s'\n", @$warning->unknown);       
-      
-    
-    print "done!";
+	$warning = new mysqli_warning();
+	$warning = new mysqli_warning(null);
+	$warning = new mysqli_warning(null, null);
+
+	$mysqli = new mysqli();
+	$warning = new mysqli_warning($mysqli);
+
+	$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket);
+	$stmt = new mysqli_stmt($mysqli);
+	$warning = new mysqli_warning($stmt);
+
+	$stmt = $mysqli->stmt_init();
+	$warning = new mysqli_warning($stmt);
+
+	$obj = new stdClass();
+	$warning = new mysqli_warning($obj);
+
+	include("table.inc");
+	$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket);
+	$res = $mysqli->query('INSERT INTO test(id, label) VALUES (1, "zz")');
+	$warning = mysqli_get_warnings($mysqli);
+
+	printf("Parent class:\n");
+	var_dump(get_parent_class($warning));
+
+	printf("\nMethods:\n");
+	$methods = get_class_methods($warning);
+	$expected_methods = array(
+		'next'                      => true,
+	);
+
+	foreach ($methods as $k => $method) {
+		if (isset($expected_methods[$method])) {
+			unset($methods[$k]);
+			unset($expected_methods[$method]);
+		}
+	}
+	if (!empty($methods)) {
+		printf("Dumping list of unexpected methods.\n");
+		var_dump($methods);
+	}
+	if (!empty($expected_methods)) {
+		printf("Dumping list of missing methods.\n");
+		var_dump($expected_methods);
+	}
+	if (empty($methods) && empty($expected_methods))
+		printf("ok\n");
+
+	printf("\nClass variables:\n");
+	$variables = get_class_vars(get_class($mysqli));
+	sort($variables);
+	foreach ($variables as $k => $var)
+		printf("%s\n", $var);
+
+	printf("\nObject variables:\n");
+	$variables = get_object_vars($mysqli);
+	foreach ($variables as $k => $var)
+		printf("%s\n", $var);
+
+	printf("\nMagic, magic properties:\n");
+
+	assert('' === $warning->message);
+	printf("warning->message = '%s'\n", $warning->message);
+
+	assert('' === $warning->sqlstate);
+	printf("warning->sqlstate= '%s'\n", $warning->sqlstate);
+
+	assert(0 === $warning->errno);
+	printf("warning->errno = '%s'\n", $warning->errno);
+
+	printf("\nAccess to undefined properties:\n");
+	printf("warning->unknown = '%s'\n", @$warning->unknown);
+
+	print "done!";
 ?>
 --EXPECTF--
 Warning: Wrong parameter count for mysqli_warning::mysqli_warning() in %s on line %d
@@ -103,7 +102,7 @@
 
 Warning: mysqli_warning::mysqli_warning(): invalid object or resource mysqli_stmt
  in %s on line %d
- 
+
 Warning: mysqli_warning::mysqli_warning(): invalid class argument in
/home/nixnutz/php6_mysqlnd/ext/mysqli/tests/mysqli_class_mysqli_warning.php on line 19
 
 Warning: mysqli_warning::mysqli_warning(): No warnings found in %s on line %d

Modified: trunk/tests/ext/mysqli/reflection_tools.inc
===================================================================
--- trunk/tests/ext/mysqli/reflection_tools.inc	2007-07-16 12:15:02 UTC (rev 758)
+++ trunk/tests/ext/mysqli/reflection_tools.inc	2007-07-16 12:56:25 UTC (rev 759)
@@ -1,121 +1,121 @@
 <?php
-function inspectClass($class) {
-    
-        /* not used: public ReflectionClass[] getInterfaces()  */
-        
-        printf("\nInspecting class '%s'\n", $class->getName());
-        printf("isInternal: %s\n", ($class->isInternal()) ? 'yes' : 'no');
-        printf("isUserDefined: %s\n", ($class->isUserDefined()) ? 'yes' : 'no');
-        printf("isInstantiable: %s\n", ($class->isInstantiable()) ? 'yes' : 'no');
-        printf("isInterface: %s\n", ($class->isInterface()) ? 'yes' : 'no');
-        printf("isAbstract: %s\n", ($class->isAbstract()) ? 'yes' : 'no');
-        printf("isFinal: %s\n", ($class->isFinal()) ? 'yes' : 'no');
-        printf("isIteratable: %s\n", ($class->isIterateable()) ? 'yes' : 'no');
-        printf("Modifiers: '%d'\n", $class->getModifiers());
-        printf("Parent Class: '%s'\n", $class->getParentClass());
-        printf("Extension: '%s'\n", $class->getExtensionName());
-      
-        if ($method = $class->getConstructor())
-            inspectMethod($method);
+	function inspectClass($class) {
 
-        if ($methods = $class->getMethods()) {
-              $tmp = array();
-              foreach ($methods as $method)
-                  $tmp[$method->getName()] = $method;
-          
-              ksort($tmp, SORT_STRING);
-              foreach ($tmp as $method)
-                  inspectMethod($method);        
-        }    
-        
-        if ($properties = $class->getProperties()) {            
-            $tmp = array();
-            foreach ($properties as $prop)
-                $tmp[$prop->getName()] = $prop;
-            ksort($tmp, SORT_STRING);
-            foreach ($tmp as $prop)
-                inspectProperty($prop);
-        }
-        
-        
-        if ($properties = $class->getDefaultProperties()) {            
-            ksort($properties, SORT_STRING);
-            foreach ($properties as $name => $v)
-                printf("Default property '%s'\n", $name);            
-        }
-        
-        if ($properties = $class->getStaticProperties()) {
-            ksort($properties, SORT_STRING);            
-            foreach ($properties as $name => $v)
-                printf("Static property '%s'\n", $name);            
-        }
-        
-        if ($constants = $class->getConstants()) {
-            ksort($constants, SORT_STRING);
-            foreach ($constant as $name => $value)
-                printf("Constant '%s' = '%s'\n", $name, $value);            
-        }
-      
-    }
-    
-    function inspectProperty(&$prop) {
-    
-        printf("\nInspecting property '%s'\n", $prop->getName());
-        printf("isPublic: %s\n", ($prop->isPublic()) ? 'yes' : 'no');
-        printf("isPrivate: %s\n", ($prop->isPrivate()) ? 'yes' : 'no');
-        printf("isProtected: %s\n", ($prop->isProtected()) ? 'yes' : 'no');
-        printf("isStatic: %s\n", ($prop->isStatic()) ? 'yes' : 'no');
-        printf("isDefault: %s\n", ($prop->isDefault()) ? 'yes' : 'no');
-        printf("Modifiers: %d\n", $prop->getModifiers());
-        // printf("Value\n"); var_export($prop->getValue());
-        
-    }
-    
-    function inspectMethod(&$method) {      
-      
-        printf("\nInspecting method '%s'\n", $method->getName());
-        printf("isFinal: %s\n", ($method->isFinal()) ? 'yes' : 'no');
-        printf("isAbstract: %s\n", ($method->isAbstract()) ? 'yes' : 'no');
-        printf("isPublic: %s\n", ($method->isPublic()) ? 'yes' : 'no');
-        printf("isPrivate: %s\n", ($method->isPrivate()) ? 'yes' : 'no');
-        printf("isProtected: %s\n", ($method->isProtected()) ? 'yes' : 'no');
-        printf("isStatic: %s\n", ($method->isStatic()) ? 'yes' : 'no');
-        printf("isConstructor: %s\n", ($method->isConstructor()) ? 'yes' : 'no');
-        printf("isDestructor: %s\n", ($method->isDestructor()) ? 'yes' : 'no');
-        printf("isInternal: %s\n", ($method->isInternal()) ? 'yes' : 'no');
-        printf("isUserDefined: %s\n", ($method->isUserDefined()) ? 'yes' : 'no');
-        printf("returnsReference: %s\n", ($method->returnsReference()) ? 'yes' :
'no');
-        printf("Modifiers: %d\n", $method->getModifiers());
-        printf("Number of Parameters: %d\n", $method->getNumberOfParameters());
-        printf("Number of Required Parameters: %d\n",
$method->getNumberOfRequiredParameters());  
-      
-        if ($params = $method->getParameters()) {
-          $tmp = array();
-          foreach ($params as $k => $param)
-              $tmp[$param->getName()] = $param;
-          
-          ksort($tmp, SORT_STRING);
-          foreach ($tmp as $param)
-              inspectParameter($method, $param);
-        }
-      
-        if ($static = $method->getStaticVariables()) {
-            sort($static, SORT_STRING);
-            printf("Static variables: %s\n", implode('/', $static));
-        }
-      
-    }
-    
-    function inspectParameter(&$method, &$param) {
+		/* not used: public ReflectionClass[] getInterfaces()  */
 
-        printf("\nInspecting parameter '%s' of method '%s'\n", 
-              $param->getName(), $method->getName());
-        printf("isArray: %s\n", ($param->isArray()) ? 'yes': 'no');
-        printf("allowsNull: %s\n", ($param->allowsNull()) ? 'yes' : 'no');
-        printf("isPassedByReference: %s\n", ($param->isPassedByReference()) ? 'yes' :
'no');
-        printf("isOptional: %s\n", ($param->isOptional()) ? 'yes' : 'no');
-        printf("isDefaultValueAvailable: %s\n", ($param->isDefaultValueAvailable()) ?
'yes' : 'no');
-        // printf("getDefaultValue: %s\n", ($param->getDefaultValue()) ? 'yes' :
'no');
-      
-    }
+		printf("\nInspecting class '%s'\n", $class->getName());
+		printf("isInternal: %s\n", ($class->isInternal()) ? 'yes' : 'no');
+		printf("isUserDefined: %s\n", ($class->isUserDefined()) ? 'yes' : 'no');
+		printf("isInstantiable: %s\n", ($class->isInstantiable()) ? 'yes' : 'no');
+		printf("isInterface: %s\n", ($class->isInterface()) ? 'yes' : 'no');
+		printf("isAbstract: %s\n", ($class->isAbstract()) ? 'yes' : 'no');
+		printf("isFinal: %s\n", ($class->isFinal()) ? 'yes' : 'no');
+		printf("isIteratable: %s\n", ($class->isIterateable()) ? 'yes' : 'no');
+		printf("Modifiers: '%d'\n", $class->getModifiers());
+		printf("Parent Class: '%s'\n", $class->getParentClass());
+		printf("Extension: '%s'\n", $class->getExtensionName());
+
+		if ($method = $class->getConstructor())
+			inspectMethod($method);
+
+		if ($methods = $class->getMethods()) {
+			$tmp = array();
+			foreach ($methods as $method)
+				$tmp[$method->getName()] = $method;
+
+			ksort($tmp, SORT_STRING);
+			foreach ($tmp as $method)
+				inspectMethod($method);
+		}
+
+		if ($properties = $class->getProperties()) {
+			$tmp = array();
+			foreach ($properties as $prop)
+				$tmp[$prop->getName()] = $prop;
+			ksort($tmp, SORT_STRING);
+			foreach ($tmp as $prop)
+			inspectProperty($prop);
+		}
+
+
+		if ($properties = $class->getDefaultProperties()) {
+			ksort($properties, SORT_STRING);
+			foreach ($properties as $name => $v)
+				printf("Default property '%s'\n", $name);
+		}
+
+		if ($properties = $class->getStaticProperties()) {
+			ksort($properties, SORT_STRING);
+			foreach ($properties as $name => $v)
+				printf("Static property '%s'\n", $name);
+		}
+
+		if ($constants = $class->getConstants()) {
+			ksort($constants, SORT_STRING);
+			foreach ($constant as $name => $value)
+				printf("Constant '%s' = '%s'\n", $name, $value);
+		}
+
+	}
+
+	function inspectProperty(&$prop) {
+
+		printf("\nInspecting property '%s'\n", $prop->getName());
+		printf("isPublic: %s\n", ($prop->isPublic()) ? 'yes' : 'no');
+		printf("isPrivate: %s\n", ($prop->isPrivate()) ? 'yes' : 'no');
+		printf("isProtected: %s\n", ($prop->isProtected()) ? 'yes' : 'no');
+		printf("isStatic: %s\n", ($prop->isStatic()) ? 'yes' : 'no');
+		printf("isDefault: %s\n", ($prop->isDefault()) ? 'yes' : 'no');
+		printf("Modifiers: %d\n", $prop->getModifiers());
+		// printf("Value\n"); var_export($prop->getValue());
+
+	}
+
+	function inspectMethod(&$method) {
+
+		printf("\nInspecting method '%s'\n", $method->getName());
+		printf("isFinal: %s\n", ($method->isFinal()) ? 'yes' : 'no');
+		printf("isAbstract: %s\n", ($method->isAbstract()) ? 'yes' : 'no');
+		printf("isPublic: %s\n", ($method->isPublic()) ? 'yes' : 'no');
+		printf("isPrivate: %s\n", ($method->isPrivate()) ? 'yes' : 'no');
+		printf("isProtected: %s\n", ($method->isProtected()) ? 'yes' : 'no');
+		printf("isStatic: %s\n", ($method->isStatic()) ? 'yes' : 'no');
+		printf("isConstructor: %s\n", ($method->isConstructor()) ? 'yes' : 'no');
+		printf("isDestructor: %s\n", ($method->isDestructor()) ? 'yes' : 'no');
+		printf("isInternal: %s\n", ($method->isInternal()) ? 'yes' : 'no');
+		printf("isUserDefined: %s\n", ($method->isUserDefined()) ? 'yes' : 'no');
+		printf("returnsReference: %s\n", ($method->returnsReference()) ? 'yes' : 'no');
+		printf("Modifiers: %d\n", $method->getModifiers());
+		printf("Number of Parameters: %d\n", $method->getNumberOfParameters());
+		printf("Number of Required Parameters: %d\n",
$method->getNumberOfRequiredParameters());
+
+		if ($params = $method->getParameters()) {
+			$tmp = array();
+			foreach ($params as $k => $param)
+				$tmp[$param->getName()] = $param;
+
+			ksort($tmp, SORT_STRING);
+			foreach ($tmp as $param)
+				inspectParameter($method, $param);
+		}
+
+		if ($static = $method->getStaticVariables()) {
+			sort($static, SORT_STRING);
+			printf("Static variables: %s\n", implode('/', $static));
+		}
+
+	}
+
+	function inspectParameter(&$method, &$param) {
+
+		printf("\nInspecting parameter '%s' of method '%s'\n",
+		$param->getName(), $method->getName());
+		printf("isArray: %s\n", ($param->isArray()) ? 'yes': 'no');
+		printf("allowsNull: %s\n", ($param->allowsNull()) ? 'yes' : 'no');
+		printf("isPassedByReference: %s\n", ($param->isPassedByReference()) ? 'yes' : 'no');
+		printf("isOptional: %s\n", ($param->isOptional()) ? 'yes' : 'no');
+		printf("isDefaultValueAvailable: %s\n", ($param->isDefaultValueAvailable()) ? 'yes'
: 'no');
+		// printf("getDefaultValue: %s\n", ($param->getDefaultValue()) ? 'yes' : 'no');
+
+	}
 ?>
\ No newline at end of file

Thread
PHP mysqlnd svn commit: r759 - trunk/tests/ext/mysqliuwendel16 Jul