From 259ce457f3eadb0a31d0fa3f891f33ce7aaa818c Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 18 May 2016 13:37:00 +0200 Subject: [PATCH] #401 : PHPCS Fixes & Some PHPUnit Fixes --- .travis.yml | 2 +- .../Calculation/Engineering.php | 1321 +++++++++-------- src/PhpSpreadsheet/Calculation/TextData.php | 3 + src/PhpSpreadsheet/Shared/Date.php | 2 +- .../Shared/OLE/ChainedBlockStream.php | 14 +- src/PhpSpreadsheet/Shared/StringHelper.php | 21 +- .../Shared/ZipStreamWrapper.php | 14 +- .../Classes/src/Calculation/DateTimeTest.php | 38 +- .../src/Calculation/EngineeringTest.php | 128 +- .../Classes/src/Calculation/FinancialTest.php | 62 +- .../Classes/src/Calculation/FunctionsTest.php | 28 +- .../Classes/src/Calculation/LogicalTest.php | 10 +- .../Classes/src/Calculation/LookupRefTest.php | 4 +- .../Classes/src/Calculation/MathTrigTest.php | 58 +- .../Classes/src/Calculation/TextDataTest.php | 42 +- unitTests/Classes/src/CalculationTest.php | 2 +- .../src/Cell/DefaultValueBinderTest.php | 2 +- unitTests/Classes/src/CellTest.php | 22 +- unitTests/Classes/src/Shared/CodePageTest.php | 2 +- unitTests/Classes/src/Shared/DateTest.php | 14 +- unitTests/Classes/src/Shared/FontTest.php | 6 +- .../Classes/src/Shared/PasswordHasherTest.php | 2 +- unitTests/Classes/src/Shared/StringTest.php | 17 +- unitTests/Classes/src/Style/ColorTest.php | 8 +- .../src/Style/NumberFormatDateTest.php | 2 +- .../Classes/src/Style/NumberFormatTest.php | 2 +- unitTests/custom/complexAssert.php | 2 +- .../Calculation/Engineering/DEC2OCT.data | 2 +- unitTests/testDataFileIterator.php | 2 +- unitTests/testDataFileIteratorJson.php | 2 +- 30 files changed, 939 insertions(+), 895 deletions(-) diff --git a/.travis.yml b/.travis.yml index c424d3e7..02661f24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ script: ## PHP_CodeSniffer - ./vendor/bin/phpcs --report-width=200 --report-summary --report-full src/ unitTests/ --standard=PSR2 -n ## PHPUnit - - phpunit -c ./unitTests/ + - ./vendor/bin/phpunit -c ./unitTests/ notifications: email: false diff --git a/src/PhpSpreadsheet/Calculation/Engineering.php b/src/PhpSpreadsheet/Calculation/Engineering.php index e74c98b9..5b7fae57 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/src/PhpSpreadsheet/Calculation/Engineering.php @@ -38,69 +38,69 @@ class Engineering * @var mixed[] */ private static $conversionUnits = array( - 'g' => array('Group' => 'Mass', 'Unit Name' => 'Gram', 'AllowPrefix' => true), - 'sg' => array('Group' => 'Mass', 'Unit Name' => 'Slug', 'AllowPrefix' => false), - 'lbm' => array('Group' => 'Mass', 'Unit Name' => 'Pound mass (avoirdupois)', 'AllowPrefix' => false), - 'u' => array('Group' => 'Mass', 'Unit Name' => 'U (atomic mass unit)', 'AllowPrefix' => true), - 'ozm' => array('Group' => 'Mass', 'Unit Name' => 'Ounce mass (avoirdupois)', 'AllowPrefix' => false), - 'm' => array('Group' => 'Distance', 'Unit Name' => 'Meter', 'AllowPrefix' => true), - 'mi' => array('Group' => 'Distance', 'Unit Name' => 'Statute mile', 'AllowPrefix' => false), - 'Nmi' => array('Group' => 'Distance', 'Unit Name' => 'Nautical mile', 'AllowPrefix' => false), - 'in' => array('Group' => 'Distance', 'Unit Name' => 'Inch', 'AllowPrefix' => false), - 'ft' => array('Group' => 'Distance', 'Unit Name' => 'Foot', 'AllowPrefix' => false), - 'yd' => array('Group' => 'Distance', 'Unit Name' => 'Yard', 'AllowPrefix' => false), - 'ang' => array('Group' => 'Distance', 'Unit Name' => 'Angstrom', 'AllowPrefix' => true), - 'Pica' => array('Group' => 'Distance', 'Unit Name' => 'Pica (1/72 in)', 'AllowPrefix' => false), - 'yr' => array('Group' => 'Time', 'Unit Name' => 'Year', 'AllowPrefix' => false), - 'day' => array('Group' => 'Time', 'Unit Name' => 'Day', 'AllowPrefix' => false), - 'hr' => array('Group' => 'Time', 'Unit Name' => 'Hour', 'AllowPrefix' => false), - 'mn' => array('Group' => 'Time', 'Unit Name' => 'Minute', 'AllowPrefix' => false), - 'sec' => array('Group' => 'Time', 'Unit Name' => 'Second', 'AllowPrefix' => true), - 'Pa' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true), - 'p' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true), - 'atm' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true), - 'at' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true), - 'mmHg' => array('Group' => 'Pressure', 'Unit Name' => 'mm of Mercury', 'AllowPrefix' => true), - 'N' => array('Group' => 'Force', 'Unit Name' => 'Newton', 'AllowPrefix' => true), - 'dyn' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true), - 'dy' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true), - 'lbf' => array('Group' => 'Force', 'Unit Name' => 'Pound force', 'AllowPrefix' => false), - 'J' => array('Group' => 'Energy', 'Unit Name' => 'Joule', 'AllowPrefix' => true), - 'e' => array('Group' => 'Energy', 'Unit Name' => 'Erg', 'AllowPrefix' => true), - 'c' => array('Group' => 'Energy', 'Unit Name' => 'Thermodynamic calorie', 'AllowPrefix' => true), - 'cal' => array('Group' => 'Energy', 'Unit Name' => 'IT calorie', 'AllowPrefix' => true), - 'eV' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true), - 'ev' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true), - 'HPh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false), - 'hh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false), - 'Wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true), - 'wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true), - 'flb' => array('Group' => 'Energy', 'Unit Name' => 'Foot-pound', 'AllowPrefix' => false), - 'BTU' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false), - 'btu' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false), - 'HP' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false), - 'h' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false), - 'W' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true), - 'w' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true), - 'T' => array('Group' => 'Magnetism', 'Unit Name' => 'Tesla', 'AllowPrefix' => true), - 'ga' => array('Group' => 'Magnetism', 'Unit Name' => 'Gauss', 'AllowPrefix' => true), - 'C' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false), - 'cel' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false), - 'F' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false), - 'fah' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false), - 'K' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false), - 'kel' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false), - 'tsp' => array('Group' => 'Liquid', 'Unit Name' => 'Teaspoon', 'AllowPrefix' => false), - 'tbs' => array('Group' => 'Liquid', 'Unit Name' => 'Tablespoon', 'AllowPrefix' => false), - 'oz' => array('Group' => 'Liquid', 'Unit Name' => 'Fluid Ounce', 'AllowPrefix' => false), - 'cup' => array('Group' => 'Liquid', 'Unit Name' => 'Cup', 'AllowPrefix' => false), - 'pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false), - 'us_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false), - 'uk_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.K. Pint', 'AllowPrefix' => false), - 'qt' => array('Group' => 'Liquid', 'Unit Name' => 'Quart', 'AllowPrefix' => false), - 'gal' => array('Group' => 'Liquid', 'Unit Name' => 'Gallon', 'AllowPrefix' => false), - 'l' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true), - 'lt' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true), + 'g' => array('Group' => 'Mass', 'Unit Name' => 'Gram', 'AllowPrefix' => true), + 'sg' => array('Group' => 'Mass', 'Unit Name' => 'Slug', 'AllowPrefix' => false), + 'lbm' => array('Group' => 'Mass', 'Unit Name' => 'Pound mass (avoirdupois)', 'AllowPrefix' => false), + 'u' => array('Group' => 'Mass', 'Unit Name' => 'U (atomic mass unit)', 'AllowPrefix' => true), + 'ozm' => array('Group' => 'Mass', 'Unit Name' => 'Ounce mass (avoirdupois)', 'AllowPrefix' => false), + 'm' => array('Group' => 'Distance', 'Unit Name' => 'Meter', 'AllowPrefix' => true), + 'mi' => array('Group' => 'Distance', 'Unit Name' => 'Statute mile', 'AllowPrefix' => false), + 'Nmi' => array('Group' => 'Distance', 'Unit Name' => 'Nautical mile', 'AllowPrefix' => false), + 'in' => array('Group' => 'Distance', 'Unit Name' => 'Inch', 'AllowPrefix' => false), + 'ft' => array('Group' => 'Distance', 'Unit Name' => 'Foot', 'AllowPrefix' => false), + 'yd' => array('Group' => 'Distance', 'Unit Name' => 'Yard', 'AllowPrefix' => false), + 'ang' => array('Group' => 'Distance', 'Unit Name' => 'Angstrom', 'AllowPrefix' => true), + 'Pica' => array('Group' => 'Distance', 'Unit Name' => 'Pica (1/72 in)', 'AllowPrefix' => false), + 'yr' => array('Group' => 'Time', 'Unit Name' => 'Year', 'AllowPrefix' => false), + 'day' => array('Group' => 'Time', 'Unit Name' => 'Day', 'AllowPrefix' => false), + 'hr' => array('Group' => 'Time', 'Unit Name' => 'Hour', 'AllowPrefix' => false), + 'mn' => array('Group' => 'Time', 'Unit Name' => 'Minute', 'AllowPrefix' => false), + 'sec' => array('Group' => 'Time', 'Unit Name' => 'Second', 'AllowPrefix' => true), + 'Pa' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true), + 'p' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true), + 'atm' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true), + 'at' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true), + 'mmHg' => array('Group' => 'Pressure', 'Unit Name' => 'mm of Mercury', 'AllowPrefix' => true), + 'N' => array('Group' => 'Force', 'Unit Name' => 'Newton', 'AllowPrefix' => true), + 'dyn' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true), + 'dy' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true), + 'lbf' => array('Group' => 'Force', 'Unit Name' => 'Pound force', 'AllowPrefix' => false), + 'J' => array('Group' => 'Energy', 'Unit Name' => 'Joule', 'AllowPrefix' => true), + 'e' => array('Group' => 'Energy', 'Unit Name' => 'Erg', 'AllowPrefix' => true), + 'c' => array('Group' => 'Energy', 'Unit Name' => 'Thermodynamic calorie', 'AllowPrefix' => true), + 'cal' => array('Group' => 'Energy', 'Unit Name' => 'IT calorie', 'AllowPrefix' => true), + 'eV' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true), + 'ev' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true), + 'HPh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false), + 'hh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false), + 'Wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true), + 'wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true), + 'flb' => array('Group' => 'Energy', 'Unit Name' => 'Foot-pound', 'AllowPrefix' => false), + 'BTU' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false), + 'btu' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false), + 'HP' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false), + 'h' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false), + 'W' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true), + 'w' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true), + 'T' => array('Group' => 'Magnetism', 'Unit Name' => 'Tesla', 'AllowPrefix' => true), + 'ga' => array('Group' => 'Magnetism', 'Unit Name' => 'Gauss', 'AllowPrefix' => true), + 'C' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false), + 'cel' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false), + 'F' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false), + 'fah' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false), + 'K' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false), + 'kel' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false), + 'tsp' => array('Group' => 'Liquid', 'Unit Name' => 'Teaspoon', 'AllowPrefix' => false), + 'tbs' => array('Group' => 'Liquid', 'Unit Name' => 'Tablespoon', 'AllowPrefix' => false), + 'oz' => array('Group' => 'Liquid', 'Unit Name' => 'Fluid Ounce', 'AllowPrefix' => false), + 'cup' => array('Group' => 'Liquid', 'Unit Name' => 'Cup', 'AllowPrefix' => false), + 'pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false), + 'us_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false), + 'uk_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.K. Pint', 'AllowPrefix' => false), + 'qt' => array('Group' => 'Liquid', 'Unit Name' => 'Quart', 'AllowPrefix' => false), + 'gal' => array('Group' => 'Liquid', 'Unit Name' => 'Gallon', 'AllowPrefix' => false), + 'l' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true), + 'lt' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true), ); /** @@ -109,21 +109,21 @@ class Engineering * @var mixed[] */ private static $conversionMultipliers = array( - 'Y' => array('multiplier' => 1E24, 'name' => 'yotta'), - 'Z' => array('multiplier' => 1E21, 'name' => 'zetta'), - 'E' => array('multiplier' => 1E18, 'name' => 'exa'), - 'P' => array('multiplier' => 1E15, 'name' => 'peta'), - 'T' => array('multiplier' => 1E12, 'name' => 'tera'), - 'G' => array('multiplier' => 1E9, 'name' => 'giga'), - 'M' => array('multiplier' => 1E6, 'name' => 'mega'), - 'k' => array('multiplier' => 1E3, 'name' => 'kilo'), - 'h' => array('multiplier' => 1E2, 'name' => 'hecto'), - 'e' => array('multiplier' => 1E1, 'name' => 'deka'), - 'd' => array('multiplier' => 1E-1, 'name' => 'deci'), - 'c' => array('multiplier' => 1E-2, 'name' => 'centi'), - 'm' => array('multiplier' => 1E-3, 'name' => 'milli'), - 'u' => array('multiplier' => 1E-6, 'name' => 'micro'), - 'n' => array('multiplier' => 1E-9, 'name' => 'nano'), + 'Y' => array('multiplier' => 1E24, 'name' => 'yotta'), + 'Z' => array('multiplier' => 1E21, 'name' => 'zetta'), + 'E' => array('multiplier' => 1E18, 'name' => 'exa'), + 'P' => array('multiplier' => 1E15, 'name' => 'peta'), + 'T' => array('multiplier' => 1E12, 'name' => 'tera'), + 'G' => array('multiplier' => 1E9, 'name' => 'giga'), + 'M' => array('multiplier' => 1E6, 'name' => 'mega'), + 'k' => array('multiplier' => 1E3, 'name' => 'kilo'), + 'h' => array('multiplier' => 1E2, 'name' => 'hecto'), + 'e' => array('multiplier' => 1E1, 'name' => 'deka'), + 'd' => array('multiplier' => 1E-1, 'name' => 'deci'), + 'c' => array('multiplier' => 1E-2, 'name' => 'centi'), + 'm' => array('multiplier' => 1E-3, 'name' => 'milli'), + 'u' => array('multiplier' => 1E-6, 'name' => 'micro'), + 'n' => array('multiplier' => 1E-9, 'name' => 'nano'), 'p' => array('multiplier' => 1E-12, 'name' => 'pico'), 'f' => array('multiplier' => 1E-15, 'name' => 'femto'), 'a' => array('multiplier' => 1E-18, 'name' => 'atto'), @@ -139,415 +139,415 @@ class Engineering private static $unitConversions = array( 'Mass' => array( 'g' => array( - 'g' => 1.0, - 'sg' => 6.85220500053478E-05, + 'g' => 1.0, + 'sg' => 6.85220500053478E-05, 'lbm' => 2.20462291469134E-03, - 'u' => 6.02217000000000E+23, + 'u' => 6.02217000000000E+23, 'ozm' => 3.52739718003627E-02, ), 'sg' => array( - 'g' => 1.45938424189287E+04, - 'sg' => 1.0, + 'g' => 1.45938424189287E+04, + 'sg' => 1.0, 'lbm' => 3.21739194101647E+01, - 'u' => 8.78866000000000E+27, + 'u' => 8.78866000000000E+27, 'ozm' => 5.14782785944229E+02, ), 'lbm' => array( - 'g' => 4.5359230974881148E+02, - 'sg' => 3.10810749306493E-02, + 'g' => 4.5359230974881148E+02, + 'sg' => 3.10810749306493E-02, 'lbm' => 1.0, - 'u' => 2.73161000000000E+26, + 'u' => 2.73161000000000E+26, 'ozm' => 1.60000023429410E+01, ), 'u' => array( - 'g' => 1.66053100460465E-24, - 'sg' => 1.13782988532950E-28, + 'g' => 1.66053100460465E-24, + 'sg' => 1.13782988532950E-28, 'lbm' => 3.66084470330684E-27, - 'u' => 1.0, + 'u' => 1.0, 'ozm' => 5.85735238300524E-26, ), 'ozm' => array( - 'g' => 2.83495152079732E+01, - 'sg' => 1.94256689870811E-03, + 'g' => 2.83495152079732E+01, + 'sg' => 1.94256689870811E-03, 'lbm' => 6.24999908478882E-02, - 'u' => 1.70725600000000E+25, + 'u' => 1.70725600000000E+25, 'ozm' => 1.0, ), ), 'Distance' => array( 'm' => array( - 'm' => 1.0, - 'mi' => 6.21371192237334E-04, - 'Nmi' => 5.39956803455724E-04, - 'in' => 3.93700787401575E+01, - 'ft' => 3.28083989501312E+00, - 'yd' => 1.09361329797891E+00, - 'ang' => 1.00000000000000E+10, + 'm' => 1.0, + 'mi' => 6.21371192237334E-04, + 'Nmi' => 5.39956803455724E-04, + 'in' => 3.93700787401575E+01, + 'ft' => 3.28083989501312E+00, + 'yd' => 1.09361329797891E+00, + 'ang' => 1.00000000000000E+10, 'Pica' => 2.83464566929116E+03, ), 'mi' => array( - 'm' => 1.60934400000000E+03, - 'mi' => 1.0, - 'Nmi' => 8.68976241900648E-01, - 'in' => 6.33600000000000E+04, - 'ft' => 5.28000000000000E+03, - 'yd' => 1.76000000000000E+03, - 'ang' => 1.60934400000000E+13, + 'm' => 1.60934400000000E+03, + 'mi' => 1.0, + 'Nmi' => 8.68976241900648E-01, + 'in' => 6.33600000000000E+04, + 'ft' => 5.28000000000000E+03, + 'yd' => 1.76000000000000E+03, + 'ang' => 1.60934400000000E+13, 'Pica' => 4.56191999999971E+06, ), 'Nmi' => array( - 'm' => 1.85200000000000E+03, - 'mi' => 1.15077944802354E+00, - 'Nmi' => 1.0, - 'in' => 7.29133858267717E+04, - 'ft' => 6.07611548556430E+03, - 'yd' => 2.02537182785694E+03, - 'ang' => 1.85200000000000E+13, + 'm' => 1.85200000000000E+03, + 'mi' => 1.15077944802354E+00, + 'Nmi' => 1.0, + 'in' => 7.29133858267717E+04, + 'ft' => 6.07611548556430E+03, + 'yd' => 2.02537182785694E+03, + 'ang' => 1.85200000000000E+13, 'Pica' => 5.24976377952723E+06, ), 'in' => array( - 'm' => 2.54000000000000E-02, - 'mi' => 1.57828282828283E-05, - 'Nmi' => 1.37149028077754E-05, - 'in' => 1.0, - 'ft' => 8.33333333333333E-02, - 'yd' => 2.77777777686643E-02, - 'ang' => 2.54000000000000E+08, + 'm' => 2.54000000000000E-02, + 'mi' => 1.57828282828283E-05, + 'Nmi' => 1.37149028077754E-05, + 'in' => 1.0, + 'ft' => 8.33333333333333E-02, + 'yd' => 2.77777777686643E-02, + 'ang' => 2.54000000000000E+08, 'Pica' => 7.19999999999955E+01, ), 'ft' => array( - 'm' => 3.04800000000000E-01, - 'mi' => 1.89393939393939E-04, - 'Nmi' => 1.64578833693305E-04, - 'in' => 1.20000000000000E+01, - 'ft' => 1.0, - 'yd' => 3.33333333223972E-01, - 'ang' => 3.04800000000000E+09, + 'm' => 3.04800000000000E-01, + 'mi' => 1.89393939393939E-04, + 'Nmi' => 1.64578833693305E-04, + 'in' => 1.20000000000000E+01, + 'ft' => 1.0, + 'yd' => 3.33333333223972E-01, + 'ang' => 3.04800000000000E+09, 'Pica' => 8.63999999999946E+02, ), 'yd' => array( - 'm' => 9.14400000300000E-01, - 'mi' => 5.68181818368230E-04, - 'Nmi' => 4.93736501241901E-04, - 'in' => 3.60000000118110E+01, - 'ft' => 3.00000000000000E+00, - 'yd' => 1.0, - 'ang' => 9.14400000300000E+09, + 'm' => 9.14400000300000E-01, + 'mi' => 5.68181818368230E-04, + 'Nmi' => 4.93736501241901E-04, + 'in' => 3.60000000118110E+01, + 'ft' => 3.00000000000000E+00, + 'yd' => 1.0, + 'ang' => 9.14400000300000E+09, 'Pica' => 2.59200000085023E+03, ), 'ang' => array( - 'm' => 1.00000000000000E-10, - 'mi' => 6.21371192237334E-14, - 'Nmi' => 5.39956803455724E-14, - 'in' => 3.93700787401575E-09, - 'ft' => 3.28083989501312E-10, - 'yd' => 1.09361329797891E-10, - 'ang' => 1.0, + 'm' => 1.00000000000000E-10, + 'mi' => 6.21371192237334E-14, + 'Nmi' => 5.39956803455724E-14, + 'in' => 3.93700787401575E-09, + 'ft' => 3.28083989501312E-10, + 'yd' => 1.09361329797891E-10, + 'ang' => 1.0, 'Pica' => 2.83464566929116E-07, ), 'Pica' => array( - 'm' => 3.52777777777800E-04, - 'mi' => 2.19205948372629E-07, - 'Nmi' => 1.90484761219114E-07, - 'in' => 1.38888888888898E-02, - 'ft' => 1.15740740740748E-03, - 'yd' => 3.85802469009251E-04, - 'ang' => 3.52777777777800E+06, + 'm' => 3.52777777777800E-04, + 'mi' => 2.19205948372629E-07, + 'Nmi' => 1.90484761219114E-07, + 'in' => 1.38888888888898E-02, + 'ft' => 1.15740740740748E-03, + 'yd' => 3.85802469009251E-04, + 'ang' => 3.52777777777800E+06, 'Pica' => 1.0, ), ), 'Time' => array( 'yr' => array( - 'yr' => 1.0, + 'yr' => 1.0, 'day' => 365.25, - 'hr' => 8766.0, - 'mn' => 525960.0, + 'hr' => 8766.0, + 'mn' => 525960.0, 'sec' => 31557600.0, ), 'day' => array( - 'yr' => 2.73785078713210E-03, + 'yr' => 2.73785078713210E-03, 'day' => 1.0, - 'hr' => 24.0, - 'mn' => 1440.0, + 'hr' => 24.0, + 'mn' => 1440.0, 'sec' => 86400.0, ), 'hr' => array( - 'yr' => 1.14077116130504E-04, + 'yr' => 1.14077116130504E-04, 'day' => 4.16666666666667E-02, - 'hr' => 1.0, - 'mn' => 60.0, + 'hr' => 1.0, + 'mn' => 60.0, 'sec' => 3600.0, ), 'mn' => array( - 'yr' => 1.90128526884174E-06, + 'yr' => 1.90128526884174E-06, 'day' => 6.94444444444444E-04, - 'hr' => 1.66666666666667E-02, - 'mn' => 1.0, + 'hr' => 1.66666666666667E-02, + 'mn' => 1.0, 'sec' => 60.0, ), 'sec' => array( - 'yr' => 3.16880878140289E-08, + 'yr' => 3.16880878140289E-08, 'day' => 1.15740740740741E-05, - 'hr' => 2.77777777777778E-04, - 'mn' => 1.66666666666667E-02, + 'hr' => 2.77777777777778E-04, + 'mn' => 1.66666666666667E-02, 'sec' => 1.0, ), ), 'Pressure' => array( 'Pa' => array( - 'Pa' => 1.0, - 'p' => 1.0, - 'atm' => 9.86923299998193E-06, - 'at' => 9.86923299998193E-06, + 'Pa' => 1.0, + 'p' => 1.0, + 'atm' => 9.86923299998193E-06, + 'at' => 9.86923299998193E-06, 'mmHg' => 7.50061707998627E-03, ), 'p' => array( - 'Pa' => 1.0, - 'p' => 1.0, - 'atm' => 9.86923299998193E-06, - 'at' => 9.86923299998193E-06, + 'Pa' => 1.0, + 'p' => 1.0, + 'atm' => 9.86923299998193E-06, + 'at' => 9.86923299998193E-06, 'mmHg' => 7.50061707998627E-03, ), 'atm' => array( - 'Pa' => 1.01324996583000E+05, - 'p' => 1.01324996583000E+05, - 'atm' => 1.0, - 'at' => 1.0, + 'Pa' => 1.01324996583000E+05, + 'p' => 1.01324996583000E+05, + 'atm' => 1.0, + 'at' => 1.0, 'mmHg' => 760.0, ), 'at' => array( - 'Pa' => 1.01324996583000E+05, - 'p' => 1.01324996583000E+05, - 'atm' => 1.0, - 'at' => 1.0, + 'Pa' => 1.01324996583000E+05, + 'p' => 1.01324996583000E+05, + 'atm' => 1.0, + 'at' => 1.0, 'mmHg' => 760.0, ), 'mmHg' => array( - 'Pa' => 1.33322363925000E+02, - 'p' => 1.33322363925000E+02, - 'atm' => 1.31578947368421E-03, - 'at' => 1.31578947368421E-03, + 'Pa' => 1.33322363925000E+02, + 'p' => 1.33322363925000E+02, + 'atm' => 1.31578947368421E-03, + 'at' => 1.31578947368421E-03, 'mmHg' => 1.0, ), ), 'Force' => array( 'N' => array( - 'N' => 1.0, + 'N' => 1.0, 'dyn' => 1.0E+5, - 'dy' => 1.0E+5, + 'dy' => 1.0E+5, 'lbf' => 2.24808923655339E-01, ), 'dyn' => array( - 'N' => 1.0E-5, + 'N' => 1.0E-5, 'dyn' => 1.0, - 'dy' => 1.0, + 'dy' => 1.0, 'lbf' => 2.24808923655339E-06, ), 'dy' => array( - 'N' => 1.0E-5, + 'N' => 1.0E-5, 'dyn' => 1.0, - 'dy' => 1.0, + 'dy' => 1.0, 'lbf' => 2.24808923655339E-06, ), 'lbf' => array( - 'N' => 4.448222, + 'N' => 4.448222, 'dyn' => 4.448222E+5, - 'dy' => 4.448222E+5, + 'dy' => 4.448222E+5, 'lbf' => 1.0, ), ), 'Energy' => array( 'J' => array( - 'J' => 1.0, - 'e' => 9.99999519343231E+06, - 'c' => 2.39006249473467E-01, + 'J' => 1.0, + 'e' => 9.99999519343231E+06, + 'c' => 2.39006249473467E-01, 'cal' => 2.38846190642017E-01, - 'eV' => 6.24145700000000E+18, - 'ev' => 6.24145700000000E+18, + 'eV' => 6.24145700000000E+18, + 'ev' => 6.24145700000000E+18, 'HPh' => 3.72506430801000E-07, - 'hh' => 3.72506430801000E-07, - 'Wh' => 2.77777916238711E-04, - 'wh' => 2.77777916238711E-04, + 'hh' => 3.72506430801000E-07, + 'Wh' => 2.77777916238711E-04, + 'wh' => 2.77777916238711E-04, 'flb' => 2.37304222192651E+01, 'BTU' => 9.47815067349015E-04, 'btu' => 9.47815067349015E-04, ), 'e' => array( - 'J' => 1.00000048065700E-07, - 'e' => 1.0, - 'c' => 2.39006364353494E-08, + 'J' => 1.00000048065700E-07, + 'e' => 1.0, + 'c' => 2.39006364353494E-08, 'cal' => 2.38846305445111E-08, - 'eV' => 6.24146000000000E+11, - 'ev' => 6.24146000000000E+11, + 'eV' => 6.24146000000000E+11, + 'ev' => 6.24146000000000E+11, 'HPh' => 3.72506609848824E-14, - 'hh' => 3.72506609848824E-14, - 'Wh' => 2.77778049754611E-11, - 'wh' => 2.77778049754611E-11, + 'hh' => 3.72506609848824E-14, + 'Wh' => 2.77778049754611E-11, + 'wh' => 2.77778049754611E-11, 'flb' => 2.37304336254586E-06, 'BTU' => 9.47815522922962E-11, 'btu' => 9.47815522922962E-11, ), 'c' => array( - 'J' => 4.18399101363672E+00, - 'e' => 4.18398900257312E+07, - 'c' => 1.0, + 'J' => 4.18399101363672E+00, + 'e' => 4.18398900257312E+07, + 'c' => 1.0, 'cal' => 9.99330315287563E-01, - 'eV' => 2.61142000000000E+19, - 'ev' => 2.61142000000000E+19, + 'eV' => 2.61142000000000E+19, + 'ev' => 2.61142000000000E+19, 'HPh' => 1.55856355899327E-06, - 'hh' => 1.55856355899327E-06, - 'Wh' => 1.16222030532950E-03, - 'wh' => 1.16222030532950E-03, + 'hh' => 1.55856355899327E-06, + 'Wh' => 1.16222030532950E-03, + 'wh' => 1.16222030532950E-03, 'flb' => 9.92878733152102E+01, 'BTU' => 3.96564972437776E-03, 'btu' => 3.96564972437776E-03, ), 'cal' => array( - 'J' => 4.18679484613929E+00, - 'e' => 4.18679283372801E+07, - 'c' => 1.00067013349059E+00, + 'J' => 4.18679484613929E+00, + 'e' => 4.18679283372801E+07, + 'c' => 1.00067013349059E+00, 'cal' => 1.0, - 'eV' => 2.61317000000000E+19, - 'ev' => 2.61317000000000E+19, + 'eV' => 2.61317000000000E+19, + 'ev' => 2.61317000000000E+19, 'HPh' => 1.55960800463137E-06, - 'hh' => 1.55960800463137E-06, - 'Wh' => 1.16299914807955E-03, - 'wh' => 1.16299914807955E-03, + 'hh' => 1.55960800463137E-06, + 'Wh' => 1.16299914807955E-03, + 'wh' => 1.16299914807955E-03, 'flb' => 9.93544094443283E+01, 'BTU' => 3.96830723907002E-03, 'btu' => 3.96830723907002E-03, ), 'eV' => array( - 'J' => 1.60219000146921E-19, - 'e' => 1.60218923136574E-12, - 'c' => 3.82933423195043E-20, + 'J' => 1.60219000146921E-19, + 'e' => 1.60218923136574E-12, + 'c' => 3.82933423195043E-20, 'cal' => 3.82676978535648E-20, - 'eV' => 1.0, - 'ev' => 1.0, + 'eV' => 1.0, + 'ev' => 1.0, 'HPh' => 5.96826078912344E-26, - 'hh' => 5.96826078912344E-26, - 'Wh' => 4.45053000026614E-23, - 'wh' => 4.45053000026614E-23, + 'hh' => 5.96826078912344E-26, + 'Wh' => 4.45053000026614E-23, + 'wh' => 4.45053000026614E-23, 'flb' => 3.80206452103492E-18, 'BTU' => 1.51857982414846E-22, 'btu' => 1.51857982414846E-22, ), 'ev' => array( - 'J' => 1.60219000146921E-19, - 'e' => 1.60218923136574E-12, - 'c' => 3.82933423195043E-20, + 'J' => 1.60219000146921E-19, + 'e' => 1.60218923136574E-12, + 'c' => 3.82933423195043E-20, 'cal' => 3.82676978535648E-20, - 'eV' => 1.0, - 'ev' => 1.0, + 'eV' => 1.0, + 'ev' => 1.0, 'HPh' => 5.96826078912344E-26, - 'hh' => 5.96826078912344E-26, - 'Wh' => 4.45053000026614E-23, - 'wh' => 4.45053000026614E-23, + 'hh' => 5.96826078912344E-26, + 'Wh' => 4.45053000026614E-23, + 'wh' => 4.45053000026614E-23, 'flb' => 3.80206452103492E-18, 'BTU' => 1.51857982414846E-22, 'btu' => 1.51857982414846E-22, ), 'HPh' => array( - 'J' => 2.68451741316170E+06, - 'e' => 2.68451612283024E+13, - 'c' => 6.41616438565991E+05, + 'J' => 2.68451741316170E+06, + 'e' => 2.68451612283024E+13, + 'c' => 6.41616438565991E+05, 'cal' => 6.41186757845835E+05, - 'eV' => 1.67553000000000E+25, - 'ev' => 1.67553000000000E+25, + 'eV' => 1.67553000000000E+25, + 'ev' => 1.67553000000000E+25, 'HPh' => 1.0, - 'hh' => 1.0, - 'Wh' => 7.45699653134593E+02, - 'wh' => 7.45699653134593E+02, + 'hh' => 1.0, + 'Wh' => 7.45699653134593E+02, + 'wh' => 7.45699653134593E+02, 'flb' => 6.37047316692964E+07, 'BTU' => 2.54442605275546E+03, 'btu' => 2.54442605275546E+03, ), 'hh' => array( - 'J' => 2.68451741316170E+06, - 'e' => 2.68451612283024E+13, - 'c' => 6.41616438565991E+05, + 'J' => 2.68451741316170E+06, + 'e' => 2.68451612283024E+13, + 'c' => 6.41616438565991E+05, 'cal' => 6.41186757845835E+05, - 'eV' => 1.67553000000000E+25, - 'ev' => 1.67553000000000E+25, + 'eV' => 1.67553000000000E+25, + 'ev' => 1.67553000000000E+25, 'HPh' => 1.0, - 'hh' => 1.0, - 'Wh' => 7.45699653134593E+02, - 'wh' => 7.45699653134593E+02, + 'hh' => 1.0, + 'Wh' => 7.45699653134593E+02, + 'wh' => 7.45699653134593E+02, 'flb' => 6.37047316692964E+07, 'BTU' => 2.54442605275546E+03, 'btu' => 2.54442605275546E+03, ), 'Wh' => array( - 'J' => 3.59999820554720E+03, - 'e' => 3.59999647518369E+10, - 'c' => 8.60422069219046E+02, + 'J' => 3.59999820554720E+03, + 'e' => 3.59999647518369E+10, + 'c' => 8.60422069219046E+02, 'cal' => 8.59845857713046E+02, - 'eV' => 2.24692340000000E+22, - 'ev' => 2.24692340000000E+22, + 'eV' => 2.24692340000000E+22, + 'ev' => 2.24692340000000E+22, 'HPh' => 1.34102248243839E-03, - 'hh' => 1.34102248243839E-03, - 'Wh' => 1.0, - 'wh' => 1.0, + 'hh' => 1.34102248243839E-03, + 'Wh' => 1.0, + 'wh' => 1.0, 'flb' => 8.54294774062316E+04, 'BTU' => 3.41213254164705E+00, 'btu' => 3.41213254164705E+00, ), 'wh' => array( - 'J' => 3.59999820554720E+03, - 'e' => 3.59999647518369E+10, - 'c' => 8.60422069219046E+02, + 'J' => 3.59999820554720E+03, + 'e' => 3.59999647518369E+10, + 'c' => 8.60422069219046E+02, 'cal' => 8.59845857713046E+02, - 'eV' => 2.24692340000000E+22, - 'ev' => 2.24692340000000E+22, + 'eV' => 2.24692340000000E+22, + 'ev' => 2.24692340000000E+22, 'HPh' => 1.34102248243839E-03, - 'hh' => 1.34102248243839E-03, - 'Wh' => 1.0, - 'wh' => 1.0, + 'hh' => 1.34102248243839E-03, + 'Wh' => 1.0, + 'wh' => 1.0, 'flb' => 8.54294774062316E+04, 'BTU' => 3.41213254164705E+00, 'btu' => 3.41213254164705E+00, ), 'flb' => array( - 'J' => 4.21400003236424E-02, - 'e' => 4.21399800687660E+05, - 'c' => 1.00717234301644E-02, + 'J' => 4.21400003236424E-02, + 'e' => 4.21399800687660E+05, + 'c' => 1.00717234301644E-02, 'cal' => 1.00649785509554E-02, - 'eV' => 2.63015000000000E+17, - 'ev' => 2.63015000000000E+17, + 'eV' => 2.63015000000000E+17, + 'ev' => 2.63015000000000E+17, 'HPh' => 1.56974211145130E-08, - 'hh' => 1.56974211145130E-08, - 'Wh' => 1.17055614802000E-05, - 'wh' => 1.17055614802000E-05, + 'hh' => 1.56974211145130E-08, + 'Wh' => 1.17055614802000E-05, + 'wh' => 1.17055614802000E-05, 'flb' => 1.0, 'BTU' => 3.99409272448406E-05, 'btu' => 3.99409272448406E-05, ), 'BTU' => array( - 'J' => 1.05505813786749E+03, - 'e' => 1.05505763074665E+10, - 'c' => 2.52165488508168E+02, + 'J' => 1.05505813786749E+03, + 'e' => 1.05505763074665E+10, + 'c' => 2.52165488508168E+02, 'cal' => 2.51996617135510E+02, - 'eV' => 6.58510000000000E+21, - 'ev' => 6.58510000000000E+21, + 'eV' => 6.58510000000000E+21, + 'ev' => 6.58510000000000E+21, 'HPh' => 3.93015941224568E-04, - 'hh' => 3.93015941224568E-04, - 'Wh' => 2.93071851047526E-01, - 'wh' => 2.93071851047526E-01, + 'hh' => 3.93015941224568E-04, + 'Wh' => 2.93071851047526E-01, + 'wh' => 2.93071851047526E-01, 'flb' => 2.50369750774671E+04, 'BTU' => 1.0, 'btu' => 1.0, ), 'btu' => array( - 'J' => 1.05505813786749E+03, - 'e' => 1.05505763074665E+10, - 'c' => 2.52165488508168E+02, + 'J' => 1.05505813786749E+03, + 'e' => 1.05505763074665E+10, + 'c' => 2.52165488508168E+02, 'cal' => 2.51996617135510E+02, - 'eV' => 6.58510000000000E+21, - 'ev' => 6.58510000000000E+21, + 'eV' => 6.58510000000000E+21, + 'ev' => 6.58510000000000E+21, 'HPh' => 3.93015941224568E-04, - 'hh' => 3.93015941224568E-04, - 'Wh' => 2.93071851047526E-01, - 'wh' => 2.93071851047526E-01, + 'hh' => 3.93015941224568E-04, + 'Wh' => 2.93071851047526E-01, + 'wh' => 2.93071851047526E-01, 'flb' => 2.50369750774671E+04, 'BTU' => 1.0, 'btu' => 1.0, @@ -556,182 +556,182 @@ class Engineering 'Power' => array( 'HP' => array( 'HP' => 1.0, - 'h' => 1.0, - 'W' => 7.45701000000000E+02, - 'w' => 7.45701000000000E+02, + 'h' => 1.0, + 'W' => 7.45701000000000E+02, + 'w' => 7.45701000000000E+02, ), 'h' => array( 'HP' => 1.0, - 'h' => 1.0, - 'W' => 7.45701000000000E+02, - 'w' => 7.45701000000000E+02, + 'h' => 1.0, + 'W' => 7.45701000000000E+02, + 'w' => 7.45701000000000E+02, ), 'W' => array( 'HP' => 1.34102006031908E-03, - 'h' => 1.34102006031908E-03, - 'W' => 1.0, - 'w' => 1.0, + 'h' => 1.34102006031908E-03, + 'W' => 1.0, + 'w' => 1.0, ), 'w' => array( 'HP' => 1.34102006031908E-03, - 'h' => 1.34102006031908E-03, - 'W' => 1.0, - 'w' => 1.0, + 'h' => 1.34102006031908E-03, + 'W' => 1.0, + 'w' => 1.0, ), ), 'Magnetism' => array( 'T' => array( - 'T' => 1.0, + 'T' => 1.0, 'ga' => 10000.0, ), 'ga' => array( - 'T' => 0.0001, + 'T' => 0.0001, 'ga' => 1.0, ), ), 'Liquid' => array( 'tsp' => array( - 'tsp' => 1.0, - 'tbs' => 3.33333333333333E-01, - 'oz' => 1.66666666666667E-01, - 'cup' => 2.08333333333333E-02, - 'pt' => 1.04166666666667E-02, + 'tsp' => 1.0, + 'tbs' => 3.33333333333333E-01, + 'oz' => 1.66666666666667E-01, + 'cup' => 2.08333333333333E-02, + 'pt' => 1.04166666666667E-02, 'us_pt' => 1.04166666666667E-02, 'uk_pt' => 8.67558516821960E-03, - 'qt' => 5.20833333333333E-03, - 'gal' => 1.30208333333333E-03, - 'l' => 4.92999408400710E-03, - 'lt' => 4.92999408400710E-03, + 'qt' => 5.20833333333333E-03, + 'gal' => 1.30208333333333E-03, + 'l' => 4.92999408400710E-03, + 'lt' => 4.92999408400710E-03, ), 'tbs' => array( - 'tsp' => 3.00000000000000E+00, - 'tbs' => 1.0, - 'oz' => 5.00000000000000E-01, - 'cup' => 6.25000000000000E-02, - 'pt' => 3.12500000000000E-02, + 'tsp' => 3.00000000000000E+00, + 'tbs' => 1.0, + 'oz' => 5.00000000000000E-01, + 'cup' => 6.25000000000000E-02, + 'pt' => 3.12500000000000E-02, 'us_pt' => 3.12500000000000E-02, 'uk_pt' => 2.60267555046588E-02, - 'qt' => 1.56250000000000E-02, - 'gal' => 3.90625000000000E-03, - 'l' => 1.47899822520213E-02, - 'lt' => 1.47899822520213E-02, + 'qt' => 1.56250000000000E-02, + 'gal' => 3.90625000000000E-03, + 'l' => 1.47899822520213E-02, + 'lt' => 1.47899822520213E-02, ), 'oz' => array( - 'tsp' => 6.00000000000000E+00, - 'tbs' => 2.00000000000000E+00, - 'oz' => 1.0, - 'cup' => 1.25000000000000E-01, - 'pt' => 6.25000000000000E-02, + 'tsp' => 6.00000000000000E+00, + 'tbs' => 2.00000000000000E+00, + 'oz' => 1.0, + 'cup' => 1.25000000000000E-01, + 'pt' => 6.25000000000000E-02, 'us_pt' => 6.25000000000000E-02, 'uk_pt' => 5.20535110093176E-02, - 'qt' => 3.12500000000000E-02, - 'gal' => 7.81250000000000E-03, - 'l' => 2.95799645040426E-02, - 'lt' => 2.95799645040426E-02, + 'qt' => 3.12500000000000E-02, + 'gal' => 7.81250000000000E-03, + 'l' => 2.95799645040426E-02, + 'lt' => 2.95799645040426E-02, ), 'cup' => array( - 'tsp' => 4.80000000000000E+01, - 'tbs' => 1.60000000000000E+01, - 'oz' => 8.00000000000000E+00, - 'cup' => 1.0, - 'pt' => 5.00000000000000E-01, + 'tsp' => 4.80000000000000E+01, + 'tbs' => 1.60000000000000E+01, + 'oz' => 8.00000000000000E+00, + 'cup' => 1.0, + 'pt' => 5.00000000000000E-01, 'us_pt' => 5.00000000000000E-01, 'uk_pt' => 4.16428088074541E-01, - 'qt' => 2.50000000000000E-01, - 'gal' => 6.25000000000000E-02, - 'l' => 2.36639716032341E-01, - 'lt' => 2.36639716032341E-01, + 'qt' => 2.50000000000000E-01, + 'gal' => 6.25000000000000E-02, + 'l' => 2.36639716032341E-01, + 'lt' => 2.36639716032341E-01, ), 'pt' => array( - 'tsp' => 9.60000000000000E+01, - 'tbs' => 3.20000000000000E+01, - 'oz' => 1.60000000000000E+01, - 'cup' => 2.00000000000000E+00, - 'pt' => 1.0, + 'tsp' => 9.60000000000000E+01, + 'tbs' => 3.20000000000000E+01, + 'oz' => 1.60000000000000E+01, + 'cup' => 2.00000000000000E+00, + 'pt' => 1.0, 'us_pt' => 1.0, 'uk_pt' => 8.32856176149081E-01, - 'qt' => 5.00000000000000E-01, - 'gal' => 1.25000000000000E-01, - 'l' => 4.73279432064682E-01, - 'lt' => 4.73279432064682E-01, + 'qt' => 5.00000000000000E-01, + 'gal' => 1.25000000000000E-01, + 'l' => 4.73279432064682E-01, + 'lt' => 4.73279432064682E-01, ), 'us_pt' => array( - 'tsp' => 9.60000000000000E+01, - 'tbs' => 3.20000000000000E+01, - 'oz' => 1.60000000000000E+01, - 'cup' => 2.00000000000000E+00, - 'pt' => 1.0, + 'tsp' => 9.60000000000000E+01, + 'tbs' => 3.20000000000000E+01, + 'oz' => 1.60000000000000E+01, + 'cup' => 2.00000000000000E+00, + 'pt' => 1.0, 'us_pt' => 1.0, 'uk_pt' => 8.32856176149081E-01, - 'qt' => 5.00000000000000E-01, - 'gal' => 1.25000000000000E-01, - 'l' => 4.73279432064682E-01, - 'lt' => 4.73279432064682E-01, + 'qt' => 5.00000000000000E-01, + 'gal' => 1.25000000000000E-01, + 'l' => 4.73279432064682E-01, + 'lt' => 4.73279432064682E-01, ), 'uk_pt' => array( - 'tsp' => 1.15266000000000E+02, - 'tbs' => 3.84220000000000E+01, - 'oz' => 1.92110000000000E+01, - 'cup' => 2.40137500000000E+00, - 'pt' => 1.20068750000000E+00, + 'tsp' => 1.15266000000000E+02, + 'tbs' => 3.84220000000000E+01, + 'oz' => 1.92110000000000E+01, + 'cup' => 2.40137500000000E+00, + 'pt' => 1.20068750000000E+00, 'us_pt' => 1.20068750000000E+00, 'uk_pt' => 1.0, - 'qt' => 6.00343750000000E-01, - 'gal' => 1.50085937500000E-01, - 'l' => 5.68260698087162E-01, - 'lt' => 5.68260698087162E-01, + 'qt' => 6.00343750000000E-01, + 'gal' => 1.50085937500000E-01, + 'l' => 5.68260698087162E-01, + 'lt' => 5.68260698087162E-01, ), 'qt' => array( - 'tsp' => 1.92000000000000E+02, - 'tbs' => 6.40000000000000E+01, - 'oz' => 3.20000000000000E+01, - 'cup' => 4.00000000000000E+00, - 'pt' => 2.00000000000000E+00, + 'tsp' => 1.92000000000000E+02, + 'tbs' => 6.40000000000000E+01, + 'oz' => 3.20000000000000E+01, + 'cup' => 4.00000000000000E+00, + 'pt' => 2.00000000000000E+00, 'us_pt' => 2.00000000000000E+00, 'uk_pt' => 1.66571235229816E+00, - 'qt' => 1.0, - 'gal' => 2.50000000000000E-01, - 'l' => 9.46558864129363E-01, - 'lt' => 9.46558864129363E-01, + 'qt' => 1.0, + 'gal' => 2.50000000000000E-01, + 'l' => 9.46558864129363E-01, + 'lt' => 9.46558864129363E-01, ), 'gal' => array( - 'tsp' => 7.68000000000000E+02, - 'tbs' => 2.56000000000000E+02, - 'oz' => 1.28000000000000E+02, - 'cup' => 1.60000000000000E+01, - 'pt' => 8.00000000000000E+00, + 'tsp' => 7.68000000000000E+02, + 'tbs' => 2.56000000000000E+02, + 'oz' => 1.28000000000000E+02, + 'cup' => 1.60000000000000E+01, + 'pt' => 8.00000000000000E+00, 'us_pt' => 8.00000000000000E+00, 'uk_pt' => 6.66284940919265E+00, - 'qt' => 4.00000000000000E+00, - 'gal' => 1.0, - 'l' => 3.78623545651745E+00, - 'lt' => 3.78623545651745E+00, + 'qt' => 4.00000000000000E+00, + 'gal' => 1.0, + 'l' => 3.78623545651745E+00, + 'lt' => 3.78623545651745E+00, ), 'l' => array( - 'tsp' => 2.02840000000000E+02, - 'tbs' => 6.76133333333333E+01, - 'oz' => 3.38066666666667E+01, - 'cup' => 4.22583333333333E+00, - 'pt' => 2.11291666666667E+00, + 'tsp' => 2.02840000000000E+02, + 'tbs' => 6.76133333333333E+01, + 'oz' => 3.38066666666667E+01, + 'cup' => 4.22583333333333E+00, + 'pt' => 2.11291666666667E+00, 'us_pt' => 2.11291666666667E+00, 'uk_pt' => 1.75975569552166E+00, - 'qt' => 1.05645833333333E+00, - 'gal' => 2.64114583333333E-01, - 'l' => 1.0, - 'lt' => 1.0, + 'qt' => 1.05645833333333E+00, + 'gal' => 2.64114583333333E-01, + 'l' => 1.0, + 'lt' => 1.0, ), 'lt' => array( - 'tsp' => 2.02840000000000E+02, - 'tbs' => 6.76133333333333E+01, - 'oz' => 3.38066666666667E+01, - 'cup' => 4.22583333333333E+00, - 'pt' => 2.11291666666667E+00, + 'tsp' => 2.02840000000000E+02, + 'tbs' => 6.76133333333333E+01, + 'oz' => 3.38066666666667E+01, + 'cup' => 4.22583333333333E+00, + 'pt' => 2.11291666666667E+00, 'us_pt' => 2.11291666666667E+00, 'uk_pt' => 1.75975569552166E+00, - 'qt' => 1.05645833333333E+00, - 'gal' => 2.64114583333333E-01, - 'l' => 1.0, - 'lt' => 1.0, + 'qt' => 1.05645833333333E+00, + 'gal' => 2.64114583333333E-01, + 'l' => 1.0, + 'lt' => 1.0, ), ), ); @@ -742,12 +742,12 @@ class Engineering * * Parses a complex number into its real and imaginary parts, and an I or J suffix * - * @param string $complexNumber The complex number + * @param string $complexNumber The complex number * @return string[] Indexed on "real", "imaginary" and "suffix" */ public static function parseComplex($complexNumber) { - $workString = (string) $complexNumber; + $workString = (string)$complexNumber; $realNumber = $imaginary = 0; // Extract the suffix, if there is one @@ -770,13 +770,13 @@ class Engineering ++$leadingSign; } - $realNumber = substr($workString, 0, strlen($realNumber)+strlen($power)+$leadingSign); + $realNumber = substr($workString, 0, strlen($realNumber) + strlen($power) + $leadingSign); if ($suffix != '') { $imaginary = substr($workString, strlen($realNumber)); if (($imaginary == '') && (($realNumber == '') || ($realNumber == '+') || ($realNumber == '-'))) { - $imaginary = $realNumber.'1'; + $imaginary = $realNumber . '1'; $realNumber = '0'; } elseif ($imaginary == '') { $imaginary = $realNumber; @@ -787,7 +787,7 @@ class Engineering } return array( - 'real' => $realNumber, + 'real' => $realNumber, 'imaginary' => $imaginary, 'suffix' => $suffix ); @@ -797,7 +797,7 @@ class Engineering /** * Cleans the leading characters in a complex number string * - * @param string $complexNumber The complex number to clean + * @param string $complexNumber The complex number to clean * @return string The "cleaned" complex number */ private static function cleanComplex($complexNumber) @@ -809,7 +809,7 @@ class Engineering $complexNumber = substr($complexNumber, 1); } if ($complexNumber{0} == '.') { - $complexNumber = '0'.$complexNumber; + $complexNumber = '0' . $complexNumber; } if ($complexNumber{0} == '+') { $complexNumber = substr($complexNumber, 1); @@ -820,13 +820,21 @@ class Engineering /** * Formats a number base string value with leading zeroes * - * @param string $xVal The "number" to pad - * @param integer $places The length that we want to pad this value + * @param string $xVal The "number" to pad + * @param integer $places The length that we want to pad this value * @return string The padded "number" */ private static function nbrConversionFormat($xVal, $places) { if (!is_null($places)) { + if (is_numeric($places)) { + $places = (int)$places; + } else { + return Functions::VALUE(); + } + if ($places < 0) { + return Functions::NAN(); + } if (strlen($xVal) <= $places) { return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10); } else { @@ -846,24 +854,24 @@ class Engineering * Excel Function: * BESSELI(x,ord) * - * @access public - * @category Engineering Functions - * @param float $x The value at which to evaluate the function. + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. * If x is nonnumeric, BESSELI returns the #VALUE! error value. - * @param integer $ord The order of the Bessel function. + * @param integer $ord The order of the Bessel function. * If ord is not an integer, it is truncated. * If $ord is nonnumeric, BESSELI returns the #VALUE! error value. * If $ord < 0, BESSELI returns the #NUM! error value. - * @return float + * @return float * */ public static function BESSELI($x, $ord) { - $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); - $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); + $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); if ((is_numeric($x)) && (is_numeric($ord))) { - $ord = floor($ord); + $ord = floor($ord); if ($ord < 0) { return Functions::NAN(); } @@ -900,23 +908,23 @@ class Engineering * Excel Function: * BESSELJ(x,ord) * - * @access public - * @category Engineering Functions - * @param float $x The value at which to evaluate the function. + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. * If x is nonnumeric, BESSELJ returns the #VALUE! error value. - * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. + * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. * If $ord is nonnumeric, BESSELJ returns the #VALUE! error value. * If $ord < 0, BESSELJ returns the #NUM! error value. - * @return float + * @return float * */ public static function BESSELJ($x, $ord) { - $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); - $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); + $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); if ((is_numeric($x)) && (is_numeric($ord))) { - $ord = floor($ord); + $ord = floor($ord); if ($ord < 0) { return Functions::NAN(); } @@ -954,12 +962,12 @@ class Engineering $y = ($fNum2 * $fNum2); $fRet = -log($fNum2) * self::BESSELI($fNum, 0) + (-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y * - (0.10750e-3 + $y * 0.74e-5)))))); + (0.10750e-3 + $y * 0.74e-5)))))); } else { $y = 2 / $fNum; $fRet = exp(-$fNum) / sqrt($fNum) * (1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y * - (0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3)))))); + (0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3)))))); } return $fRet; } @@ -972,12 +980,12 @@ class Engineering $y = ($fNum2 * $fNum2); $fRet = log($fNum2) * self::BESSELI($fNum, 1) + (1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y * - (-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum; + (-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum; } else { $y = 2 / $fNum; $fRet = exp(-$fNum) / sqrt($fNum) * (1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y * - (0.325614e-2 + $y * (-0.68245e-3))))))); + (0.325614e-2 + $y * (-0.68245e-3))))))); } return $fRet; } @@ -992,20 +1000,20 @@ class Engineering * Excel Function: * BESSELK(x,ord) * - * @access public - * @category Engineering Functions - * @param float $x The value at which to evaluate the function. + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. * If x is nonnumeric, BESSELK returns the #VALUE! error value. - * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. + * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. * If $ord is nonnumeric, BESSELK returns the #VALUE! error value. * If $ord < 0, BESSELK returns the #NUM! error value. - * @return float + * @return float * */ public static function BESSELK($x, $ord) { - $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); - $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); + $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); if ((is_numeric($x)) && (is_numeric($ord))) { if (($ord < 0) || ($x == 0.0)) { @@ -1018,13 +1026,13 @@ class Engineering case 1: return self::besselK1($x); default: - $fTox = 2 / $x; - $fBkm = self::besselK0($x); - $fBk = self::besselK1($x); + $fTox = 2 / $x; + $fBkm = self::besselK0($x); + $fBk = self::besselK1($x); for ($n = 1; $n < $ord; ++$n) { - $fBkp = $fBkm + $n * $fTox * $fBk; - $fBkm = $fBk; - $fBk = $fBkp; + $fBkp = $fBkm + $n * $fTox * $fBk; + $fBkm = $fBk; + $fBk = $fBkp; } } return (is_nan($fBk)) ? Functions::NAN() : $fBk; @@ -1057,10 +1065,10 @@ class Engineering if ($fNum < 8.0) { $y = ($fNum * $fNum); $f1 = $fNum * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y * (0.7349264551e9 + $y * - (-0.4237922726e7 + $y * 0.8511937935e4))))); + (-0.4237922726e7 + $y * 0.8511937935e4))))); $f2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y * - (0.1020426050e6 + $y * (0.3549632885e3 + $y))))); - $fRet = $f1 / $f2 + 0.636619772 * ( self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum); + (0.1020426050e6 + $y * (0.3549632885e3 + $y))))); + $fRet = $f1 / $f2 + 0.636619772 * (self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum); } else { $fRet = sqrt(0.636619772 / $fNum) * sin($fNum - 2.356194491); } @@ -1076,20 +1084,20 @@ class Engineering * Excel Function: * BESSELY(x,ord) * - * @access public - * @category Engineering Functions - * @param float $x The value at which to evaluate the function. + * @access public + * @category Engineering Functions + * @param float $x The value at which to evaluate the function. * If x is nonnumeric, BESSELK returns the #VALUE! error value. - * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. + * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated. * If $ord is nonnumeric, BESSELK returns the #VALUE! error value. * If $ord < 0, BESSELK returns the #NUM! error value. * - * @return float + * @return float */ public static function BESSELY($x, $ord) { - $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); - $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); + $x = (is_null($x)) ? 0.0 : Functions::flattenSingleValue($x); + $ord = (is_null($ord)) ? 0.0 : Functions::flattenSingleValue($ord); if ((is_numeric($x)) && (is_numeric($ord))) { if (($ord < 0) || ($x == 0.0)) { @@ -1102,13 +1110,13 @@ class Engineering case 1: return self::besselY1($x); default: - $fTox = 2 / $x; - $fBym = self::besselY0($x); - $fBy = self::besselY1($x); + $fTox = 2 / $x; + $fBym = self::besselY0($x); + $fBy = self::besselY1($x); for ($n = 1; $n < $ord; ++$n) { - $fByp = $n * $fTox * $fBy - $fBym; - $fBym = $fBy; - $fBy = $fByp; + $fByp = $n * $fTox * $fBy - $fBym; + $fBym = $fBy; + $fBy = $fByp; } } return (is_nan($fBy)) ? Functions::NAN() : $fBy; @@ -1127,7 +1135,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The binary number (as a string) that you want to convert. The number + * @param string $x The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. @@ -1137,11 +1145,11 @@ class Engineering */ public static function BINTODEC($x) { - $x = Functions::flattenSingleValue($x); + $x = Functions::flattenSingleValue($x); if (is_bool($x)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; + $x = (int)$x; } else { return Functions::VALUE(); } @@ -1149,7 +1157,7 @@ class Engineering if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) { $x = floor($x); } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[01]/', $x, $out)) { return Functions::NAN(); } @@ -1158,7 +1166,7 @@ class Engineering } elseif (strlen($x) == 10) { // Two's Complement $x = substr($x, -9); - return '-'.(512-bindec($x)); + return '-' . (512 - bindec($x)); } return bindec($x); } @@ -1174,13 +1182,13 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The binary number (as a string) that you want to convert. The number + * @param string $x The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2HEX returns the #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, BIN2HEX uses the + * @param integer $places The number of characters to use. If places is omitted, BIN2HEX uses the * minimum number of characters necessary. Places is useful for padding the * return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1190,12 +1198,13 @@ class Engineering */ public static function BINTOHEX($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); + // Argument X if (is_bool($x)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; + $x = (int)$x; } else { return Functions::VALUE(); } @@ -1203,7 +1212,7 @@ class Engineering if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) { $x = floor($x); } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[01]/', $x, $out)) { return Functions::NAN(); } @@ -1211,9 +1220,9 @@ class Engineering return Functions::NAN(); } elseif (strlen($x) == 10) { // Two's Complement - return str_repeat('F', 8).substr(strtoupper(dechex(bindec(substr($x, -9)))), -2); + return str_repeat('F', 8) . substr(strtoupper(dechex(bindec(substr($x, -9)))), -2); } - $hexVal = (string) strtoupper(dechex(bindec($x))); + $hexVal = (string)strtoupper(dechex(bindec($x))); return self::nbrConversionFormat($hexVal, $places); } @@ -1229,13 +1238,13 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The binary number (as a string) that you want to convert. The number + * @param string $x The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2OCT returns the #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, BIN2OCT uses the + * @param integer $places The number of characters to use. If places is omitted, BIN2OCT uses the * minimum number of characters necessary. Places is useful for padding the * return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1245,12 +1254,12 @@ class Engineering */ public static function BINTOOCT($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; + $x = (int)$x; } else { return Functions::VALUE(); } @@ -1258,7 +1267,7 @@ class Engineering if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) { $x = floor($x); } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[01]/', $x, $out)) { return Functions::NAN(); } @@ -1266,9 +1275,9 @@ class Engineering return Functions::NAN(); } elseif (strlen($x) == 10) { // Two's Complement - return str_repeat('7', 7).substr(strtoupper(decoct(bindec(substr($x, -9)))), -3); + return str_repeat('7', 7) . substr(strtoupper(decoct(bindec(substr($x, -9)))), -3); } - $octVal = (string) decoct(bindec($x)); + $octVal = (string)decoct(bindec($x)); return self::nbrConversionFormat($octVal, $places); } @@ -1284,7 +1293,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The decimal integer you want to convert. If number is negative, + * @param string $x The decimal integer you want to convert. If number is negative, * valid place values are ignored and DEC2BIN returns a 10-character * (10-bit) binary number in which the most significant bit is the sign * bit. The remaining 9 bits are magnitude bits. Negative numbers are @@ -1294,7 +1303,7 @@ class Engineering * If number is nonnumeric, DEC2BIN returns the #VALUE! error value. * If DEC2BIN requires more than places characters, it returns the #NUM! * error value. - * @param integer $places The number of characters to use. If places is omitted, DEC2BIN uses + * @param integer $places The number of characters to use. If places is omitted, DEC2BIN uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1304,26 +1313,26 @@ class Engineering */ public static function DECTOBIN($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; + $x = (int)$x; } else { return Functions::VALUE(); } } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) { return Functions::VALUE(); } - $x = (string) floor($x); + $x = (string)floor($x); $r = decbin($x); if (strlen($r) == 32) { // Two's Complement $r = substr($r, -10); - } elseif (strlen($r) > 11) { + } elseif (strlen($r) >= 11) { return Functions::NAN(); } @@ -1341,7 +1350,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The decimal integer you want to convert. If number is negative, + * @param string $x The decimal integer you want to convert. If number is negative, * places is ignored and DEC2HEX returns a 10-character (40-bit) * hexadecimal number in which the most significant bit is the sign * bit. The remaining 39 bits are magnitude bits. Negative numbers @@ -1351,7 +1360,7 @@ class Engineering * If number is nonnumeric, DEC2HEX returns the #VALUE! error value. * If DEC2HEX requires more than places characters, it returns the * #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, DEC2HEX uses + * @param integer $places The number of characters to use. If places is omitted, DEC2HEX uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1361,25 +1370,25 @@ class Engineering */ public static function DECTOHEX($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; + $x = (int)$x; } else { return Functions::VALUE(); } } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) { return Functions::VALUE(); } - $x = (string) floor($x); + $x = (string)floor($x); $r = strtoupper(dechex($x)); if (strlen($r) == 8) { // Two's Complement - $r = 'FF'.$r; + $r = 'FF' . $r; } return self::nbrConversionFormat($r, $places); @@ -1396,7 +1405,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The decimal integer you want to convert. If number is negative, + * @param string $x The decimal integer you want to convert. If number is negative, * places is ignored and DEC2OCT returns a 10-character (30-bit) * octal number in which the most significant bit is the sign bit. * The remaining 29 bits are magnitude bits. Negative numbers are @@ -1406,7 +1415,7 @@ class Engineering * If number is nonnumeric, DEC2OCT returns the #VALUE! error value. * If DEC2OCT requires more than places characters, it returns the * #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, DEC2OCT uses + * @param integer $places The number of characters to use. If places is omitted, DEC2OCT uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1416,21 +1425,22 @@ class Engineering */ public static function DECTOOCT($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $xorig = $x; + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; + $x = (int)$x; } else { return Functions::VALUE(); } } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) { return Functions::VALUE(); } - $x = (string) floor($x); + $x = (string)floor($x); $r = decoct($x); if (strlen($r) == 11) { // Two's Complement @@ -1451,20 +1461,17 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x the hexadecimal number you want to convert. Number cannot - * contain more than 10 characters. The most significant bit of - * number is the sign bit (40th bit from the right). The remaining - * 9 bits are magnitude bits. Negative numbers are represented - * using two's-complement notation. - * If number is negative, HEX2BIN ignores places and returns a - * 10-character binary number. - * If number is negative, it cannot be less than FFFFFFFE00, and - * if number is positive, it cannot be greater than 1FF. - * If number is not a valid hexadecimal number, HEX2BIN returns - * the #NUM! error value. - * If HEX2BIN requires more than places characters, it returns - * the #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, + * @param string $x the hexadecimal number you want to convert. + * Number cannot contain more than 10 characters. + * The most significant bit of number is the sign bit (40th bit from the right). + * The remaining 9 bits are magnitude bits. + * Negative numbers are represented using two's-complement notation. + * If number is negative, HEX2BIN ignores places and returns a 10-character binary number. + * If number is negative, it cannot be less than FFFFFFFE00, + * and if number is positive, it cannot be greater than 1FF. + * If number is not a valid hexadecimal number, HEX2BIN returns the #NUM! error value. + * If HEX2BIN requires more than places characters, it returns the #NUM! error value. + * @param integer $places The number of characters to use. If places is omitted, * HEX2BIN uses the minimum number of characters necessary. Places * is useful for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1474,18 +1481,20 @@ class Engineering */ public static function HEXTOBIN($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { return Functions::VALUE(); } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) { return Functions::NAN(); } + if (hexdec($x) > 0x1FF) { + return Functions::NAN(); + } $binVal = decbin(hexdec($x)); - return substr(self::nbrConversionFormat($binVal, $places), -10); } @@ -1500,7 +1509,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The hexadecimal number you want to convert. This number cannot + * @param string $x The hexadecimal number you want to convert. This number cannot * contain more than 10 characters (40 bits). The most significant * bit of number is the sign bit. The remaining 39 bits are magnitude * bits. Negative numbers are represented using two's-complement @@ -1511,16 +1520,26 @@ class Engineering */ public static function HEXTODEC($x) { - $x = Functions::flattenSingleValue($x); + $x = Functions::flattenSingleValue($x); if (is_bool($x)) { return Functions::VALUE(); } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) { return Functions::NAN(); } - return hexdec($x); + $binX = ''; + foreach (str_split($x) as $char) { + $binX .= str_pad(hex2bin($char), 3, '0', STR_PAD_LEFT); + } + if (strlen($binX) == 40 && $binX[0] == '1') { + for ($i = 0; $i < 40; $i++) { + $binX[$i] = ($binX[$i] == '1' ? '0' : '1'); + } + return (bindec($binX) + 1) * -1; + } + return bindec($binX); } @@ -1534,7 +1553,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The hexadecimal number you want to convert. Number cannot + * @param string $x The hexadecimal number you want to convert. Number cannot * contain more than 10 characters. The most significant bit of * number is the sign bit. The remaining 39 bits are magnitude * bits. Negative numbers are represented using two's-complement @@ -1547,7 +1566,7 @@ class Engineering * the #NUM! error value. * If HEX2OCT requires more than places characters, it returns * the #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, HEX2OCT + * @param integer $places The number of characters to use. If places is omitted, HEX2OCT * uses the minimum number of characters necessary. Places is * useful for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1558,20 +1577,20 @@ class Engineering */ public static function HEXTOOCT($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { return Functions::VALUE(); } - $x = (string) $x; + $x = (string)$x; if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) { return Functions::NAN(); } $octVal = decoct(hexdec($x)); return self::nbrConversionFormat($octVal, $places); - } // function HEXTOOCT() + } /** @@ -1584,7 +1603,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The octal number you want to convert. Number may not + * @param string $x The octal number you want to convert. Number may not * contain more than 10 characters. The most significant * bit of number is the sign bit. The remaining 29 bits * are magnitude bits. Negative numbers are represented @@ -1597,7 +1616,7 @@ class Engineering * the #NUM! error value. * If OCT2BIN requires more than places characters, it * returns the #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, + * @param integer $places The number of characters to use. If places is omitted, * OCT2BIN uses the minimum number of characters necessary. * Places is useful for padding the return value with * leading 0s (zeros). @@ -1610,13 +1629,13 @@ class Engineering */ public static function OCTTOBIN($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { return Functions::VALUE(); } - $x = (string) $x; + $x = (string)$x; if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) { return Functions::NAN(); } @@ -1636,7 +1655,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The octal number you want to convert. Number may not contain + * @param string $x The octal number you want to convert. Number may not contain * more than 10 octal characters (30 bits). The most significant * bit of number is the sign bit. The remaining 29 bits are * magnitude bits. Negative numbers are represented using @@ -1647,19 +1666,28 @@ class Engineering */ public static function OCTTODEC($x) { - $x = Functions::flattenSingleValue($x); + $x = Functions::flattenSingleValue($x); if (is_bool($x)) { return Functions::VALUE(); } - $x = (string) $x; + $x = (string)$x; if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) { return Functions::NAN(); } - return octdec($x); + $binX = ''; + foreach (str_split($x) as $char) { + $binX .= str_pad(decbin((int)$char), 3, '0', STR_PAD_LEFT); + } + if (strlen($binX) == 30 && $binX[0] == '1') { + for ($i = 0; $i < 30; $i++) { + $binX[$i] = ($binX[$i] == '1' ? '0' : '1'); + } + return (bindec($binX) + 1) * -1; + } + return bindec($binX); } - /** * OCTTOHEX * @@ -1670,7 +1698,7 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $x The octal number you want to convert. Number may not contain + * @param string $x The octal number you want to convert. Number may not contain * more than 10 octal characters (30 bits). The most significant * bit of number is the sign bit. The remaining 29 bits are * magnitude bits. Negative numbers are represented using @@ -1681,7 +1709,7 @@ class Engineering * #NUM! error value. * If OCT2HEX requires more than places characters, it returns * the #NUM! error value. - * @param integer $places The number of characters to use. If places is omitted, OCT2HEX + * @param integer $places The number of characters to use. If places is omitted, OCT2HEX * uses the minimum number of characters necessary. Places is useful * for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -1691,17 +1719,17 @@ class Engineering */ public static function OCTTOHEX($x, $places = null) { - $x = Functions::flattenSingleValue($x); - $places = Functions::flattenSingleValue($places); + $x = Functions::flattenSingleValue($x); + $places = Functions::flattenSingleValue($places); if (is_bool($x)) { return Functions::VALUE(); } - $x = (string) $x; + $x = (string)$x; if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) { return Functions::NAN(); } - $hexVal = strtoupper(dechex(octdec($x))); + $hexVal = strtoupper(dechex(self::OCTTODEC($x))); return self::nbrConversionFormat($hexVal, $places); } @@ -1717,46 +1745,47 @@ class Engineering * * @access public * @category Engineering Functions - * @param float $realNumber The real coefficient of the complex number. - * @param float $imaginary The imaginary coefficient of the complex number. - * @param string $suffix The suffix for the imaginary component of the complex number. + * @param float $realNumber The real coefficient of the complex number. + * @param float $imaginary The imaginary coefficient of the complex number. + * @param string $suffix The suffix for the imaginary component of the complex number. * If omitted, the suffix is assumed to be "i". * @return string */ public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i') { $realNumber = (is_null($realNumber)) ? 0.0 : Functions::flattenSingleValue($realNumber); - $imaginary = (is_null($imaginary)) ? 0.0 : Functions::flattenSingleValue($imaginary); - $suffix = (is_null($suffix)) ? 'i' : Functions::flattenSingleValue($suffix); + $imaginary = (is_null($imaginary)) ? 0.0 : Functions::flattenSingleValue($imaginary); + $suffix = (is_null($suffix)) ? 'i' : Functions::flattenSingleValue($suffix); if (((is_numeric($realNumber)) && (is_numeric($imaginary))) && - (($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))) { - $realNumber = (float) $realNumber; - $imaginary = (float) $imaginary; + (($suffix == 'i') || ($suffix == 'j') || ($suffix == '')) + ) { + $realNumber = (float)$realNumber; + $imaginary = (float)$imaginary; if ($suffix == '') { $suffix = 'i'; } if ($realNumber == 0.0) { if ($imaginary == 0.0) { - return (string) '0'; + return (string)'0'; } elseif ($imaginary == 1.0) { - return (string) $suffix; + return (string)$suffix; } elseif ($imaginary == -1.0) { - return (string) '-'.$suffix; + return (string)'-' . $suffix; } - return (string) $imaginary.$suffix; + return (string)$imaginary . $suffix; } elseif ($imaginary == 0.0) { - return (string) $realNumber; + return (string)$realNumber; } elseif ($imaginary == 1.0) { - return (string) $realNumber.'+'.$suffix; + return (string)$realNumber . '+' . $suffix; } elseif ($imaginary == -1.0) { - return (string) $realNumber.'-'.$suffix; + return (string)$realNumber . '-' . $suffix; } if ($imaginary > 0) { - $imaginary = (string) '+'.$imaginary; + $imaginary = (string)'+' . $imaginary; } - return (string) $realNumber.$imaginary.$suffix; + return (string)$realNumber . $imaginary . $suffix; } return Functions::VALUE(); @@ -1773,13 +1802,13 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $complexNumber The complex number for which you want the imaginary + * @param string $complexNumber The complex number for which you want the imaginary * coefficient. * @return float */ public static function IMAGINARY($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); return $parsedComplex['imaginary']; @@ -1796,12 +1825,12 @@ class Engineering * * @access public * @category Engineering Functions - * @param string $complexNumber The complex number for which you want the real coefficient. + * @param string $complexNumber The complex number for which you want the real coefficient. * @return float */ public static function IMREAL($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); return $parsedComplex['real']; @@ -1816,7 +1845,7 @@ class Engineering * Excel Function: * IMABS(complexNumber) * - * @param string $complexNumber The complex number for which you want the absolute value. + * @param string $complexNumber The complex number for which you want the absolute value. * @return float */ public static function IMABS($complexNumber) @@ -1841,12 +1870,12 @@ class Engineering * Excel Function: * IMARGUMENT(complexNumber) * - * @param string $complexNumber The complex number for which you want the argument theta. + * @param string $complexNumber The complex number for which you want the argument theta. * @return float */ public static function IMARGUMENT($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); @@ -1876,12 +1905,12 @@ class Engineering * Excel Function: * IMCONJUGATE(complexNumber) * - * @param string $complexNumber The complex number for which you want the conjugate. + * @param string $complexNumber The complex number for which you want the conjugate. * @return string */ public static function IMCONJUGATE($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); @@ -1907,12 +1936,12 @@ class Engineering * Excel Function: * IMCOS(complexNumber) * - * @param string $complexNumber The complex number for which you want the cosine. + * @param string $complexNumber The complex number for which you want the cosine. * @return string|float */ public static function IMCOS($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); @@ -1938,12 +1967,12 @@ class Engineering * Excel Function: * IMSIN(complexNumber) * - * @param string $complexNumber The complex number for which you want the sine. + * @param string $complexNumber The complex number for which you want the sine. * @return string|float */ public static function IMSIN($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); @@ -1967,12 +1996,12 @@ class Engineering * Excel Function: * IMSQRT(complexNumber) * - * @param string $complexNumber The complex number for which you want the square root. + * @param string $complexNumber The complex number for which you want the square root. * @return string */ public static function IMSQRT($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); @@ -1997,12 +2026,12 @@ class Engineering * Excel Function: * IMLN(complexNumber) * - * @param string $complexNumber The complex number for which you want the natural logarithm. + * @param string $complexNumber The complex number for which you want the natural logarithm. * @return string */ public static function IMLN($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); @@ -2029,7 +2058,7 @@ class Engineering * Excel Function: * IMLOG10(complexNumber) * - * @param string $complexNumber The complex number for which you want the common logarithm. + * @param string $complexNumber The complex number for which you want the common logarithm. * @return string */ public static function IMLOG10($complexNumber) @@ -2056,12 +2085,12 @@ class Engineering * Excel Function: * IMLOG2(complexNumber) * - * @param string $complexNumber The complex number for which you want the base-2 logarithm. + * @param string $complexNumber The complex number for which you want the base-2 logarithm. * @return string */ public static function IMLOG2($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + $complexNumber = Functions::flattenSingleValue($complexNumber); $parsedComplex = self::parseComplex($complexNumber); @@ -2083,7 +2112,7 @@ class Engineering * Excel Function: * IMEXP(complexNumber) * - * @param string $complexNumber The complex number for which you want the exponential. + * @param string $complexNumber The complex number for which you want the exponential. * @return string */ public static function IMEXP($complexNumber) @@ -2116,14 +2145,14 @@ class Engineering * Excel Function: * IMPOWER(complexNumber,realNumber) * - * @param string $complexNumber The complex number you want to raise to a power. - * @param float $realNumber The power to which you want to raise the complex number. + * @param string $complexNumber The complex number you want to raise to a power. + * @param float $realNumber The power to which you want to raise the complex number. * @return string */ public static function IMPOWER($complexNumber, $realNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $realNumber = Functions::flattenSingleValue($realNumber); + $realNumber = Functions::flattenSingleValue($realNumber); if (!is_numeric($realNumber)) { return Functions::VALUE(); @@ -2152,20 +2181,21 @@ class Engineering * Excel Function: * IMDIV(complexDividend,complexDivisor) * - * @param string $complexDividend The complex numerator or dividend. - * @param string $complexDivisor The complex denominator or divisor. + * @param string $complexDividend The complex numerator or dividend. + * @param string $complexDivisor The complex denominator or divisor. * @return string */ public static function IMDIV($complexDividend, $complexDivisor) { - $complexDividend = Functions::flattenSingleValue($complexDividend); - $complexDivisor = Functions::flattenSingleValue($complexDivisor); + $complexDividend = Functions::flattenSingleValue($complexDividend); + $complexDivisor = Functions::flattenSingleValue($complexDivisor); $parsedComplexDividend = self::parseComplex($complexDividend); $parsedComplexDivisor = self::parseComplex($complexDivisor); if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') && - ($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix'])) { + ($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix']) + ) { return Functions::NAN(); } if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) { @@ -2180,9 +2210,9 @@ class Engineering $i = $d2 / $d3; if ($i > 0.0) { - return self::cleanComplex($r.'+'.$i.$parsedComplexDivisor['suffix']); + return self::cleanComplex($r . '+' . $i . $parsedComplexDivisor['suffix']); } elseif ($i < 0.0) { - return self::cleanComplex($r.$i.$parsedComplexDivisor['suffix']); + return self::cleanComplex($r . $i . $parsedComplexDivisor['suffix']); } else { return $r; } @@ -2197,20 +2227,21 @@ class Engineering * Excel Function: * IMSUB(complexNumber1,complexNumber2) * - * @param string $complexNumber1 The complex number from which to subtract complexNumber2. - * @param string $complexNumber2 The complex number to subtract from complexNumber1. + * @param string $complexNumber1 The complex number from which to subtract complexNumber2. + * @param string $complexNumber2 The complex number to subtract from complexNumber1. * @return string */ public static function IMSUB($complexNumber1, $complexNumber2) { - $complexNumber1 = Functions::flattenSingleValue($complexNumber1); - $complexNumber2 = Functions::flattenSingleValue($complexNumber2); + $complexNumber1 = Functions::flattenSingleValue($complexNumber1); + $complexNumber2 = Functions::flattenSingleValue($complexNumber2); $parsedComplex1 = self::parseComplex($complexNumber1); $parsedComplex2 = self::parseComplex($complexNumber2); if ((($parsedComplex1['suffix'] != '') && ($parsedComplex2['suffix'] != '')) && - ($parsedComplex1['suffix'] != $parsedComplex2['suffix'])) { + ($parsedComplex1['suffix'] != $parsedComplex2['suffix']) + ) { return Functions::NAN(); } elseif (($parsedComplex1['suffix'] == '') && ($parsedComplex2['suffix'] != '')) { $parsedComplex1['suffix'] = $parsedComplex2['suffix']; @@ -2231,7 +2262,7 @@ class Engineering * Excel Function: * IMSUM(complexNumber[,complexNumber[,...]]) * - * @param string $complexNumber,... Series of complex numbers to add + * @param string $complexNumber,... Series of complex numbers to add * @return string */ public static function IMSUM() @@ -2270,7 +2301,7 @@ class Engineering * Excel Function: * IMPRODUCT(complexNumber[,complexNumber[,...]]) * - * @param string $complexNumber,... Series of complex numbers to multiply + * @param string $complexNumber,... Series of complex numbers to multiply * @return string */ public static function IMPRODUCT() @@ -2312,16 +2343,16 @@ class Engineering * Excel Function: * DELTA(a[,b]) * - * @param float $a The first number. - * @param float $b The second number. If omitted, b is assumed to be zero. - * @return int + * @param float $a The first number. + * @param float $b The second number. If omitted, b is assumed to be zero. + * @return int */ public static function DELTA($a, $b = 0) { $a = Functions::flattenSingleValue($a); $b = Functions::flattenSingleValue($b); - return (int) ($a == $b); + return (int)($a == $b); } @@ -2335,17 +2366,17 @@ class Engineering * Use this function to filter a set of values. For example, by summing several GESTEP * functions you calculate the count of values that exceed a threshold. * - * @param float $number The value to test against step. - * @param float $step The threshold value. + * @param float $number The value to test against step. + * @param float $step The threshold value. * If you omit a value for step, GESTEP uses zero. - * @return int + * @return int */ public static function GESTEP($number, $step = 0) { - $number = Functions::flattenSingleValue($number); - $step = Functions::flattenSingleValue($step); + $number = Functions::flattenSingleValue($number); + $step = Functions::flattenSingleValue($step); - return (int) ($number >= $step); + return (int)($number >= $step); } @@ -2390,15 +2421,15 @@ class Engineering * Excel Function: * ERF(lower[,upper]) * - * @param float $lower lower bound for integrating ERF - * @param float $upper upper bound for integrating ERF. + * @param float $lower lower bound for integrating ERF + * @param float $upper upper bound for integrating ERF. * If omitted, ERF integrates between zero and lower_limit - * @return float + * @return float */ public static function ERF($lower, $upper = null) { - $lower = Functions::flattenSingleValue($lower); - $upper = Functions::flattenSingleValue($upper); + $lower = Functions::flattenSingleValue($lower); + $upper = Functions::flattenSingleValue($upper); if (is_numeric($lower)) { if (is_null($upper)) { @@ -2458,8 +2489,8 @@ class Engineering * Excel Function: * ERFC(x) * - * @param float $x The lower bound for integrating ERFC - * @return float + * @param float $x The lower bound for integrating ERFC + * @return float */ public static function ERFC($x) { @@ -2476,7 +2507,7 @@ class Engineering * getConversionGroups * Returns a list of the different conversion groups for UOM conversions * - * @return array + * @return array */ public static function getConversionGroups() { @@ -2492,8 +2523,8 @@ class Engineering * getConversionGroupUnits * Returns an array of units of measure, for a specified conversion group, or for all groups * - * @param string $group The group whose units of measure you want to retrieve - * @return array + * @param string $group The group whose units of measure you want to retrieve + * @return array */ public static function getConversionGroupUnits($group = null) { @@ -2510,8 +2541,8 @@ class Engineering /** * getConversionGroupUnitDetails * - * @param string $group The group whose units of measure you want to retrieve - * @return array + * @param string $group The group whose units of measure you want to retrieve + * @return array */ public static function getConversionGroupUnitDetails($group = null) { @@ -2519,7 +2550,7 @@ class Engineering foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) { if ((is_null($group)) || ($conversionGroup['Group'] == $group)) { $conversionGroups[$conversionGroup['Group']][] = array( - 'unit' => $conversionUnit, + 'unit' => $conversionUnit, 'description' => $conversionGroup['Unit Name'] ); } @@ -2532,7 +2563,7 @@ class Engineering * getConversionMultipliers * Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM() * - * @return array of mixed + * @return array of mixed */ public static function getConversionMultipliers() { @@ -2550,17 +2581,17 @@ class Engineering * Excel Function: * CONVERT(value,fromUOM,toUOM) * - * @param float $value The value in fromUOM to convert. - * @param string $fromUOM The units for value. - * @param string $toUOM The units for the result. + * @param float $value The value in fromUOM to convert. + * @param string $fromUOM The units for value. + * @param string $toUOM The units for the result. * - * @return float + * @return float */ public static function CONVERTUOM($value, $fromUOM, $toUOM) { - $value = Functions::flattenSingleValue($value); + $value = Functions::flattenSingleValue($value); $fromUOM = Functions::flattenSingleValue($fromUOM); - $toUOM = Functions::flattenSingleValue($toUOM); + $toUOM = Functions::flattenSingleValue($toUOM); if (!is_numeric($value)) { return Functions::VALUE(); @@ -2621,11 +2652,13 @@ class Engineering return $value; } } elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) && - (($toUOM == 'K') || ($toUOM == 'kel'))) { - return $value; + (($toUOM == 'K') || ($toUOM == 'kel')) + ) { + return $value; } elseif ((($fromUOM == 'C') || ($fromUOM == 'cel')) && - (($toUOM == 'C') || ($toUOM == 'cel'))) { - return $value; + (($toUOM == 'C') || ($toUOM == 'cel')) + ) { + return $value; } if (($toUOM == 'F') || ($toUOM == 'fah')) { if (($fromUOM == 'K') || ($fromUOM == 'kel')) { diff --git a/src/PhpSpreadsheet/Calculation/TextData.php b/src/PhpSpreadsheet/Calculation/TextData.php index 7950fe47..6c625193 100644 --- a/src/PhpSpreadsheet/Calculation/TextData.php +++ b/src/PhpSpreadsheet/Calculation/TextData.php @@ -375,6 +375,9 @@ class TextData $value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); } + if (empty($chars)) { + return ''; + } if (function_exists('mb_substr')) { return mb_substr($value, --$start, $chars, 'UTF-8'); } else { diff --git a/src/PhpSpreadsheet/Shared/Date.php b/src/PhpSpreadsheet/Shared/Date.php index 3c1cdeba..7ae7ce68 100644 --- a/src/PhpSpreadsheet/Shared/Date.php +++ b/src/PhpSpreadsheet/Shared/Date.php @@ -137,7 +137,7 @@ class Date $hours = round($dateValue * 24); $mins = round($dateValue * 1440) - round($hours * 60); $secs = round($dateValue * 86400) - round($hours * 3600) - round($mins * 60); - $returnValue = (integer) gmmktime($hours, $mins, $secs); + $returnValue = (integer) gmmktime($hours , $mins, $secs); } $timezoneAdjustment = ($adjustToTimezone) ? diff --git a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php index 32946d98..0a03575d 100644 --- a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php +++ b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php @@ -64,7 +64,7 @@ class ChainedBlockStream * @param string &$openedPath absolute path of the opened stream (out parameter) * @return bool true on success */ - public function stream_open($path, $mode, $options, &$openedPath) + public function stream_open($path, $mode, $options, &$openedPath) // @codingStandardsIgnoreLine { if ($mode != 'r') { if ($options & STREAM_REPORT_ERRORS) { @@ -118,7 +118,7 @@ class ChainedBlockStream * Implements support for fclose(). * */ - public function stream_close() + public function stream_close() // @codingStandardsIgnoreLine { $this->ole = null; unset($GLOBALS['_OLE_INSTANCES']); @@ -130,7 +130,7 @@ class ChainedBlockStream * @param int $count maximum number of bytes to read * @return string */ - public function stream_read($count) + public function stream_read($count) // @codingStandardsIgnoreLine { if ($this->stream_eof()) { return false; @@ -145,7 +145,7 @@ class ChainedBlockStream * * @return bool TRUE if the file pointer is at EOF; otherwise FALSE */ - public function stream_eof() + public function stream_eof() // @codingStandardsIgnoreLine { return $this->pos >= strlen($this->data); } @@ -156,7 +156,7 @@ class ChainedBlockStream * * @return int */ - public function stream_tell() + public function stream_tell() // @codingStandardsIgnoreLine { return $this->pos; } @@ -168,7 +168,7 @@ class ChainedBlockStream * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END * @return bool */ - public function stream_seek($offset, $whence) + public function stream_seek($offset, $whence) // @codingStandardsIgnoreLine { if ($whence == SEEK_SET && $offset >= 0) { $this->pos = $offset; @@ -187,7 +187,7 @@ class ChainedBlockStream * "size". * @return array */ - public function stream_stat() + public function stream_stat() // @codingStandardsIgnoreLine { return array( 'size' => strlen($this->data), diff --git a/src/PhpSpreadsheet/Shared/StringHelper.php b/src/PhpSpreadsheet/Shared/StringHelper.php index 730bba3d..0cb0404a 100644 --- a/src/PhpSpreadsheet/Shared/StringHelper.php +++ b/src/PhpSpreadsheet/Shared/StringHelper.php @@ -759,15 +759,18 @@ class StringHelper */ public static function getCurrencyCode() { - if (!isset(self::$currencyCode)) { - $localeconv = localeconv(); - self::$currencyCode = ($localeconv['currency_symbol'] != '') - ? $localeconv['currency_symbol'] : $localeconv['int_curr_symbol']; - - if (self::$currencyCode == '') { - // Default to $ - self::$currencyCode = '$'; - } + if (!empty(self::$currencyCode)) { + return self::$currencyCode; + } + self::$currencyCode = '$'; + $localeconv = localeconv(); + if (!empty($localeconv['currency_symbol'])) { + self::$currencyCode = $localeconv['currency_symbol']; + return self::$currencyCode; + } + if (!empty($localeconv['int_curr_symbol'])) { + self::$currencyCode = $localeconv['int_curr_symbol']; + return self::$currencyCode; } return self::$currencyCode; } diff --git a/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php b/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php index 32590290..8a6df8b8 100644 --- a/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php +++ b/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php @@ -76,7 +76,7 @@ class ZipStreamWrapper * @return bool true on success * @throws \PHPExcel\Reader\Exception */ - public function stream_open($path, $mode, $options, &$opened_path) + public function stream_open($path, $mode, $options, &$opened_path) // @codingStandardsIgnoreLine { // Check for mode if ($mode{0} != 'r') { @@ -113,7 +113,7 @@ class ZipStreamWrapper * * @return boolean */ - public function url_stat() + public function url_stat() // @codingStandardsIgnoreLine { return $this->statName($this->fileNameInArchive); } @@ -123,7 +123,7 @@ class ZipStreamWrapper * * @return boolean */ - public function stream_stat() + public function stream_stat() // @codingStandardsIgnoreLine { return $this->archive->statName($this->fileNameInArchive); } @@ -134,7 +134,7 @@ class ZipStreamWrapper * @param int $count maximum number of bytes to read * @return string */ - public function stream_read($count) + public function stream_read($count) // @codingStandardsIgnoreLine { $ret = substr($this->data, $this->position, $count); $this->position += strlen($ret); @@ -147,7 +147,7 @@ class ZipStreamWrapper * * @return int */ - public function stream_tell() + public function stream_tell() // @codingStandardsIgnoreLine { return $this->position; } @@ -157,7 +157,7 @@ class ZipStreamWrapper * * @return bool */ - public function stream_eof() + public function stream_eof() // @codingStandardsIgnoreLine { return $this->position >= strlen($this->data); } @@ -169,7 +169,7 @@ class ZipStreamWrapper * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END * @return bool */ - public function stream_seek($offset, $whence) + public function stream_seek($offset, $whence) // @codingStandardsIgnoreLine { switch ($whence) { case SEEK_SET: diff --git a/unitTests/Classes/src/Calculation/DateTimeTest.php b/unitTests/Classes/src/Calculation/DateTimeTest.php index 8c6244b2..70e0e629 100644 --- a/unitTests/Classes/src/Calculation/DateTimeTest.php +++ b/unitTests/Classes/src/Calculation/DateTimeTest.php @@ -23,7 +23,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerDATE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/DATE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/DATE.data'); } public function testDATEtoPHP() @@ -76,7 +76,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerDATEVALUE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data'); } public function testDATEVALUEtoPHP() @@ -113,7 +113,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerYEAR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data'); } /** @@ -129,7 +129,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerMONTH() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data'); } /** @@ -145,7 +145,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerWEEKNUM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data'); } /** @@ -161,7 +161,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerWEEKDAY() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data'); } /** @@ -177,7 +177,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerDAY() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/DAY.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/DAY.data'); } /** @@ -193,7 +193,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerTIME() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/TIME.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/TIME.data'); } public function testTIMEtoPHP() @@ -230,7 +230,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerTIMEVALUE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data'); } public function testTIMEVALUEtoPHP() @@ -267,7 +267,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerHOUR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data'); } /** @@ -283,7 +283,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerMINUTE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data'); } /** @@ -299,7 +299,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerSECOND() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data'); } /** @@ -315,7 +315,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerNETWORKDAYS() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data'); } /** @@ -331,7 +331,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerWORKDAY() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data'); } /** @@ -347,7 +347,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerEDATE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data'); } public function testEDATEtoPHP() @@ -384,7 +384,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerEOMONTH() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data'); } public function testEOMONTHtoPHP() @@ -421,7 +421,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerDATEDIF() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data'); } /** @@ -437,7 +437,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerDAYS360() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data'); } /** @@ -453,6 +453,6 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase public function providerYEARFRAC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data'); } } diff --git a/unitTests/Classes/src/Calculation/EngineeringTest.php b/unitTests/Classes/src/Calculation/EngineeringTest.php index 64beeebe..830a40e4 100644 --- a/unitTests/Classes/src/Calculation/EngineeringTest.php +++ b/unitTests/Classes/src/Calculation/EngineeringTest.php @@ -12,11 +12,22 @@ require_once 'testDataFileIterator.php'; class EngineeringTest extends \PHPUnit_Framework_TestCase { + /** + * @var \PhpSpreadhsheet\unitTests\custom\ComplexAssert + */ + protected $complexAssert; + public function setUp() { + $this->complexAssert = new \PhpSpreadhsheet\unitTests\custom\ComplexAssert(); \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } + public function tearDown() + { + $this->complexAssert = null; + } + /** * @dataProvider providerBESSELI */ @@ -30,7 +41,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELI() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/BESSELI.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELI.data'); } /** @@ -46,7 +57,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELJ() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/BESSELJ.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELJ.data'); } /** @@ -62,7 +73,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELK() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/BESSELK.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELK.data'); } /** @@ -78,7 +89,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELY() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/BESSELY.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELY.data'); } /** @@ -94,7 +105,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerCOMPLEX() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/COMPLEX.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/COMPLEX.data'); } /** @@ -110,7 +121,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMAGINARY() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMAGINARY.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMAGINARY.data'); } /** @@ -126,7 +137,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMREAL() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMREAL.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMREAL.data'); } /** @@ -142,7 +153,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMABS() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMABS.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMABS.data'); } /** @@ -158,7 +169,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMARGUMENT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMARGUMENT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMARGUMENT.data'); } /** @@ -169,13 +180,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMCONJUGATE'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMCONJUGATE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMCONJUGATE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMCONJUGATE.data'); } /** @@ -186,13 +196,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMCOS'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMCOS() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMCOS.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMCOS.data'); } /** @@ -203,13 +212,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMDIV'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMDIV() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMDIV.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMDIV.data'); } /** @@ -220,13 +228,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMEXP'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMEXP() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMEXP.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMEXP.data'); } /** @@ -237,13 +244,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMLN'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMLN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMLN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLN.data'); } /** @@ -254,13 +260,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMLOG2'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMLOG2() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG2.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLOG2.data'); } /** @@ -271,13 +276,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMLOG10'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMLOG10() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG10.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLOG10.data'); } /** @@ -288,13 +292,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMPOWER'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMPOWER() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMPOWER.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMPOWER.data'); } /** @@ -305,13 +308,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMPRODUCT'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMPRODUCT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMPRODUCT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMPRODUCT.data'); } /** @@ -322,13 +324,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSIN'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSIN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMSIN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSIN.data'); } /** @@ -339,13 +340,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSQRT'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSQRT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMSQRT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSQRT.data'); } /** @@ -356,13 +356,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSUB'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSUB() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMSUB.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSUB.data'); } /** @@ -373,13 +372,12 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSUM'), $args); - $complexAssert = new \PhpSpreadhsheet\unitTests\custom\complexAssert(); - $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); + $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSUM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/IMSUM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSUM.data'); } /** @@ -395,7 +393,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerERF() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/ERF.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/ERF.data'); } /** @@ -411,7 +409,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerERFC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/ERFC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/ERFC.data'); } /** @@ -427,7 +425,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBIN2DEC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/BIN2DEC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2DEC.data'); } /** @@ -443,7 +441,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBIN2HEX() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/BIN2HEX.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2HEX.data'); } /** @@ -459,7 +457,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBIN2OCT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/BIN2OCT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2OCT.data'); } /** @@ -475,7 +473,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDEC2BIN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/DEC2BIN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2BIN.data'); } /** @@ -491,7 +489,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDEC2HEX() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/DEC2HEX.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2HEX.data'); } /** @@ -507,7 +505,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDEC2OCT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/DEC2OCT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2OCT.data'); } /** @@ -523,7 +521,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerHEX2BIN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/HEX2BIN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2BIN.data'); } /** @@ -539,7 +537,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerHEX2DEC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/HEX2DEC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2DEC.data'); } /** @@ -555,7 +553,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerHEX2OCT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/HEX2OCT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2OCT.data'); } /** @@ -571,7 +569,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerOCT2BIN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/OCT2BIN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2BIN.data'); } /** @@ -587,7 +585,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerOCT2DEC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/OCT2DEC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2DEC.data'); } /** @@ -603,7 +601,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerOCT2HEX() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/OCT2HEX.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2HEX.data'); } /** @@ -619,7 +617,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDELTA() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/DELTA.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DELTA.data'); } /** @@ -635,7 +633,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerGESTEP() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/GESTEP.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/GESTEP.data'); } public function testGetConversionGroups() @@ -675,6 +673,6 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerCONVERTUOM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data'); } } diff --git a/unitTests/Classes/src/Calculation/FinancialTest.php b/unitTests/Classes/src/Calculation/FinancialTest.php index a142e9b0..9f0ef150 100644 --- a/unitTests/Classes/src/Calculation/FinancialTest.php +++ b/unitTests/Classes/src/Calculation/FinancialTest.php @@ -25,7 +25,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerACCRINT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/ACCRINT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/ACCRINT.data'); } /** @@ -41,7 +41,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerACCRINTM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/ACCRINTM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/ACCRINTM.data'); } /** @@ -57,7 +57,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerAMORDEGRC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/AMORDEGRC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/AMORDEGRC.data'); } /** @@ -73,7 +73,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerAMORLINC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/AMORLINC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/AMORLINC.data'); } /** @@ -89,7 +89,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCOUPDAYBS() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYBS.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/COUPDAYBS.data'); } /** @@ -105,7 +105,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCOUPDAYS() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYS.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/COUPDAYS.data'); } /** @@ -121,7 +121,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCOUPDAYSNC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYSNC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/COUPDAYSNC.data'); } /** @@ -137,7 +137,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCOUPNCD() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/COUPNCD.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/COUPNCD.data'); } /** @@ -153,7 +153,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCOUPNUM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/COUPNUM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/COUPNUM.data'); } /** @@ -169,7 +169,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCOUPPCD() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/COUPPCD.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/COUPPCD.data'); } /** @@ -185,7 +185,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCUMIPMT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/CUMIPMT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/CUMIPMT.data'); } /** @@ -201,7 +201,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerCUMPRINC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/CUMPRINC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/CUMPRINC.data'); } /** @@ -217,7 +217,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerDB() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/DB.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/DB.data'); } /** @@ -233,7 +233,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerDDB() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/DDB.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/DDB.data'); } /** @@ -249,7 +249,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerDISC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/DISC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/DISC.data'); } /** @@ -265,7 +265,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerDOLLARDE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/DOLLARDE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/DOLLARDE.data'); } /** @@ -281,7 +281,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerDOLLARFR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/DOLLARFR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/DOLLARFR.data'); } /** @@ -297,7 +297,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerEFFECT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/EFFECT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/EFFECT.data'); } /** @@ -313,7 +313,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerFV() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/FV.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/FV.data'); } /** @@ -329,7 +329,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerFVSCHEDULE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/FVSCHEDULE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/FVSCHEDULE.data'); } /** @@ -345,7 +345,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerINTRATE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/INTRATE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/INTRATE.data'); } /** @@ -361,7 +361,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerIPMT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/IPMT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/IPMT.data'); } /** @@ -377,7 +377,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerIRR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/IRR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/IRR.data'); } /** @@ -393,7 +393,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerISPMT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/ISPMT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/ISPMT.data'); } /** @@ -409,7 +409,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerMIRR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/MIRR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/MIRR.data'); } /** @@ -425,7 +425,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerNOMINAL() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/NOMINAL.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/NOMINAL.data'); } /** @@ -441,7 +441,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerNPER() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/NPER.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/NPER.data'); } /** @@ -457,7 +457,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerNPV() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/NPV.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/NPV.data'); } /** @@ -473,7 +473,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerPRICE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/PRICE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/PRICE.data'); } /** @@ -489,7 +489,7 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerRATE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/RATE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/RATE.data'); } /** @@ -505,6 +505,6 @@ class FinancialTest extends \PHPUnit_Framework_TestCase public function providerXIRR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Financial/XIRR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Financial/XIRR.data'); } } diff --git a/unitTests/Classes/src/Calculation/FunctionsTest.php b/unitTests/Classes/src/Calculation/FunctionsTest.php index 6ab38b78..76050456 100644 --- a/unitTests/Classes/src/Calculation/FunctionsTest.php +++ b/unitTests/Classes/src/Calculation/FunctionsTest.php @@ -73,7 +73,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsBlank() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data'); } /** @@ -89,7 +89,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsErr() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data'); } /** @@ -105,7 +105,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsError() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data'); } /** @@ -121,7 +121,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerErrorType() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data'); } /** @@ -137,7 +137,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsLogical() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data'); } /** @@ -147,13 +147,13 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase { $args = func_get_args(); $expectedResult = array_pop($args); - $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','isError('), $args); + $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','isNa'), $args); $this->assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsNa() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data'); } /** @@ -169,7 +169,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsNumber() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data'); } /** @@ -185,7 +185,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsText() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data'); } /** @@ -201,7 +201,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsNonText() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data'); } /** @@ -217,7 +217,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsEven() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data'); } /** @@ -233,7 +233,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerIsOdd() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data'); } /** @@ -249,7 +249,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerTYPE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/TYPE.data'); } /** @@ -265,6 +265,6 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase public function providerN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Functions/N.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Functions/N.data'); } } diff --git a/unitTests/Classes/src/Calculation/LogicalTest.php b/unitTests/Classes/src/Calculation/LogicalTest.php index 4c53cdf8..4cd533e3 100644 --- a/unitTests/Classes/src/Calculation/LogicalTest.php +++ b/unitTests/Classes/src/Calculation/LogicalTest.php @@ -37,7 +37,7 @@ class LogicalTest extends \PHPUnit_Framework_TestCase public function providerAND() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Logical/AND.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Logical/AND.data'); } /** @@ -53,7 +53,7 @@ class LogicalTest extends \PHPUnit_Framework_TestCase public function providerOR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Logical/OR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Logical/OR.data'); } /** @@ -69,7 +69,7 @@ class LogicalTest extends \PHPUnit_Framework_TestCase public function providerNOT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Logical/NOT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Logical/NOT.data'); } /** @@ -85,7 +85,7 @@ class LogicalTest extends \PHPUnit_Framework_TestCase public function providerIF() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Logical/IF.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Logical/IF.data'); } /** @@ -101,6 +101,6 @@ class LogicalTest extends \PHPUnit_Framework_TestCase public function providerIFERROR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data'); } } diff --git a/unitTests/Classes/src/Calculation/LookupRefTest.php b/unitTests/Classes/src/Calculation/LookupRefTest.php index 6cf3b4e1..7c88cba6 100644 --- a/unitTests/Classes/src/Calculation/LookupRefTest.php +++ b/unitTests/Classes/src/Calculation/LookupRefTest.php @@ -25,7 +25,7 @@ class LookupRefTest extends \PHPUnit_Framework_TestCase public function providerHLOOKUP() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/LookupRef/HLOOKUP.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/LookupRef/HLOOKUP.data'); } /** @@ -41,6 +41,6 @@ class LookupRefTest extends \PHPUnit_Framework_TestCase public function providerVLOOKUP() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/LookupRef/VLOOKUP.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/LookupRef/VLOOKUP.data'); } } diff --git a/unitTests/Classes/src/Calculation/MathTrigTest.php b/unitTests/Classes/src/Calculation/MathTrigTest.php index fa5c7ed2..7aa4bb49 100644 --- a/unitTests/Classes/src/Calculation/MathTrigTest.php +++ b/unitTests/Classes/src/Calculation/MathTrigTest.php @@ -25,7 +25,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerATAN2() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data'); } /** @@ -41,7 +41,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerCEILING() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data'); } /** @@ -57,7 +57,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerCOMBIN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data'); } /** @@ -73,7 +73,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerEVEN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data'); } /** @@ -89,7 +89,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerODD() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data'); } /** @@ -105,7 +105,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerFACT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data'); } /** @@ -121,7 +121,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerFACTDOUBLE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data'); } /** @@ -137,7 +137,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerFLOOR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data'); } /** @@ -153,7 +153,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerGCD() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data'); } /** @@ -169,7 +169,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerLCM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data'); } /** @@ -185,7 +185,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerINT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/INT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/INT.data'); } /** @@ -201,7 +201,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerSIGN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data'); } /** @@ -217,7 +217,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerPOWER() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data'); } /** @@ -233,7 +233,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerLOG() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data'); } /** @@ -249,7 +249,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerMOD() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data'); } /** @@ -265,7 +265,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerMDETERM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data'); } /** @@ -281,7 +281,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerMINVERSE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data'); } /** @@ -297,7 +297,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerMMULT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data'); } /** @@ -313,7 +313,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerMULTINOMIAL() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data'); } /** @@ -331,7 +331,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerMROUND() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data'); } /** @@ -347,7 +347,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerPRODUCT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data'); } /** @@ -363,7 +363,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerQUOTIENT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data'); } /** @@ -379,7 +379,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerROUNDUP() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data'); } /** @@ -395,7 +395,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerROUNDDOWN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data'); } /** @@ -411,7 +411,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerSERIESSUM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data'); } /** @@ -427,7 +427,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerSUMSQ() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data'); } /** @@ -443,7 +443,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerTRUNC() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data'); } /** @@ -459,7 +459,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerROMAN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data'); } /** @@ -475,7 +475,7 @@ class MathTrigTest extends \PHPUnit_Framework_TestCase public function providerSQRTPI() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data'); } /** diff --git a/unitTests/Classes/src/Calculation/TextDataTest.php b/unitTests/Classes/src/Calculation/TextDataTest.php index 8463423d..fad2ae02 100644 --- a/unitTests/Classes/src/Calculation/TextDataTest.php +++ b/unitTests/Classes/src/Calculation/TextDataTest.php @@ -25,7 +25,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerCHAR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/CHAR.data'); } /** @@ -41,7 +41,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerCODE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/CODE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/CODE.data'); } /** @@ -57,7 +57,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerCONCATENATE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data'); } /** @@ -73,7 +73,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerLEFT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/LEFT.data'); } /** @@ -89,7 +89,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerMID() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/MID.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/MID.data'); } /** @@ -105,7 +105,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerRIGHT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data'); } /** @@ -121,7 +121,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerLOWER() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/LOWER.data'); } /** @@ -137,7 +137,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerUPPER() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/UPPER.data'); } /** @@ -153,7 +153,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerPROPER() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/PROPER.data'); } /** @@ -169,7 +169,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerLEN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/LEN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/LEN.data'); } /** @@ -185,7 +185,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerSEARCH() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data'); } /** @@ -201,7 +201,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerFIND() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/FIND.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/FIND.data'); } /** @@ -217,7 +217,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerREPLACE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data'); } /** @@ -233,7 +233,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerSUBSTITUTE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data'); } /** @@ -249,7 +249,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerTRIM() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/TRIM.data'); } /** @@ -265,7 +265,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerCLEAN() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data'); } /** @@ -281,7 +281,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerDOLLAR() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data'); } /** @@ -297,7 +297,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerFIXED() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/FIXED.data'); } /** @@ -313,7 +313,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/T.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/T.data'); } /** @@ -334,7 +334,7 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerTEXT() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/TEXT.data'); } /** @@ -354,6 +354,6 @@ class TextDataTest extends \PHPUnit_Framework_TestCase public function providerVALUE() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Calculation/TextData/VALUE.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/TextData/VALUE.data'); } } diff --git a/unitTests/Classes/src/CalculationTest.php b/unitTests/Classes/src/CalculationTest.php index e81a60f6..1fcb1735 100644 --- a/unitTests/Classes/src/CalculationTest.php +++ b/unitTests/Classes/src/CalculationTest.php @@ -27,6 +27,6 @@ class CalculationTest extends \PHPUnit_Framework_TestCase public function providerBinaryComparisonOperation() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CalculationBinaryComparisonOperation.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CalculationBinaryComparisonOperation.data'); } } diff --git a/unitTests/Classes/src/Cell/DefaultValueBinderTest.php b/unitTests/Classes/src/Cell/DefaultValueBinderTest.php index 363c8a8f..4f219c40 100644 --- a/unitTests/Classes/src/Cell/DefaultValueBinderTest.php +++ b/unitTests/Classes/src/Cell/DefaultValueBinderTest.php @@ -70,7 +70,7 @@ class DefaultValueBinderTest extends \PHPUnit_Framework_TestCase public function providerDataTypeForValue() { - return new \PhpSpreadhsheet\unitTests\testDataFileIteratorJson('rawTestData/Cell/DefaultValueBinder.json'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIteratorJson('rawTestData/Cell/DefaultValueBinder.json'); } public function testDataTypeForRichTextObject() diff --git a/unitTests/Classes/src/CellTest.php b/unitTests/Classes/src/CellTest.php index 7f94a1fb..f4649f16 100644 --- a/unitTests/Classes/src/CellTest.php +++ b/unitTests/Classes/src/CellTest.php @@ -24,7 +24,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerColumnString() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/ColumnString.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/ColumnString.data'); } public function testColumnIndexFromStringTooLong() @@ -66,7 +66,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerColumnIndex() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/ColumnIndex.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/ColumnIndex.data'); } /** @@ -82,7 +82,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerCoordinates() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellCoordinates.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellCoordinates.data'); } public function testCoordinateFromStringWithRangeAddress() @@ -137,7 +137,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerAbsoluteCoordinates() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellAbsoluteCoordinate.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellAbsoluteCoordinate.data'); } public function testAbsoluteCoordinateFromStringWithRangeAddress() @@ -166,7 +166,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerAbsoluteReferences() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellAbsoluteReference.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellAbsoluteReference.data'); } public function testAbsoluteReferenceFromStringWithRangeAddress() @@ -201,7 +201,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerSplitRange() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellSplitRange.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellSplitRange.data'); } /** @@ -217,7 +217,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerBuildRange() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellBuildRange.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellBuildRange.data'); } public function testBuildRangeInvalid() @@ -246,7 +246,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerRangeBoundaries() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellRangeBoundaries.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellRangeBoundaries.data'); } /** @@ -262,7 +262,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerRangeDimension() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellRangeDimension.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellRangeDimension.data'); } /** @@ -278,7 +278,7 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerGetRangeBoundaries() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellGetRangeBoundaries.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellGetRangeBoundaries.data'); } /** @@ -294,6 +294,6 @@ class CellTest extends \PHPUnit_Framework_TestCase public function providerExtractAllCellReferencesInRange() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/CellExtractAllCellReferencesInRange.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/CellExtractAllCellReferencesInRange.data'); } } diff --git a/unitTests/Classes/src/Shared/CodePageTest.php b/unitTests/Classes/src/Shared/CodePageTest.php index 1c3b45fd..98b24ff4 100644 --- a/unitTests/Classes/src/Shared/CodePageTest.php +++ b/unitTests/Classes/src/Shared/CodePageTest.php @@ -19,7 +19,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase public function providerCodePage() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/CodePage.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/CodePage.data'); } public function testNumberToNameWithInvalidCodePage() diff --git a/unitTests/Classes/src/Shared/DateTest.php b/unitTests/Classes/src/Shared/DateTest.php index 6526e4d1..6d701854 100644 --- a/unitTests/Classes/src/Shared/DateTest.php +++ b/unitTests/Classes/src/Shared/DateTest.php @@ -47,7 +47,7 @@ class DateTest extends \PHPUnit_Framework_TestCase public function providerDateTimeExcelToPHP1900() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900.data'); } /** @@ -68,7 +68,7 @@ class DateTest extends \PHPUnit_Framework_TestCase public function providerDateTimePHPToExcel1900() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/DateTimePHPToExcel1900.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/DateTimePHPToExcel1900.data'); } /** @@ -89,7 +89,7 @@ class DateTest extends \PHPUnit_Framework_TestCase public function providerDateTimeFormattedPHPToExcel1900() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/DateTimeFormattedPHPToExcel1900.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/DateTimeFormattedPHPToExcel1900.data'); } /** @@ -113,7 +113,7 @@ class DateTest extends \PHPUnit_Framework_TestCase public function providerDateTimeExcelToPHP1904() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1904.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1904.data'); } /** @@ -134,7 +134,7 @@ class DateTest extends \PHPUnit_Framework_TestCase public function providerDateTimePHPToExcel1904() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/DateTimePHPToExcel1904.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/DateTimePHPToExcel1904.data'); } /** @@ -150,7 +150,7 @@ class DateTest extends \PHPUnit_Framework_TestCase public function providerIsDateTimeFormatCode() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/DateTimeFormatCodes.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/DateTimeFormatCodes.data'); } /** @@ -174,6 +174,6 @@ class DateTest extends \PHPUnit_Framework_TestCase public function providerDateTimeExcelToPHP1900Timezone() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900Timezone.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900Timezone.data'); } } diff --git a/unitTests/Classes/src/Shared/FontTest.php b/unitTests/Classes/src/Shared/FontTest.php index 233715e5..08c0c2c5 100644 --- a/unitTests/Classes/src/Shared/FontTest.php +++ b/unitTests/Classes/src/Shared/FontTest.php @@ -48,7 +48,7 @@ class FontTest extends \PHPUnit_Framework_TestCase public function providerFontSizeToPixels() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/FontSizeToPixels.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/FontSizeToPixels.data'); } /** @@ -64,7 +64,7 @@ class FontTest extends \PHPUnit_Framework_TestCase public function providerInchSizeToPixels() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/InchSizeToPixels.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/InchSizeToPixels.data'); } /** @@ -80,6 +80,6 @@ class FontTest extends \PHPUnit_Framework_TestCase public function providerCentimeterSizeToPixels() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/CentimeterSizeToPixels.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/CentimeterSizeToPixels.data'); } } diff --git a/unitTests/Classes/src/Shared/PasswordHasherTest.php b/unitTests/Classes/src/Shared/PasswordHasherTest.php index fb4ee600..5d6d0c90 100644 --- a/unitTests/Classes/src/Shared/PasswordHasherTest.php +++ b/unitTests/Classes/src/Shared/PasswordHasherTest.php @@ -19,6 +19,6 @@ class PasswordHasherTest extends \PHPUnit_Framework_TestCase public function providerHashPassword() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Shared/PasswordHashes.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Shared/PasswordHashes.data'); } } diff --git a/unitTests/Classes/src/Shared/StringTest.php b/unitTests/Classes/src/Shared/StringTest.php index 34038608..dad8ffad 100644 --- a/unitTests/Classes/src/Shared/StringTest.php +++ b/unitTests/Classes/src/Shared/StringTest.php @@ -6,6 +6,14 @@ require_once 'testDataFileIterator.php'; class StringTest extends \PHPUnit_Framework_TestCase { + public function setUp() + { + parent::setUp(); + + // Reset Currency Code + call_user_func(array('\PHPExcel\Shared\StringHelper','setCurrencyCode'), null); + } + public function testGetIsMbStringEnabled() { $result = call_user_func(array('\PHPExcel\Shared\StringHelper','getIsMbstringEnabled')); @@ -30,7 +38,7 @@ class StringTest extends \PHPUnit_Framework_TestCase public function testSetDecimalSeparator() { $expectedResult = ','; - $result = call_user_func(array('\PHPExcel\Shared\StringHelper','setDecimalSeparator'), $expectedResult); + call_user_func(array('\PHPExcel\Shared\StringHelper','setDecimalSeparator'), $expectedResult); $result = call_user_func(array('\PHPExcel\Shared\StringHelper','getDecimalSeparator')); $this->assertEquals($expectedResult, $result); @@ -48,7 +56,7 @@ class StringTest extends \PHPUnit_Framework_TestCase public function testSetThousandsSeparator() { $expectedResult = ' '; - $result = call_user_func(array('\PHPExcel\Shared\StringHelper','setThousandsSeparator'), $expectedResult); + call_user_func(array('\PHPExcel\Shared\StringHelper','setThousandsSeparator'), $expectedResult); $result = call_user_func(array('\PHPExcel\Shared\StringHelper','getThousandsSeparator')); $this->assertEquals($expectedResult, $result); @@ -57,8 +65,7 @@ class StringTest extends \PHPUnit_Framework_TestCase public function testGetCurrencyCode() { $localeconv = localeconv(); - - $expectedResult = (!empty($localeconv['currency_symbol'])) ? $localeconv['currency_symbol'] : '$'; + $expectedResult = (!empty($localeconv['currency_symbol']) ? $localeconv['currency_symbol'] : (!empty($localeconv['int_curr_symbol']) ? $localeconv['int_curr_symbol']: '$')); $result = call_user_func(array('\PHPExcel\Shared\StringHelper','getCurrencyCode')); $this->assertEquals($expectedResult, $result); } @@ -66,7 +73,7 @@ class StringTest extends \PHPUnit_Framework_TestCase public function testSetCurrencyCode() { $expectedResult = '£'; - $result = call_user_func(array('\PHPExcel\Shared\StringHelper','setCurrencyCode'), $expectedResult); + call_user_func(array('\PHPExcel\Shared\StringHelper','setCurrencyCode'), $expectedResult); $result = call_user_func(array('\PHPExcel\Shared\StringHelper','getCurrencyCode')); $this->assertEquals($expectedResult, $result); diff --git a/unitTests/Classes/src/Style/ColorTest.php b/unitTests/Classes/src/Style/ColorTest.php index b17c4f57..3b3ccaa8 100644 --- a/unitTests/Classes/src/Style/ColorTest.php +++ b/unitTests/Classes/src/Style/ColorTest.php @@ -20,7 +20,7 @@ class ColorTest extends \PHPUnit_Framework_TestCase public function providerColorGetRed() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Style/ColorGetRed.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Style/ColorGetRed.data'); } /** @@ -36,7 +36,7 @@ class ColorTest extends \PHPUnit_Framework_TestCase public function providerColorGetGreen() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Style/ColorGetGreen.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Style/ColorGetGreen.data'); } /** @@ -52,7 +52,7 @@ class ColorTest extends \PHPUnit_Framework_TestCase public function providerColorGetBlue() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Style/ColorGetBlue.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Style/ColorGetBlue.data'); } /** @@ -67,6 +67,6 @@ class ColorTest extends \PHPUnit_Framework_TestCase public function providerColorChangeBrightness() { - return new \PhpSpreadhsheet\unitTests\testDataFileIteratorJson('rawTestData/Style/ColorChangeBrightness.json'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIteratorJson('rawTestData/Style/ColorChangeBrightness.json'); } } diff --git a/unitTests/Classes/src/Style/NumberFormatDateTest.php b/unitTests/Classes/src/Style/NumberFormatDateTest.php index 013fedd4..537db59e 100644 --- a/unitTests/Classes/src/Style/NumberFormatDateTest.php +++ b/unitTests/Classes/src/Style/NumberFormatDateTest.php @@ -26,6 +26,6 @@ class NumberFormatDateTest extends \PHPUnit_Framework_TestCase public function providerNumberFormat() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Style/NumberFormatDates.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Style/NumberFormatDates.data'); } } diff --git a/unitTests/Classes/src/Style/NumberFormatTest.php b/unitTests/Classes/src/Style/NumberFormatTest.php index 599fde15..fe3895d5 100644 --- a/unitTests/Classes/src/Style/NumberFormatTest.php +++ b/unitTests/Classes/src/Style/NumberFormatTest.php @@ -26,6 +26,6 @@ class NumberFormatTest extends \PHPUnit_Framework_TestCase public function providerNumberFormat() { - return new \PhpSpreadhsheet\unitTests\testDataFileIterator('rawTestData/Style/NumberFormat.data'); + return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Style/NumberFormat.data'); } } diff --git a/unitTests/custom/complexAssert.php b/unitTests/custom/complexAssert.php index fb31d25c..4ce64e38 100644 --- a/unitTests/custom/complexAssert.php +++ b/unitTests/custom/complexAssert.php @@ -4,7 +4,7 @@ namespace PhpSpreadhsheet\unitTests\custom; include_once dirname(__FILE__).'/Complex.php'; -class complexAssert +class ComplexAssert { private $_errorMessage = ''; diff --git a/unitTests/rawTestData/Calculation/Engineering/DEC2OCT.data b/unitTests/rawTestData/Calculation/Engineering/DEC2OCT.data index 8a6b3f74..bf82a171 100644 --- a/unitTests/rawTestData/Calculation/Engineering/DEC2OCT.data +++ b/unitTests/rawTestData/Calculation/Engineering/DEC2OCT.data @@ -4,7 +4,7 @@ "12345", "30071" "123456789", "726746425" "123.45", "173" -"58, 3, "072" +"58", 3, "072" "0", "0" "3579A", "#VALUE!" // Invalid decimal TRUE, "#VALUE!" // Non string diff --git a/unitTests/testDataFileIterator.php b/unitTests/testDataFileIterator.php index f021d49b..932039d7 100644 --- a/unitTests/testDataFileIterator.php +++ b/unitTests/testDataFileIterator.php @@ -2,7 +2,7 @@ namespace PhpSpreadhsheet\unitTests; -class testDataFileIterator implements \Iterator +class TestDataFileIterator implements \Iterator { protected $file; protected $key = 0; diff --git a/unitTests/testDataFileIteratorJson.php b/unitTests/testDataFileIteratorJson.php index 3f3b262e..7e85dc4b 100644 --- a/unitTests/testDataFileIteratorJson.php +++ b/unitTests/testDataFileIteratorJson.php @@ -2,7 +2,7 @@ namespace PhpSpreadhsheet\unitTests; -class testDataFileIteratorJson implements \Iterator +class TestDataFileIteratorJson implements \Iterator { protected $file; protected $key = 0;