From 00657c906e436bac1a25ae9bce33a7044adbb3e1 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 14 Aug 2016 02:22:11 +0900 Subject: [PATCH] Reorganize unit tests All code for unit tests is now under the `PhpSpreadsheet\Tests` namespace which is autoloaded via composer mechanism. So there is no need for `require()` anymore. Also, tests were moved in `tests/` folder and phpunit should be executed from the project root folder. This is to conform to the de facto standard, notably in use in phpunit itself. --- .gitattributes | 2 +- .gitignore | 2 +- .travis.yml | 4 +- composer.json | 7 +- phpunit-cc.xml | 42 + phpunit.xml | 34 + .../Calculation/DateTimeTest.php | 6 +- .../Calculation/EngineeringTest.php | 91 +- .../Calculation/FinancialTest.php | 66 +- .../Calculation/FunctionsTest.php | 30 +- .../Calculation/LogicalTest.php | 14 +- .../Calculation/LookupRefTest.php | 8 +- .../Calculation/MathTrigTest.php | 62 +- .../Calculation/TextDataTest.php | 46 +- .../PhpSpreadsheet}/CalculationTest.php | 4 +- .../Cell/AdvancedValueBinderTest.php | 2 +- .../PhpSpreadsheet}/Cell/DataTypeTest.php | 2 +- .../Cell/DefaultValueBinderTest.php | 6 +- .../PhpSpreadsheet}/Cell/HyperlinkTest.php | 2 +- .../src => tests/PhpSpreadsheet}/CellTest.php | 24 +- .../Chart/DataSeriesValuesTest.php | 4 +- .../PhpSpreadsheet}/Chart/LayoutTest.php | 2 +- .../PhpSpreadsheet}/Chart/LegendTest.php | 2 +- .../PhpSpreadsheet/Custom}/Complex.php | 2 +- .../PhpSpreadsheet/Custom/ComplexAssert.php | 4 +- .../Reader/XEEValidatorTest.php | 2 +- .../PhpSpreadsheet}/ReferenceHelperTest.php | 0 .../PhpSpreadsheet}/SettingsTest.php | 0 .../PhpSpreadsheet}/Shared/CodePageTest.php | 6 +- .../PhpSpreadsheet}/Shared/DateTest.php | 18 +- .../PhpSpreadsheet}/Shared/FileTest.php | 4 +- .../PhpSpreadsheet}/Shared/FontTest.php | 10 +- .../Shared/PasswordHasherTest.php | 6 +- .../PhpSpreadsheet}/Shared/StringTest.php | 4 +- .../PhpSpreadsheet}/Shared/TimeZoneTest.php | 2 +- .../PhpSpreadsheet}/Style/ColorTest.php | 13 +- .../Style/NumberFormatDateTest.php | 6 +- .../Style/NumberFormatTest.php | 6 +- .../PhpSpreadsheet/TestDataFileIterator.php | 2 +- .../TestDataFileIteratorJson.php | 2 +- .../Worksheet/AutoFilter/Column/RuleTest.php | 2 +- .../Worksheet/AutoFilter/ColumnTest.php | 2 +- .../Worksheet/AutoFilterTest.php | 4 +- .../Worksheet/CellCollectionTest.php | 2 +- .../Worksheet/ColumnCellIteratorTest.php | 8 +- .../Worksheet/ColumnIteratorTest.php | 8 +- .../Worksheet/RowCellIteratorTest.php | 2 +- .../Worksheet/RowIteratorTest.php | 2 +- .../Worksheet/WorksheetColumnTest.php | 2 +- .../Worksheet/WorksheetRowTest.php | 2 +- {unitTests => tests}/bootstrap.php | 2 - .../Calculation/DateTime/DATE.data | 158 +-- .../Calculation/DateTime/DATEDIF.data | 192 +-- .../Calculation/DateTime/DATEVALUE.data | 132 +- .../rawTestData/Calculation/DateTime/DAY.data | 16 +- .../Calculation/DateTime/DAYS360.data | 68 +- .../Calculation/DateTime/EDATE.data | 30 +- .../Calculation/DateTime/EOMONTH.data | 34 +- .../Calculation/DateTime/HOUR.data | 24 +- .../Calculation/DateTime/MINUTE.data | 24 +- .../Calculation/DateTime/MONTH.data | 24 +- .../Calculation/DateTime/NETWORKDAYS.data | 36 +- .../Calculation/DateTime/SECOND.data | 24 +- .../Calculation/DateTime/TIME.data | 44 +- .../Calculation/DateTime/TIMEVALUE.data | 26 +- .../Calculation/DateTime/WEEKDAY.data | 54 +- .../Calculation/DateTime/WEEKNUM.data | 14 +- .../Calculation/DateTime/WORKDAY.data | 26 +- .../Calculation/DateTime/YEAR.data | 22 +- .../Calculation/DateTime/YEARFRAC.data | 130 +- .../Calculation/Engineering/BESSELI.data | 0 .../Calculation/Engineering/BESSELJ.data | 0 .../Calculation/Engineering/BESSELK.data | 0 .../Calculation/Engineering/BESSELY.data | 0 .../Calculation/Engineering/BIN2DEC.data | 20 +- .../Calculation/Engineering/BIN2HEX.data | 28 +- .../Calculation/Engineering/BIN2OCT.data | 30 +- .../Calculation/Engineering/COMPLEX.data | 1094 ++++++++--------- .../Calculation/Engineering/CONVERTUOM.data | 48 +- .../Calculation/Engineering/DEC2BIN.data | 36 +- .../Calculation/Engineering/DEC2HEX.data | 30 +- .../Calculation/Engineering/DEC2OCT.data | 24 +- .../Calculation/Engineering/DELTA.data | 50 +- .../Calculation/Engineering/ERF.data | 248 ++-- .../Calculation/Engineering/ERFC.data | 82 +- .../Calculation/Engineering/GESTEP.data | 162 +-- .../Calculation/Engineering/HEX2BIN.data | 32 +- .../Calculation/Engineering/HEX2DEC.data | 30 +- .../Calculation/Engineering/HEX2OCT.data | 26 +- .../Calculation/Engineering/IMABS.data | 54 +- .../Calculation/Engineering/IMAGINARY.data | 60 +- .../Calculation/Engineering/IMARGUMENT.data | 52 +- .../Calculation/Engineering/IMCONJUGATE.data | 52 +- .../Calculation/Engineering/IMCOS.data | 54 +- .../Calculation/Engineering/IMDIV.data | 40 +- .../Calculation/Engineering/IMEXP.data | 0 .../Calculation/Engineering/IMLN.data | 54 +- .../Calculation/Engineering/IMLOG10.data | 54 +- .../Calculation/Engineering/IMLOG2.data | 54 +- .../Calculation/Engineering/IMPOWER.data | 36 +- .../Calculation/Engineering/IMPRODUCT.data | 30 +- .../Calculation/Engineering/IMREAL.data | 60 +- .../Calculation/Engineering/IMSIN.data | 54 +- .../Calculation/Engineering/IMSQRT.data | 56 +- .../Calculation/Engineering/IMSUB.data | 20 +- .../Calculation/Engineering/IMSUM.data | 20 +- .../Calculation/Engineering/OCT2BIN.data | 26 +- .../Calculation/Engineering/OCT2DEC.data | 18 +- .../Calculation/Engineering/OCT2HEX.data | 18 +- .../Calculation/Financial/ACCRINT.data | 16 +- .../Calculation/Financial/ACCRINTM.data | 12 +- .../Calculation/Financial/AMORDEGRC.data | 6 +- .../Calculation/Financial/AMORLINC.data | 6 +- .../Calculation/Financial/COUPDAYBS.data | 12 +- .../Calculation/Financial/COUPDAYS.data | 12 +- .../Calculation/Financial/COUPDAYSNC.data | 12 +- .../Calculation/Financial/COUPNCD.data | 12 +- .../Calculation/Financial/COUPNUM.data | 14 +- .../Calculation/Financial/COUPPCD.data | 12 +- .../Calculation/Financial/CUMIPMT.data | 20 +- .../Calculation/Financial/CUMPRINC.data | 20 +- .../rawTestData/Calculation/Financial/DB.data | 34 +- .../Calculation/Financial/DDB.data | 32 +- .../Calculation/Financial/DISC.data | 12 +- .../Calculation/Financial/DOLLARDE.data | 20 +- .../Calculation/Financial/DOLLARFR.data | 20 +- .../Calculation/Financial/EFFECT.data | 12 +- .../rawTestData/Calculation/Financial/FV.data | 18 +- .../Calculation/Financial/FVSCHEDULE.data | 8 +- .../Calculation/Financial/INTRATE.data | 12 +- .../Calculation/Financial/IPMT.data | 18 +- .../Calculation/Financial/IRR.data | 12 +- .../Calculation/Financial/ISPMT.data | 10 +- .../Calculation/Financial/MIRR.data | 12 +- .../Calculation/Financial/NOMINAL.data | 12 +- .../Calculation/Financial/NPER.data | 20 +- .../Calculation/Financial/NPV.data | 10 +- .../Calculation/Financial/PRICE.data | 20 +- .../Calculation/Financial/RATE.data | 22 +- .../Calculation/Financial/XIRR.data | 8 +- .../Calculation/Functions/ERROR_TYPE.data | 28 +- .../Calculation/Functions/IS_BLANK.data | 32 +- .../Calculation/Functions/IS_ERR.data | 32 +- .../Calculation/Functions/IS_ERROR.data | 32 +- .../Calculation/Functions/IS_EVEN.data | 40 +- .../Calculation/Functions/IS_LOGICAL.data | 32 +- .../Calculation/Functions/IS_NA.data | 32 +- .../Calculation/Functions/IS_NONTEXT.data | 32 +- .../Calculation/Functions/IS_NUMBER.data | 32 +- .../Calculation/Functions/IS_ODD.data | 40 +- .../Calculation/Functions/IS_TEXT.data | 32 +- .../rawTestData/Calculation/Functions/N.data | 40 +- .../Calculation/Functions/TYPE.data | 32 +- .../rawTestData/Calculation/Logical/AND.data | 42 +- .../rawTestData/Calculation/Logical/IF.data | 14 +- .../Calculation/Logical/IFERROR.data | 16 +- .../rawTestData/Calculation/Logical/NOT.data | 40 +- .../rawTestData/Calculation/Logical/OR.data | 40 +- .../Calculation/LookupRef/HLOOKUP.data | 0 .../Calculation/LookupRef/VLOOKUP.data | 0 .../Calculation/MathTrig/ATAN2.data | 34 +- .../Calculation/MathTrig/CEILING.data | 42 +- .../Calculation/MathTrig/COMBIN.data | 50 +- .../Calculation/MathTrig/EVEN.data | 34 +- .../Calculation/MathTrig/FACT.data | 20 +- .../Calculation/MathTrig/FACTDOUBLE.data | 16 +- .../Calculation/MathTrig/FLOOR.data | 22 +- .../rawTestData/Calculation/MathTrig/GCD.data | 40 +- .../rawTestData/Calculation/MathTrig/INT.data | 38 +- .../rawTestData/Calculation/MathTrig/LCM.data | 24 +- .../rawTestData/Calculation/MathTrig/LOG.data | 140 +-- .../Calculation/MathTrig/MDETERM.data | 28 +- .../Calculation/MathTrig/MINVERSE.data | 28 +- .../Calculation/MathTrig/MMULT.data | 24 +- .../rawTestData/Calculation/MathTrig/MOD.data | 18 +- .../Calculation/MathTrig/MROUND.data | 22 +- .../Calculation/MathTrig/MULTINOMIAL.data | 4 +- .../rawTestData/Calculation/MathTrig/ODD.data | 26 +- .../Calculation/MathTrig/POWER.data | 162 +-- .../Calculation/MathTrig/PRODUCT.data | 14 +- .../Calculation/MathTrig/QUOTIENT.data | 12 +- .../Calculation/MathTrig/ROMAN.data | 10 +- .../Calculation/MathTrig/ROUNDDOWN.data | 28 +- .../Calculation/MathTrig/ROUNDUP.data | 28 +- .../Calculation/MathTrig/SERIESSUM.data | 4 +- .../Calculation/MathTrig/SIGN.data | 26 +- .../Calculation/MathTrig/SQRTPI.data | 30 +- .../Calculation/MathTrig/SUMSQ.data | 14 +- .../Calculation/MathTrig/TRUNC.data | 38 +- .../Calculation/TextData/CHAR.data | 0 .../Calculation/TextData/CLEAN.data | 0 .../Calculation/TextData/CODE.data | 0 .../Calculation/TextData/CONCATENATE.data | 0 .../Calculation/TextData/DOLLAR.data | 0 .../Calculation/TextData/FIND.data | 0 .../Calculation/TextData/FIXED.data | 0 .../Calculation/TextData/LEFT.data | 0 .../rawTestData/Calculation/TextData/LEN.data | 0 .../Calculation/TextData/LOWER.data | 0 .../rawTestData/Calculation/TextData/MID.data | 0 .../Calculation/TextData/PROPER.data | 0 .../Calculation/TextData/REPLACE.data | 0 .../Calculation/TextData/RIGHT.data | 0 .../Calculation/TextData/SEARCH.data | 0 .../Calculation/TextData/SUBSTITUTE.data | 0 .../rawTestData/Calculation/TextData/T.data | 0 .../Calculation/TextData/TEXT.data | 0 .../Calculation/TextData/TRIM.data | 0 .../Calculation/TextData/UPPER.data | 0 .../Calculation/TextData/VALUE.data | 0 .../CalculationBinaryComparisonOperation.data | 0 .../rawTestData/Cell/DefaultValueBinder.json | 0 .../rawTestData/CellAbsoluteCoordinate.data | 0 .../rawTestData/CellAbsoluteReference.data | 0 .../rawTestData/CellBuildRange.data | 0 .../rawTestData/CellCoordinates.data | 0 .../CellExtractAllCellReferencesInRange.data | 0 .../rawTestData/CellGetRangeBoundaries.data | 0 .../rawTestData/CellRangeBoundaries.data | 0 .../rawTestData/CellRangeDimension.data | 0 .../rawTestData/CellSplitRange.data | 0 .../rawTestData/ColumnIndex.data | 0 .../rawTestData/ColumnString.data | 0 .../Reader/XEETestInvalidUTF-16.xml | Bin .../Reader/XEETestInvalidUTF-16BE.xml | Bin .../Reader/XEETestInvalidUTF-16LE.xml | Bin .../Reader/XEETestInvalidUTF-8.xml | 0 .../rawTestData/Reader/XEETestValidUTF-16.xml | Bin .../Reader/XEETestValidUTF-16BE.xml | Bin .../Reader/XEETestValidUTF-16LE.xml | Bin .../rawTestData/Reader/XEETestValidUTF-8.xml | 0 .../Shared/CentimeterSizeToPixels.data | 0 .../rawTestData/Shared/CodePage.data | 0 .../Shared/DateTimeExcelToPHP1900.data | 0 .../DateTimeExcelToPHP1900Timezone.data | 0 .../Shared/DateTimeExcelToPHP1904.data | 0 .../Shared/DateTimeFormatCodes.data | 0 .../DateTimeFormattedPHPToExcel1900.data | 0 .../Shared/DateTimePHPToExcel1900.data | 0 .../Shared/DateTimePHPToExcel1904.data | 0 .../rawTestData/Shared/FontSizeToPixels.data | 0 .../rawTestData/Shared/InchSizeToPixels.data | 0 .../rawTestData/Shared/PasswordHashes.data | 0 .../Style/ColorChangeBrightness.json | 0 .../rawTestData/Style/ColorGetBlue.data | 0 .../rawTestData/Style/ColorGetGreen.data | 0 .../rawTestData/Style/ColorGetRed.data | 0 .../rawTestData/Style/NumberFormat.data | 0 .../rawTestData/Style/NumberFormatDates.data | 0 unitTests/phpunit-cc.xml | 42 - unitTests/phpunit.xml | 34 - 251 files changed, 3243 insertions(+), 3278 deletions(-) create mode 100644 phpunit-cc.xml create mode 100644 phpunit.xml rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/DateTimeTest.php (98%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/EngineeringTest.php (77%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/FinancialTest.php (77%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/FunctionsTest.php (80%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/LogicalTest.php (78%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/LookupRefTest.php (77%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/MathTrigTest.php (79%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Calculation/TextDataTest.php (77%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/CalculationTest.php (86%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Cell/AdvancedValueBinderTest.php (98%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Cell/DataTypeTest.php (93%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Cell/DefaultValueBinderTest.php (92%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Cell/HyperlinkTest.php (98%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/CellTest.php (87%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Chart/DataSeriesValuesTest.php (93%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Chart/LayoutTest.php (94%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Chart/LegendTest.php (99%) rename {unitTests/custom => tests/PhpSpreadsheet/Custom}/Complex.php (99%) rename unitTests/custom/complexAssert.php => tests/PhpSpreadsheet/Custom/ComplexAssert.php (95%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Reader/XEEValidatorTest.php (97%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/ReferenceHelperTest.php (100%) rename {unitTests/classes/src => tests/PhpSpreadsheet}/SettingsTest.php (100%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Shared/CodePageTest.php (88%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Shared/DateTest.php (84%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Shared/FileTest.php (92%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Shared/FontTest.php (84%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Shared/PasswordHasherTest.php (73%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Shared/StringTest.php (97%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Shared/TimeZoneTest.php (95%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Style/ColorTest.php (74%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Style/NumberFormatDateTest.php (78%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Style/NumberFormatTest.php (78%) rename unitTests/testDataFileIterator.php => tests/PhpSpreadsheet/TestDataFileIterator.php (99%) rename unitTests/testDataFileIteratorJson.php => tests/PhpSpreadsheet/TestDataFileIteratorJson.php (97%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/AutoFilter/Column/RuleTest.php (98%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/AutoFilter/ColumnTest.php (99%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/AutoFilterTest.php (99%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/CellCollectionTest.php (94%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/ColumnCellIteratorTest.php (96%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/ColumnIteratorTest.php (96%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/RowCellIteratorTest.php (98%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/RowIteratorTest.php (98%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/WorksheetColumnTest.php (96%) rename {unitTests/Classes/src => tests/PhpSpreadsheet}/Worksheet/WorksheetRowTest.php (96%) rename {unitTests => tests}/bootstrap.php (97%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/DATE.data (96%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/DATEDIF.data (97%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/DATEVALUE.data (98%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/DAY.data (93%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/DAYS360.data (97%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/EDATE.data (95%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/EOMONTH.data (95%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/HOUR.data (93%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/MINUTE.data (93%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/MONTH.data (92%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/NETWORKDAYS.data (97%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/SECOND.data (94%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/TIME.data (96%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/TIMEVALUE.data (96%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/WEEKDAY.data (94%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/WEEKNUM.data (95%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/WORKDAY.data (97%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/YEAR.data (93%) rename {unitTests => tests}/rawTestData/Calculation/DateTime/YEARFRAC.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/BESSELI.data (100%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/BESSELJ.data (100%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/BESSELK.data (100%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/BESSELY.data (100%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/BIN2DEC.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/BIN2HEX.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/BIN2OCT.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/COMPLEX.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/CONVERTUOM.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/DEC2BIN.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/DEC2HEX.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/DEC2OCT.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/DELTA.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/ERF.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/ERFC.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/GESTEP.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/HEX2BIN.data (91%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/HEX2DEC.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/HEX2OCT.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMABS.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMAGINARY.data (93%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMARGUMENT.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMCONJUGATE.data (94%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMCOS.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMDIV.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMEXP.data (100%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMLN.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMLOG10.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMLOG2.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMPOWER.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMPRODUCT.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMREAL.data (93%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMSIN.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMSQRT.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMSUB.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/IMSUM.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/OCT2BIN.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/OCT2DEC.data (94%) rename {unitTests => tests}/rawTestData/Calculation/Engineering/OCT2HEX.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Financial/ACCRINT.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/ACCRINTM.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/AMORDEGRC.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/AMORLINC.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/COUPDAYBS.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/COUPDAYS.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/COUPDAYSNC.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/COUPNCD.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/COUPNUM.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/COUPPCD.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/CUMIPMT.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/CUMPRINC.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/DB.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/DDB.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/DISC.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/DOLLARDE.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Financial/DOLLARFR.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Financial/EFFECT.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Financial/FV.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/FVSCHEDULE.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/INTRATE.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/IPMT.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/IRR.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/ISPMT.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/MIRR.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/NOMINAL.data (96%) rename {unitTests => tests}/rawTestData/Calculation/Financial/NPER.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/NPV.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/PRICE.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Financial/RATE.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Financial/XIRR.data (98%) rename {unitTests => tests}/rawTestData/Calculation/Functions/ERROR_TYPE.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_BLANK.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_ERR.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_ERROR.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_EVEN.data (93%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_LOGICAL.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_NA.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_NONTEXT.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_NUMBER.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_ODD.data (93%) rename {unitTests => tests}/rawTestData/Calculation/Functions/IS_TEXT.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Functions/N.data (93%) rename {unitTests => tests}/rawTestData/Calculation/Functions/TYPE.data (91%) rename {unitTests => tests}/rawTestData/Calculation/Logical/AND.data (97%) rename {unitTests => tests}/rawTestData/Calculation/Logical/IF.data (94%) rename {unitTests => tests}/rawTestData/Calculation/Logical/IFERROR.data (95%) rename {unitTests => tests}/rawTestData/Calculation/Logical/NOT.data (92%) rename {unitTests => tests}/rawTestData/Calculation/Logical/OR.data (97%) rename {unitTests => tests}/rawTestData/Calculation/LookupRef/HLOOKUP.data (100%) rename {unitTests => tests}/rawTestData/Calculation/LookupRef/VLOOKUP.data (100%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/ATAN2.data (95%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/CEILING.data (94%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/COMBIN.data (93%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/EVEN.data (88%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/FACT.data (89%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/FACTDOUBLE.data (89%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/FLOOR.data (93%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/GCD.data (92%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/INT.data (88%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/LCM.data (93%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/LOG.data (95%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/MDETERM.data (97%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/MINVERSE.data (98%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/MMULT.data (98%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/MOD.data (91%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/MROUND.data (94%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/MULTINOMIAL.data (94%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/ODD.data (88%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/POWER.data (95%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/PRODUCT.data (95%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/QUOTIENT.data (91%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/ROMAN.data (92%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/ROUNDDOWN.data (94%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/ROUNDUP.data (94%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/SERIESSUM.data (96%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/SIGN.data (89%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/SQRTPI.data (95%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/SUMSQ.data (93%) rename {unitTests => tests}/rawTestData/Calculation/MathTrig/TRUNC.data (95%) rename {unitTests => tests}/rawTestData/Calculation/TextData/CHAR.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/CLEAN.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/CODE.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/CONCATENATE.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/DOLLAR.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/FIND.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/FIXED.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/LEFT.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/LEN.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/LOWER.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/MID.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/PROPER.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/REPLACE.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/RIGHT.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/SEARCH.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/SUBSTITUTE.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/T.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/TEXT.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/TRIM.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/UPPER.data (100%) rename {unitTests => tests}/rawTestData/Calculation/TextData/VALUE.data (100%) rename {unitTests => tests}/rawTestData/CalculationBinaryComparisonOperation.data (100%) rename {unitTests => tests}/rawTestData/Cell/DefaultValueBinder.json (100%) rename {unitTests => tests}/rawTestData/CellAbsoluteCoordinate.data (100%) rename {unitTests => tests}/rawTestData/CellAbsoluteReference.data (100%) rename {unitTests => tests}/rawTestData/CellBuildRange.data (100%) rename {unitTests => tests}/rawTestData/CellCoordinates.data (100%) rename {unitTests => tests}/rawTestData/CellExtractAllCellReferencesInRange.data (100%) rename {unitTests => tests}/rawTestData/CellGetRangeBoundaries.data (100%) rename {unitTests => tests}/rawTestData/CellRangeBoundaries.data (100%) rename {unitTests => tests}/rawTestData/CellRangeDimension.data (100%) rename {unitTests => tests}/rawTestData/CellSplitRange.data (100%) rename {unitTests => tests}/rawTestData/ColumnIndex.data (100%) rename {unitTests => tests}/rawTestData/ColumnString.data (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestInvalidUTF-16.xml (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestInvalidUTF-16BE.xml (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestInvalidUTF-16LE.xml (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestInvalidUTF-8.xml (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestValidUTF-16.xml (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestValidUTF-16BE.xml (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestValidUTF-16LE.xml (100%) rename {unitTests => tests}/rawTestData/Reader/XEETestValidUTF-8.xml (100%) rename {unitTests => tests}/rawTestData/Shared/CentimeterSizeToPixels.data (100%) rename {unitTests => tests}/rawTestData/Shared/CodePage.data (100%) rename {unitTests => tests}/rawTestData/Shared/DateTimeExcelToPHP1900.data (100%) rename {unitTests => tests}/rawTestData/Shared/DateTimeExcelToPHP1900Timezone.data (100%) rename {unitTests => tests}/rawTestData/Shared/DateTimeExcelToPHP1904.data (100%) rename {unitTests => tests}/rawTestData/Shared/DateTimeFormatCodes.data (100%) rename {unitTests => tests}/rawTestData/Shared/DateTimeFormattedPHPToExcel1900.data (100%) rename {unitTests => tests}/rawTestData/Shared/DateTimePHPToExcel1900.data (100%) rename {unitTests => tests}/rawTestData/Shared/DateTimePHPToExcel1904.data (100%) rename {unitTests => tests}/rawTestData/Shared/FontSizeToPixels.data (100%) rename {unitTests => tests}/rawTestData/Shared/InchSizeToPixels.data (100%) rename {unitTests => tests}/rawTestData/Shared/PasswordHashes.data (100%) rename {unitTests => tests}/rawTestData/Style/ColorChangeBrightness.json (100%) rename {unitTests => tests}/rawTestData/Style/ColorGetBlue.data (100%) rename {unitTests => tests}/rawTestData/Style/ColorGetGreen.data (100%) rename {unitTests => tests}/rawTestData/Style/ColorGetRed.data (100%) rename {unitTests => tests}/rawTestData/Style/NumberFormat.data (100%) rename {unitTests => tests}/rawTestData/Style/NumberFormatDates.data (100%) delete mode 100644 unitTests/phpunit-cc.xml delete mode 100644 unitTests/phpunit.xml diff --git a/.gitattributes b/.gitattributes index 58182f25..8afa9920 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ /Build export-ignore -/unitTests export-ignore +/tests export-ignore README.md export-ignore diff --git a/.gitignore b/.gitignore index dea03b5e..c3b65f07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ build/PHPExcel.phar -unitTests/codeCoverage +tests/codeCoverage analysis ## IDE support diff --git a/.travis.yml b/.travis.yml index 68dcb08c..bcc21aad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,6 @@ before_script: script: ## PHP_CodeSniffer - - ./vendor/bin/phpcs --report-width=200 --report-summary --report-full src/ unitTests/ --standard=PSR2 -n + - ./vendor/bin/phpcs --report-width=200 --report-summary --report-full src/ tests/ --standard=PSR2 -n ## PHPUnit - - ./vendor/bin/phpunit -c ./unitTests/ + - ./vendor/bin/phpunit diff --git a/composer.json b/composer.json index 243c1e38..4305ae99 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "phpoffice/phpspreadsheet", "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", - "keywords": ["PHP","OpenXML","Excel","xlsx","xls","ods","gnumeric","spreadsheet"], + "keywords": ["PHP", "OpenXML", "Excel", "xlsx", "xls", "ods", "gnumeric", "spreadsheet"], "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", "type": "library", "license": "LGPL-2.1", @@ -45,5 +45,10 @@ "psr-4": { "PHPExcel\\": "src/PhpSpreadsheet" } + }, + "autoload-dev": { + "psr-4": { + "PhpSpreadsheet\\Tests\\": "tests/PhpSpreadsheet" + } } } diff --git a/phpunit-cc.xml b/phpunit-cc.xml new file mode 100644 index 00000000..c7c314f8 --- /dev/null +++ b/phpunit-cc.xml @@ -0,0 +1,42 @@ + + + + + + + ./tests/PhpSpreadsheet + + + + ./src + + ./src/PhpSpreadsheet/Shared/PCLZip + ./src/PhpSpreadsheet/Shared/JAMA + ./src/PhpSpreadsheet/Writer/PDF + + + + + + + + + + diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000..52f6ec5f --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + ./tests/PhpSpreadsheet + + + + ./src + + ./src/PhpSpreadsheet/Shared/PCLZip + ./src/PhpSpreadsheet/Shared/JAMA + ./src/PhpSpreadsheet/Writer/PDF + + + + diff --git a/unitTests/Classes/src/Calculation/DateTimeTest.php b/tests/PhpSpreadsheet/Calculation/DateTimeTest.php similarity index 98% rename from unitTests/Classes/src/Calculation/DateTimeTest.php rename to tests/PhpSpreadsheet/Calculation/DateTimeTest.php index 316f8b3d..9300c604 100644 --- a/unitTests/Classes/src/Calculation/DateTimeTest.php +++ b/tests/PhpSpreadsheet/Calculation/DateTimeTest.php @@ -1,9 +1,11 @@ complexAssert = new \PhpSpreadhsheet\unitTests\custom\ComplexAssert(); + $this->complexAssert = new \PhpSpreadsheet\Tests\Custom\ComplexAssert(); \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } @@ -41,7 +34,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELI() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELI.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELI.data'); } /** @@ -57,7 +50,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELJ() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELJ.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELJ.data'); } /** @@ -73,7 +66,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELK() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELK.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELK.data'); } /** @@ -89,7 +82,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBESSELY() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELY.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/BESSELY.data'); } /** @@ -105,7 +98,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerCOMPLEX() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/COMPLEX.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/COMPLEX.data'); } /** @@ -121,7 +114,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMAGINARY() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMAGINARY.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMAGINARY.data'); } /** @@ -137,7 +130,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMREAL() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMREAL.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMREAL.data'); } /** @@ -153,7 +146,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMABS() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMABS.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMABS.data'); } /** @@ -170,7 +163,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMARGUMENT() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMARGUMENT.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMARGUMENT.data'); } /** @@ -186,7 +179,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMCONJUGATE() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMCONJUGATE.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMCONJUGATE.data'); } /** @@ -202,7 +195,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMCOS() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMCOS.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMCOS.data'); } /** @@ -219,7 +212,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMDIV() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMDIV.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMDIV.data'); } /** @@ -235,7 +228,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMEXP() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMEXP.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMEXP.data'); } /** @@ -251,7 +244,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMLN() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLN.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLN.data'); } /** @@ -267,7 +260,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMLOG2() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLOG2.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLOG2.data'); } /** @@ -283,7 +276,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMLOG10() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLOG10.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMLOG10.data'); } /** @@ -300,7 +293,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMPOWER() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMPOWER.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMPOWER.data'); } /** @@ -316,7 +309,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMPRODUCT() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMPRODUCT.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMPRODUCT.data'); } /** @@ -332,7 +325,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMSIN() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSIN.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSIN.data'); } /** @@ -348,7 +341,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMSQRT() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSQRT.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSQRT.data'); } /** @@ -365,7 +358,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMSUB() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSUB.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSUB.data'); } /** @@ -382,7 +375,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerIMSUM() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSUM.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/IMSUM.data'); } /** @@ -398,7 +391,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerERF() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/ERF.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/ERF.data'); } /** @@ -414,7 +407,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerERFC() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/ERFC.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/ERFC.data'); } /** @@ -430,7 +423,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBIN2DEC() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2DEC.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2DEC.data'); } /** @@ -446,7 +439,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBIN2HEX() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2HEX.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2HEX.data'); } /** @@ -462,7 +455,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerBIN2OCT() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2OCT.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/BIN2OCT.data'); } /** @@ -478,7 +471,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDEC2BIN() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2BIN.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2BIN.data'); } /** @@ -494,7 +487,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDEC2HEX() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2HEX.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2HEX.data'); } /** @@ -510,7 +503,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDEC2OCT() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2OCT.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/DEC2OCT.data'); } /** @@ -526,7 +519,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerHEX2BIN() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2BIN.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2BIN.data'); } /** @@ -542,7 +535,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerHEX2DEC() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2DEC.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2DEC.data'); } /** @@ -558,7 +551,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerHEX2OCT() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2OCT.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/HEX2OCT.data'); } /** @@ -574,7 +567,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerOCT2BIN() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2BIN.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2BIN.data'); } /** @@ -590,7 +583,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerOCT2DEC() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2DEC.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2DEC.data'); } /** @@ -606,7 +599,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerOCT2HEX() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2HEX.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/OCT2HEX.data'); } /** @@ -622,7 +615,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerDELTA() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/DELTA.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/DELTA.data'); } /** @@ -638,7 +631,7 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerGESTEP() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/GESTEP.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/GESTEP.data'); } public function testGetConversionGroups() @@ -678,6 +671,6 @@ class EngineeringTest extends \PHPUnit_Framework_TestCase public function providerCONVERTUOM() { - return new \PhpSpreadhsheet\unitTests\TestDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data'); + return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data'); } } diff --git a/unitTests/Classes/src/Calculation/FinancialTest.php b/tests/PhpSpreadsheet/Calculation/FinancialTest.php similarity index 77% rename from unitTests/Classes/src/Calculation/FinancialTest.php rename to tests/PhpSpreadsheet/Calculation/FinancialTest.php index 12cc3e8f..76dfb6d3 100644 --- a/unitTests/Classes/src/Calculation/FinancialTest.php +++ b/tests/PhpSpreadsheet/Calculation/FinancialTest.php @@ -1,8 +1,6 @@ setDataType('BOOLEAN'); - } catch (Exception $e) { + } catch (\PHPExcel\Exception $e) { $this->assertEquals($e->getMessage(), 'Invalid datatype for chart data series values'); return; } diff --git a/unitTests/Classes/src/Chart/LayoutTest.php b/tests/PhpSpreadsheet/Chart/LayoutTest.php similarity index 94% rename from unitTests/Classes/src/Chart/LayoutTest.php rename to tests/PhpSpreadsheet/Chart/LayoutTest.php index 24351207..c4817e58 100644 --- a/unitTests/Classes/src/Chart/LayoutTest.php +++ b/tests/PhpSpreadsheet/Chart/LayoutTest.php @@ -1,6 +1,6 @@ mockWorksheet, 'A'); $ColumnCellIndexResult = 1; $this->assertEquals($ColumnCellIndexResult, $iterator->key()); - + foreach ($iterator as $key => $ColumnCell) { $this->assertEquals($ColumnCellIndexResult++, $key); $this->assertInstanceOf('\\PHPExcel\\Cell', $ColumnCell); @@ -43,7 +45,7 @@ class ColumnCellIteratorTest extends \PHPUnit_Framework_TestCase $iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4); $ColumnCellIndexResult = 2; $this->assertEquals($ColumnCellIndexResult, $iterator->key()); - + foreach ($iterator as $key => $ColumnCell) { $this->assertEquals($ColumnCellIndexResult++, $key); $this->assertInstanceOf('\\PHPExcel\\Cell', $ColumnCell); diff --git a/unitTests/Classes/src/Worksheet/ColumnIteratorTest.php b/tests/PhpSpreadsheet/Worksheet/ColumnIteratorTest.php similarity index 96% rename from unitTests/Classes/src/Worksheet/ColumnIteratorTest.php rename to tests/PhpSpreadsheet/Worksheet/ColumnIteratorTest.php index 0b4e2bf9..14c23fc3 100644 --- a/unitTests/Classes/src/Worksheet/ColumnIteratorTest.php +++ b/tests/PhpSpreadsheet/Worksheet/ColumnIteratorTest.php @@ -1,6 +1,8 @@ mockWorksheet); $columnIndexResult = 'A'; $this->assertEquals($columnIndexResult, $iterator->key()); - + foreach ($iterator as $key => $column) { $this->assertEquals($columnIndexResult++, $key); $this->assertInstanceOf('\\PHPExcel\\Worksheet\\Column', $column); @@ -43,7 +45,7 @@ class ColumnIteratorTest extends \PHPUnit_Framework_TestCase $iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D'); $columnIndexResult = 'B'; $this->assertEquals($columnIndexResult, $iterator->key()); - + foreach ($iterator as $key => $column) { $this->assertEquals($columnIndexResult++, $key); $this->assertInstanceOf('\\PHPExcel\\Worksheet\\Column', $column); diff --git a/unitTests/Classes/src/Worksheet/RowCellIteratorTest.php b/tests/PhpSpreadsheet/Worksheet/RowCellIteratorTest.php similarity index 98% rename from unitTests/Classes/src/Worksheet/RowCellIteratorTest.php rename to tests/PhpSpreadsheet/Worksheet/RowCellIteratorTest.php index 58dca140..eed9e2e6 100644 --- a/unitTests/Classes/src/Worksheet/RowCellIteratorTest.php +++ b/tests/PhpSpreadsheet/Worksheet/RowCellIteratorTest.php @@ -1,6 +1,6 @@ - - - - - - ./Classes - - - - ../src - - ../src/PhpSpreadsheet/Shared/PCLZip - ../src/PhpSpreadsheet/Shared/JAMA - ../src/PhpSpreadsheet/Writer/PDF - - - - - - - - - - diff --git a/unitTests/phpunit.xml b/unitTests/phpunit.xml deleted file mode 100644 index 95ca0774..00000000 --- a/unitTests/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - ./Classes - - - - ../src - - ../src/PhpSpreadsheet/Shared/PCLZip - ../src/PhpSpreadsheet/Shared/JAMA - ../src/PhpSpreadsheet/Writer/PDF - - - -