Unit tests, plus a couple of minor validation bugfixes

This commit is contained in:
Mark Baker
2012-08-03 21:21:32 +01:00
parent 7fae37247b
commit cdf9dfdcbe
14 changed files with 398 additions and 20 deletions
+13 -1
View File
@@ -39,6 +39,11 @@ class PHPExcel_Shared_Font
const AUTOSIZE_METHOD_APPROX = 'approx';
const AUTOSIZE_METHOD_EXACT = 'exact';
private static $_autoSizeMethods = array(
self::AUTOSIZE_METHOD_APPROX,
self::AUTOSIZE_METHOD_EXACT,
);
/** Character set codes used by BIFF5-8 in Font records */
const CHARSET_ANSI_LATIN = 0x00;
const CHARSET_SYSTEM_DEFAULT = 0x01;
@@ -187,10 +192,17 @@ class PHPExcel_Shared_Font
* Set autoSize method
*
* @param string $pValue
* @return boolean Success or failure
*/
public static function setAutoSizeMethod($pValue = 'approx')
public static function setAutoSizeMethod($pValue = self::AUTOSIZE_METHOD_APPROX)
{
if (!in_array($pValue,self::$_autoSizeMethods)) {
return FALSE;
}
self::$autoSizeMethod = $pValue;
return TRUE;
}
/**