Initial commit: apps.supersam24.ru

This commit is contained in:
root committed 2026-10-22 00:04:27 +03:00
commit e955e1da36
6566 files changed
+1271095

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
<?php
chdir(__DIR__ . '/..');
if (!file_exists('vendor/autoload.php')) {
`composer dump-autoload`;
}
require __DIR__ . '/../vendor/autoload.php';
if (!class_exists('PHPUnit\Framework\TestCase') && class_exists('PHPUnit_Framework_TestCase')) {
// we run on an older PHPUnit version without namespaces.
require_once __DIR__ . '/PHPUnit_Framework_TestCase.inc.php';
}
@@ -0,0 +1,11 @@
<?php
namespace PHPUnit\Framework;
// Only needed to keep unit test code compatible with older PHPUnit versions
/** @noinspection PhpUndefinedClassInspection */
/** @noinspection AutoloadingIssuesInspection */
class TestCase extends \PHPUnit_Framework_TestCase {
}
Binary file not shown.
1 idSite idVisit visitIp visitorId type (actionDetails 0) url (actionDetails 0) pageTitle (actionDetails 0) pageIdAction (actionDetails 0) idpageview (actionDetails 0) serverTimePretty (actionDetails 0) pageId (actionDetails 0) timeSpent (actionDetails 0) timeSpentPretty (actionDetails 0) interactionPosition (actionDetails 0) icon (actionDetails 0) timestamp (actionDetails 0) type (actionDetails 1) url (actionDetails 1) pageTitle (actionDetails 1) pageIdAction (actionDetails 1) idpageview (actionDetails 1) serverTimePretty (actionDetails 1) pageId (actionDetails 1) timeSpent (actionDetails 1) timeSpentPretty (actionDetails 1) generationTimeMilliseconds (actionDetails 1) generationTime (actionDetails 1) interactionPosition (actionDetails 1) icon (actionDetails 1) timestamp (actionDetails 1) type (actionDetails 2) url (actionDetails 2) pageTitle (actionDetails 2) pageIdAction (actionDetails 2) idpageview (actionDetails 2) serverTimePretty (actionDetails 2) pageId (actionDetails 2) timeSpent (actionDetails 2) timeSpentPretty (actionDetails 2) generationTimeMilliseconds (actionDetails 2) generationTime (actionDetails 2) interactionPosition (actionDetails 2) icon (actionDetails 2) timestamp (actionDetails 2) type (actionDetails 3) url (actionDetails 3) pageTitle (actionDetails 3) pageIdAction (actionDetails 3) idpageview (actionDetails 3) serverTimePretty (actionDetails 3) pageId (actionDetails 3) timeSpent (actionDetails 3) timeSpentPretty (actionDetails 3) generationTimeMilliseconds (actionDetails 3) generationTime (actionDetails 3) interactionPosition (actionDetails 3) icon (actionDetails 3) timestamp (actionDetails 3) type (actionDetails 4) url (actionDetails 4) pageTitle (actionDetails 4) pageIdAction (actionDetails 4) idpageview (actionDetails 4) serverTimePretty (actionDetails 4) pageId (actionDetails 4) timeSpent (actionDetails 4) timeSpentPretty (actionDetails 4) generationTimeMilliseconds (actionDetails 4) generationTime (actionDetails 4) interactionPosition (actionDetails 4) icon (actionDetails 4) timestamp (actionDetails 4) type (actionDetails 5) url (actionDetails 5) pageTitle (actionDetails 5) pageIdAction (actionDetails 5) idpageview (actionDetails 5) serverTimePretty (actionDetails 5) pageId (actionDetails 5) timeSpent (actionDetails 5) timeSpentPretty (actionDetails 5) generationTimeMilliseconds (actionDetails 5) generationTime (actionDetails 5) interactionPosition (actionDetails 5) icon (actionDetails 5) timestamp (actionDetails 5) type (actionDetails 6) url (actionDetails 6) pageTitle (actionDetails 6) pageIdAction (actionDetails 6) idpageview (actionDetails 6) serverTimePretty (actionDetails 6) pageId (actionDetails 6) timeSpent (actionDetails 6) timeSpentPretty (actionDetails 6) generationTimeMilliseconds (actionDetails 6) generationTime (actionDetails 6) interactionPosition (actionDetails 6) icon (actionDetails 6) timestamp (actionDetails 6) type (actionDetails 7) url (actionDetails 7) pageTitle (actionDetails 7) pageIdAction (actionDetails 7) idpageview (actionDetails 7) serverTimePretty (actionDetails 7) pageId (actionDetails 7) timeSpent (actionDetails 7) timeSpentPretty (actionDetails 7) generationTimeMilliseconds (actionDetails 7) generationTime (actionDetails 7) interactionPosition (actionDetails 7) icon (actionDetails 7) timestamp (actionDetails 7) type (actionDetails 8) url (actionDetails 8) pageTitle (actionDetails 8) pageIdAction (actionDetails 8) idpageview (actionDetails 8) serverTimePretty (actionDetails 8) pageId (actionDetails 8) timeSpent (actionDetails 8) timeSpentPretty (actionDetails 8) generationTimeMilliseconds (actionDetails 8) generationTime (actionDetails 8) interactionPosition (actionDetails 8) icon (actionDetails 8) timestamp (actionDetails 8) type (actionDetails 9) url (actionDetails 9) pageTitle (actionDetails 9) pageIdAction (actionDetails 9) idpageview (actionDetails 9) serverTimePretty (actionDetails 9) pageId (actionDetails 9) timeSpent (actionDetails 9) timeSpentPretty (actionDetails 9) generationTimeMilliseconds (actionDetails 9) generationTime (actionDetails 9) interactionPosition (actionDetails 9) icon (actionDetails 9) timestamp (actionDetails 9) type (actionDetails 10) url (actionDetails 10) pageTitle (actionDetails 10) pageIdAction (actionDetails 10) idpageview (actionDetails 10) serverTimePretty (actionDetails 10) pageId (actionDetails 10) timeSpent (actionDetails 10) timeSpentPretty (actionDetails 10) generationTimeMilliseconds (actionDetails 10) generationTime (actionDetails 10) interactionPosition (actionDetails 10) icon (actionDetails 10) timestamp (actionDetails 10) type (actionDetails 11) url (actionDetails 11) pageTitle (actionDetails 11) pageIdAction (actionDetails 11) idpageview (actionDetails 11) serverTimePretty (actionDetails 11) pageId (actionDetails 11) timeSpent (actionDetails 11) timeSpentPretty (actionDetails 11) generationTimeMilliseconds (actionDetails 11) generationTime (actionDetails 11) interactionPosition (actionDetails 11) icon (actionDetails 11) timestamp (actionDetails 11) type (actionDetails 12) url (actionDetails 12) pageTitle (actionDetails 12) pageIdAction (actionDetails 12) idpageview (actionDetails 12) serverTimePretty (actionDetails 12) pageId (actionDetails 12) timeSpent (actionDetails 12) timeSpentPretty (actionDetails 12) generationTimeMilliseconds (actionDetails 12) generationTime (actionDetails 12) interactionPosition (actionDetails 12) icon (actionDetails 12) timestamp (actionDetails 12) type (actionDetails 13) url (actionDetails 13) pageTitle (actionDetails 13) pageIdAction (actionDetails 13) idpageview (actionDetails 13) serverTimePretty (actionDetails 13) pageId (actionDetails 13) timeSpent (actionDetails 13) timeSpentPretty (actionDetails 13) generationTimeMilliseconds (actionDetails 13) generationTime (actionDetails 13) interactionPosition (actionDetails 13) icon (actionDetails 13) timestamp (actionDetails 13) type (actionDetails 14) url (actionDetails 14) pageTitle (actionDetails 14) pageIdAction (actionDetails 14) idpageview (actionDetails 14) serverTimePretty (actionDetails 14) pageId (actionDetails 14) timeSpent (actionDetails 14) timeSpentPretty (actionDetails 14) generationTimeMilliseconds (actionDetails 14) generationTime (actionDetails 14) interactionPosition (actionDetails 14) icon (actionDetails 14) timestamp (actionDetails 14) type (actionDetails 15) url (actionDetails 15) pageTitle (actionDetails 15) pageIdAction (actionDetails 15) idpageview (actionDetails 15) serverTimePretty (actionDetails 15) pageId (actionDetails 15) timeSpent (actionDetails 15) timeSpentPretty (actionDetails 15) generationTimeMilliseconds (actionDetails 15) generationTime (actionDetails 15) interactionPosition (actionDetails 15) icon (actionDetails 15) timestamp (actionDetails 15) type (actionDetails 16) url (actionDetails 16) pageTitle (actionDetails 16) pageIdAction (actionDetails 16) idpageview (actionDetails 16) serverTimePretty (actionDetails 16) pageId (actionDetails 16) timeSpent (actionDetails 16) timeSpentPretty (actionDetails 16) generationTimeMilliseconds (actionDetails 16) generationTime (actionDetails 16) interactionPosition (actionDetails 16) icon (actionDetails 16) timestamp (actionDetails 16) type (actionDetails 17) url (actionDetails 17) pageTitle (actionDetails 17) pageIdAction (actionDetails 17) idpageview (actionDetails 17) serverTimePretty (actionDetails 17) pageId (actionDetails 17) timeSpent (actionDetails 17) timeSpentPretty (actionDetails 17) generationTimeMilliseconds (actionDetails 17) generationTime (actionDetails 17) interactionPosition (actionDetails 17) icon (actionDetails 17) timestamp (actionDetails 17) type (actionDetails 18) url (actionDetails 18) pageTitle (actionDetails 18) pageIdAction (actionDetails 18) idpageview (actionDetails 18) serverTimePretty (actionDetails 18) pageId (actionDetails 18) timeSpent (actionDetails 18) timeSpentPretty (actionDetails 18) generationTimeMilliseconds (actionDetails 18) generationTime (actionDetails 18) interactionPosition (actionDetails 18) icon (actionDetails 18) timestamp (actionDetails 18) type (actionDetails 19) url (actionDetails 19) pageTitle (actionDetails 19) pageIdAction (actionDetails 19) idpageview (actionDetails 19) serverTimePretty (actionDetails 19) pageId (actionDetails 19) timeSpent (actionDetails 19) timeSpentPretty (actionDetails 19) generationTimeMilliseconds (actionDetails 19) generationTime (actionDetails 19) interactionPosition (actionDetails 19) icon (actionDetails 19) timestamp (actionDetails 19) type (actionDetails 20) url (actionDetails 20) pageTitle (actionDetails 20) pageIdAction (actionDetails 20) idpageview (actionDetails 20) serverTimePretty (actionDetails 20) pageId (actionDetails 20) timeSpent (actionDetails 20) timeSpentPretty (actionDetails 20) generationTimeMilliseconds (actionDetails 20) generationTime (actionDetails 20) interactionPosition (actionDetails 20) icon (actionDetails 20) timestamp (actionDetails 20) type (actionDetails 21) url (actionDetails 21) pageTitle (actionDetails 21) pageIdAction (actionDetails 21) idpageview (actionDetails 21) serverTimePretty (actionDetails 21) pageId (actionDetails 21) timeSpent (actionDetails 21) timeSpentPretty (actionDetails 21) generationTimeMilliseconds (actionDetails 21) generationTime (actionDetails 21) interactionPosition (actionDetails 21) icon (actionDetails 21) timestamp (actionDetails 21) type (actionDetails 22) url (actionDetails 22) pageTitle (actionDetails 22) pageIdAction (actionDetails 22) idpageview (actionDetails 22) serverTimePretty (actionDetails 22) pageId (actionDetails 22) timeSpent (actionDetails 22) timeSpentPretty (actionDetails 22) generationTimeMilliseconds (actionDetails 22) generationTime (actionDetails 22) interactionPosition (actionDetails 22) icon (actionDetails 22) timestamp (actionDetails 22) type (actionDetails 23) url (actionDetails 23) pageTitle (actionDetails 23) pageIdAction (actionDetails 23) idpageview (actionDetails 23) serverTimePretty (actionDetails 23) pageId (actionDetails 23) timeSpent (actionDetails 23) timeSpentPretty (actionDetails 23) generationTimeMilliseconds (actionDetails 23) generationTime (actionDetails 23) interactionPosition (actionDetails 23) icon (actionDetails 23) timestamp (actionDetails 23) type (actionDetails 24) url (actionDetails 24) pageTitle (actionDetails 24) pageIdAction (actionDetails 24) idpageview (actionDetails 24) serverTimePretty (actionDetails 24) pageId (actionDetails 24) timeSpent (actionDetails 24) timeSpentPretty (actionDetails 24) generationTimeMilliseconds (actionDetails 24) generationTime (actionDetails 24) interactionPosition (actionDetails 24) icon (actionDetails 24) timestamp (actionDetails 24) type (actionDetails 25) url (actionDetails 25) pageTitle (actionDetails 25) pageIdAction (actionDetails 25) idpageview (actionDetails 25) serverTimePretty (actionDetails 25) pageId (actionDetails 25) timeSpent (actionDetails 25) timeSpentPretty (actionDetails 25) generationTimeMilliseconds (actionDetails 25) generationTime (actionDetails 25) interactionPosition (actionDetails 25) icon (actionDetails 25) timestamp (actionDetails 25) type (actionDetails 26) url (actionDetails 26) pageTitle (actionDetails 26) pageIdAction (actionDetails 26) idpageview (actionDetails 26) serverTimePretty (actionDetails 26) pageId (actionDetails 26) timeSpent (actionDetails 26) timeSpentPretty (actionDetails 26) generationTimeMilliseconds (actionDetails 26) generationTime (actionDetails 26) interactionPosition (actionDetails 26) icon (actionDetails 26) timestamp (actionDetails 26) type (actionDetails 27) url (actionDetails 27) pageTitle (actionDetails 27) pageIdAction (actionDetails 27) idpageview (actionDetails 27) serverTimePretty (actionDetails 27) pageId (actionDetails 27) timeSpent (actionDetails 27) timeSpentPretty (actionDetails 27) generationTimeMilliseconds (actionDetails 27) generationTime (actionDetails 27) interactionPosition (actionDetails 27) icon (actionDetails 27) timestamp (actionDetails 27) type (actionDetails 28) url (actionDetails 28) pageTitle (actionDetails 28) pageIdAction (actionDetails 28) idpageview (actionDetails 28) serverTimePretty (actionDetails 28) pageId (actionDetails 28) timeSpent (actionDetails 28) timeSpentPretty (actionDetails 28) generationTimeMilliseconds (actionDetails 28) generationTime (actionDetails 28) interactionPosition (actionDetails 28) icon (actionDetails 28) timestamp (actionDetails 28) type (actionDetails 29) url (actionDetails 29) pageTitle (actionDetails 29) pageIdAction (actionDetails 29) idpageview (actionDetails 29) serverTimePretty (actionDetails 29) pageId (actionDetails 29) timeSpent (actionDetails 29) timeSpentPretty (actionDetails 29) generationTimeMilliseconds (actionDetails 29) generationTime (actionDetails 29) interactionPosition (actionDetails 29) icon (actionDetails 29) timestamp (actionDetails 29) type (actionDetails 30) url (actionDetails 30) pageTitle (actionDetails 30) pageIdAction (actionDetails 30) idpageview (actionDetails 30) serverTimePretty (actionDetails 30) pageId (actionDetails 30) timeSpent (actionDetails 30) timeSpentPretty (actionDetails 30) generationTimeMilliseconds (actionDetails 30) generationTime (actionDetails 30) interactionPosition (actionDetails 30) icon (actionDetails 30) timestamp (actionDetails 30) type (actionDetails 31) url (actionDetails 31) pageTitle (actionDetails 31) pageIdAction (actionDetails 31) idpageview (actionDetails 31) serverTimePretty (actionDetails 31) pageId (actionDetails 31) timeSpent (actionDetails 31) timeSpentPretty (actionDetails 31) generationTimeMilliseconds (actionDetails 31) generationTime (actionDetails 31) interactionPosition (actionDetails 31) icon (actionDetails 31) timestamp (actionDetails 31) type (actionDetails 32) url (actionDetails 32) pageTitle (actionDetails 32) pageIdAction (actionDetails 32) idpageview (actionDetails 32) serverTimePretty (actionDetails 32) pageId (actionDetails 32) timeSpent (actionDetails 32) timeSpentPretty (actionDetails 32) generationTimeMilliseconds (actionDetails 32) generationTime (actionDetails 32) interactionPosition (actionDetails 32) icon (actionDetails 32) timestamp (actionDetails 32) type (actionDetails 33) url (actionDetails 33) pageTitle (actionDetails 33) pageIdAction (actionDetails 33) idpageview (actionDetails 33) serverTimePretty (actionDetails 33) pageId (actionDetails 33) timeSpent (actionDetails 33) timeSpentPretty (actionDetails 33) generationTimeMilliseconds (actionDetails 33) generationTime (actionDetails 33) interactionPosition (actionDetails 33) icon (actionDetails 33) timestamp (actionDetails 33) type (actionDetails 34) url (actionDetails 34) pageTitle (actionDetails 34) pageIdAction (actionDetails 34) idpageview (actionDetails 34) serverTimePretty (actionDetails 34) pageId (actionDetails 34) timeSpent (actionDetails 34) timeSpentPretty (actionDetails 34) generationTimeMilliseconds (actionDetails 34) generationTime (actionDetails 34) interactionPosition (actionDetails 34) icon (actionDetails 34) timestamp (actionDetails 34) type (actionDetails 35) url (actionDetails 35) pageTitle (actionDetails 35) pageIdAction (actionDetails 35) idpageview (actionDetails 35) serverTimePretty (actionDetails 35) pageId (actionDetails 35) timeSpent (actionDetails 35) timeSpentPretty (actionDetails 35) generationTimeMilliseconds (actionDetails 35) generationTime (actionDetails 35) interactionPosition (actionDetails 35) icon (actionDetails 35) timestamp (actionDetails 35) type (actionDetails 36) url (actionDetails 36) pageTitle (actionDetails 36) pageIdAction (actionDetails 36) idpageview (actionDetails 36) serverTimePretty (actionDetails 36) pageId (actionDetails 36) timeSpent (actionDetails 36) timeSpentPretty (actionDetails 36) generationTimeMilliseconds (actionDetails 36) generationTime (actionDetails 36) interactionPosition (actionDetails 36) icon (actionDetails 36) timestamp (actionDetails 36) type (actionDetails 37) url (actionDetails 37) pageTitle (actionDetails 37) pageIdAction (actionDetails 37) idpageview (actionDetails 37) serverTimePretty (actionDetails 37) pageId (actionDetails 37) timeSpent (actionDetails 37) timeSpentPretty (actionDetails 37) interactionPosition (actionDetails 37) icon (actionDetails 37) timestamp (actionDetails 37) type (actionDetails 38) url (actionDetails 38) pageTitle (actionDetails 38) pageIdAction (actionDetails 38) idpageview (actionDetails 38) serverTimePretty (actionDetails 38) pageId (actionDetails 38) timeSpent (actionDetails 38) timeSpentPretty (actionDetails 38) interactionPosition (actionDetails 38) icon (actionDetails 38) timestamp (actionDetails 38) type (actionDetails 39) url (actionDetails 39) pageTitle (actionDetails 39) pageIdAction (actionDetails 39) idpageview (actionDetails 39) serverTimePretty (actionDetails 39) pageId (actionDetails 39) timeSpent (actionDetails 39) timeSpentPretty (actionDetails 39) generationTimeMilliseconds (actionDetails 39) generationTime (actionDetails 39) interactionPosition (actionDetails 39) icon (actionDetails 39) timestamp (actionDetails 39) type (actionDetails 40) url (actionDetails 40) pageTitle (actionDetails 40) pageIdAction (actionDetails 40) idpageview (actionDetails 40) serverTimePretty (actionDetails 40) pageId (actionDetails 40) generationTimeMilliseconds (actionDetails 40) generationTime (actionDetails 40) interactionPosition (actionDetails 40) icon (actionDetails 40) timestamp (actionDetails 40) goalConversions siteCurrency siteCurrencySymbol serverDate visitServerHour lastActionTimestamp lastActionDateTime serverTimestamp firstActionTimestamp serverTimePretty serverDatePretty serverDatePrettyFirstAction serverTimePrettyFirstAction userId visitorType visitorTypeIcon visitConverted visitConvertedIcon visitCount visitEcommerceStatus visitEcommerceStatusIcon daysSinceFirstVisit daysSinceLastEcommerceOrder visitDuration visitDurationPretty searches actions interactions referrerType referrerTypeName referrerName referrerKeyword referrerKeywordPosition referrerUrl referrerSearchEngineUrl referrerSearchEngineIcon languageCode language deviceType deviceTypeIcon deviceBrand deviceModel operatingSystem operatingSystemName operatingSystemIcon operatingSystemCode operatingSystemVersion browserFamily browserFamilyDescription browser browserName browserIcon browserCode browserVersion events continent continentCode country countryCode countryFlag region regionCode city location latitude longitude visitLocalTime visitLocalHour daysSinceLastVisit resolution plugins pluginsIcons provider providerName providerUrl customVariableName1 customVariableValue1 customVariableName2 customVariableValue2 customVariableName3 customVariableValue3 customVariableName4 customVariableValue4 customVariableName5 customVariableValue5 pageUrl__1 pageTitle__1 pageUrl__2 pageTitle__2 pageUrl__3 pageTitle__3 pageUrl__4 pageTitle__4 pageUrl__5 pageTitle__5 pageUrl__6 pageTitle__6 pageUrl__7 pageTitle__7 pageUrl__8 pageTitle__8 pageUrl__9 pageTitle__9 pageUrl__10 pageTitle__10 pageUrl__11 pageTitle__11 pageUrl__12 pageTitle__12 pageUrl__13 pageUrl__14 pageTitle__14 pageUrl__15 pageTitle__15 pageUrl__16 pageTitle__16 pageUrl__17 pageTitle__17 pageUrl__18 pageTitle__18 pageUrl__19 pageTitle__19 pageUrl__20 pageTitle__20 pageUrl__21 pageTitle__21 pageUrl__22 pageTitle__22 pageUrl__23 pageTitle__23 pageUrl__24 pageUrl__25 pageTitle__25 pageUrl__26 pageTitle__26 pageUrl__27 pageTitle__27 pageUrl__28 pageTitle__28 pageUrl__29 pageTitle__29 pageUrl__30 pageTitle__30 pageUrl__31 pageTitle__31 pageUrl__32 pageTitle__32 pageUrl__33 pageTitle__33 pageUrl__34 pageTitle__34 pageUrl__35 pageTitle__35 pageUrl__36 pageTitle__36 pageUrl__37 pageTitle__37 pageUrl__38 pageTitle__38 pageUrl__39 pageTitle__39 pageUrl__40 pageTitle__40 pageUrl__41 pageTitle__41 entryPageTitle entryPageUrl exitPageTitle exitPageUrl generationTimeMilliseconds (actionDetails 0) generationTime (actionDetails 0) timeSpentRef (actionDetails 9) custom_float (actionDetails 9)
2 13 129930 213. 6c38cb8dca6e1f5d action http://_asktermmesswert/Button1 Ok 9551 04.1.2017 17:42:12 1181863 20 20 s 1 1483551732 action http://application/_Main/mnDatenbankSpeichern Save changes in the database 9646 04.1.2017 17:42:32 1181864 15 15 s 1092 1,09 s 2 1483551752 action http://application/_Main/bbRingversuchwechseln Ring test 9386 04.1.2017 17:42:47 1181865 58 58 s 6966 6,97 s 3 1483551767 action http://application/_Main/mnPML_ToTest Sample-measurand-laboratory allocation 9915 04.1.2017 17:43:45 1181866 14 14 s 851 0,85 s 4 1483551825 action http://application/_Main/_ErstellePMLabKombination/btnAddAll Include allcombinations 9864 04.1.2017 17:43:59 1181867 22 22 s 204 0,2 s 5 1483551839 action http://application/_Main/mnHomogeneityImportMesswerte Import test results 9574 04.1.2017 17:44:21 1181868 9 9 s 189 0,19 s 6 1483551861 action http://application/_Main/mnCalcMean Ring test parameters 9289 04.1.2017 17:44:30 1181869 3 3 s 598 0,6 s 7 1483551870 action http://application/_Main/_CalcMeanSTD_MDI/btnReportMeanSTD Assigned values/s.d. 9659 04.1.2017 17:44:33 1181870 15 15 s 10369 10,37 s 8 1483551873 action http://application/_Main/_CalcMeanSTD_MDI/btnCalculateMean Computation 9290 04.1.2017 17:44:48 1181871 55 55 s 22762 22,76 s 9 1483551888 action http://application/_Main/_CalcMeanSTD_MDI/mnReportMitLaborcode with Lab code 9411 04.1.2017 17:45:43 1181872 80 1 Minuten 20s 6345 6,35 s 10 1483551943 action http://application/_Main/bbHistogram_NormalPlot Histogram normal plot 9361 04.1.2017 17:47:03 1181873 31 31 s 5985 5,99 s 11 1483552023 action http://application/_Main/bbVariance_ToleranceLimits Tolerance limits rel. standard deviations 9873 04.1.2017 17:47:34 1181874 12 12 s 567 0,57 s 12 1483552054 action http://application/_Main/_Youdenplot_MDI/PageControl1 9363 04.1.2017 17:47:46 1181875 0 0 s 4 0,004 s 13 1483552066 action http://application/_Main/bbYoudenplot Youden plot 9364 04.1.2017 17:47:46 1181876 30 30 s 497 0,5 s 14 1483552066 action http://application/_Main/bbOverAllSamples Laboratory mean values 9293 04.1.2017 17:48:16 1181877 33 33 s 458 0,46 s 15 1483552096 action http://application/_Main/bbLoadSelect Load selection 12749 04.1.2017 17:48:49 1181878 7 7 s 62 0,06 s 16 1483552129 action http://application/_Main/bbPML_ToTest Sample-measurand-laboratory allocation 9321 04.1.2017 17:48:56 1181879 5 5 s 1192 1,19 s 17 1483552136 action http://application/_Main/bbLCode Laboratories 9350 04.1.2017 17:49:01 1181880 4 4 s 635 0,64 s 18 1483552141 action http://application/_Main/_LaborCodierung/btnReset Delete all laboratory codes 10435 04.1.2017 17:49:05 1181881 14 14 s 4333 4,33 s 19 1483552145 action http://application/_Main/mnNewDatabase New database 9441 04.1.2017 17:49:19 1181882 17 17 s 6939 6,94 s 20 1483552159 action http://application/_Main/mnHomogeneityBerechnung Calculation (ISO 13528:2015 and Harmonized Protocol) 9579 04.1.2017 17:49:36 1181883 14 14 s 612 0,61 s 21 1483552176 action http://application/_Main/_CalcHomogeneity_MDI/mniReportChart Graphics and text for current combination 9643 04.1.2017 17:49:50 1181884 0 0 s 4912 4,91 s 22 1483552190 action http://application/_Main/bbYoudenplot Youden plot 9364 04.1.2017 17:50:05 1181886 16 16 s 855 0,86 s 24 1483552205 action http://application/_Main/_Youdenplot_MDI/PageControl1 9363 04.1.2017 17:50:06 1181885 0 0 s 5 0,005 s 23 1483552206 action http://application/_Main/bbEinzeldarstellung Summary results 9268 04.1.2017 17:50:10 1181888 6 6 s 2941 2,94 s 26 1483552210 action http://application/_Main/_GraphicMeanSTD_MDI/mnuYAutoscaleAll Automatic scaling for all chart contents 9301 04.1.2017 17:50:11 1181887 34 34 s 1 0,001 s 25 1483552211 action http://application/_Main/_GraphicMeanSTD_MDI/btnOutlier Outliers 9503 04.1.2017 17:50:44 1181889 2 2 s 76 0,08 s 27 1483552244 action http://application/_Main/_GraphicMeanSTD_MDI/btnConfBandOptions ... 9777 04.1.2017 17:50:46 1181890 1 1 s 1482 1,48 s 28 1483552246 action http://application/_Main/_GraphicMeanSTD_MDI/mnConfLinien Lines 10077 04.1.2017 17:50:47 1181891 18 18 s 1529 1,53 s 29 1483552247 action http://application/_Main/bbPM_ToTest Sample-measurand allocation 9319 04.1.2017 17:51:05 1181892 2 2 s 100 0,1 s 30 1483552265 action http://application/_Main/bbPML_ToTest Sample-measurand-laboratory allocation 9321 04.1.2017 17:51:07 1181893 3 3 s 1178 1,18 s 31 1483552267 action http://application/_Main/bbLabToTest Laboratory allocation 9317 04.1.2017 17:51:10 1181894 34 34 s 109 0,11 s 32 1483552270 action http://application/_Main/bbYoudenplot Youden plot 9364 04.1.2017 17:51:44 1181895 1 1 s 47 0,05 s 33 1483552304 action http://application/_Main/bbScoreGraphic Survey of Z-Scores 9269 04.1.2017 17:51:45 1181896 32 32 s 310 0,31 s 34 1483552305 action http://application/_Main/_GraphicZScores_MDI/btnLCode Lab code 9487 04.1.2017 17:52:17 1181897 8 8 s 234 0,23 s 35 1483552337 action http://application/_Main/_GraphicZScores_MDI/btnClose Close 9488 04.1.2017 17:52:25 1181898 2 2 s 130 0,13 s 36 1483552345 action http://application/_Main/_Youdenplot_MDI/btnClose Close 9799 04.1.2017 17:52:27 1181899 1 1 s 86 0,09 s 37 1483552347 action http://application/_Main/_LabStructure/btnClose Close 9866 04.1.2017 17:52:28 1181900 1 1 s 38 1483552348 action http://application/_Main/_ErstellePMLabKombination/btnClose Close 9946 04.1.2017 17:52:29 1181901 1 1 s 39 1483552349 action http://application/_Main/_ErstellePMKombination/btnClose Close 9831 04.1.2017 17:52:30 1181902 1 1 s 1 0,001 s 40 1483552350 action http://application/_Main/btnClose Close 9245 04.1.2017 17:52:31 1181903 29 0,03 s 41 1483552351 0 EUR € 2017-01-04 16 1483548751 2017-01-04 16:52:31 1483548751 1483548132 17:52:31 Mittwoch, 4. Januar 2017 Mittwoch, 4. Januar 2017 17:42:12 new 0 1 none 0 0 620 10 Minuten 20s 0 41 41 direct Direkte Zugriffe en Englisch unbekannt plugins/Morpheus/icons/dist/devices/unknown.png unbekannt unbekannt unbekannt plugins/Morpheus/icons/dist/os/UNK.png UNK UNK unbekannt unbekannt unbekannt plugins/Morpheus/icons/dist/browsers/UNK.png UNK 0 Südamerika ams Brasilien br plugins/Morpheus/icons/dist/flags/br.png Sao Paulo 27 São Paulo São Paulo, Sao Paulo, Brasilien -23.473000 -46.666000 16:42:12 16 0 1920x1080 wcs.net.br Wcs http://www.wcs.net.br/ From _1710 Serial _1710 Version 21. App PROLab Plus Demo OsLanguage Portuguese http://_asktermmesswert/Button1 Ok http://application/_Main/mnDatenbankSpeichern Save changes in the database http://application/_Main/bbRingversuchwechseln Ring test http://application/_Main/mnPML_ToTest Sample-measurand-laboratory allocation http://application/_Main/_ErstellePMLabKombination/btnAddAll Include allcombinations http://application/_Main/mnHomogeneityImportMesswerte Import test results http://application/_Main/mnCalcMean Ring test parameters http://application/_Main/_CalcMeanSTD_MDI/btnReportMeanSTD Assigned values/s.d. http://application/_Main/_CalcMeanSTD_MDI/btnCalculateMean Computation http://application/_Main/_CalcMeanSTD_MDI/mnReportMitLaborcode with Lab code http://application/_Main/bbHistogram_NormalPlot Histogram normal plot http://application/_Main/bbVariance_ToleranceLimits Tolerance limits rel. standard deviations http://application/_Main/_Youdenplot_MDI/PageControl1 http://application/_Main/bbYoudenplot Youden plot http://application/_Main/bbOverAllSamples Laboratory mean values http://application/_Main/bbLoadSelect Load selection http://application/_Main/bbPML_ToTest Sample-measurand-laboratory allocation http://application/_Main/bbLCode Laboratories http://application/_Main/_LaborCodierung/btnReset Delete all laboratory codes http://application/_Main/mnNewDatabase New database http://application/_Main/mnHomogeneityBerechnung Calculation (ISO 13528:2015 and Harmonized Protocol) http://application/_Main/_CalcHomogeneity_MDI/mniReportChart Graphics and text for current combination http://application/_Main/bbYoudenplot Youden plot http://application/_Main/_Youdenplot_MDI/PageControl1 http://application/_Main/bbEinzeldarstellung Summary results http://application/_Main/_GraphicMeanSTD_MDI/mnuYAutoscaleAll Automatic scaling for all chart contents http://application/_Main/_GraphicMeanSTD_MDI/btnOutlier Outliers http://application/_Main/_GraphicMeanSTD_MDI/btnConfBandOptions ... http://application/_Main/_GraphicMeanSTD_MDI/mnConfLinien Lines http://application/_Main/bbPM_ToTest Sample-measurand allocation http://application/_Main/bbPML_ToTest Sample-measurand-laboratory allocation http://application/_Main/bbLabToTest Laboratory allocation http://application/_Main/bbYoudenplot Youden plot http://application/_Main/bbScoreGraphic Survey of Z-Scores http://application/_Main/_GraphicZScores_MDI/btnLCode Lab code http://application/_Main/_GraphicZScores_MDI/btnClose Close http://application/_Main/_Youdenplot_MDI/btnClose Close http://application/_Main/_LabStructure/btnClose Close http://application/_Main/_ErstellePMLabKombination/btnClose Close http://application/_Main/_ErstellePMKombination/btnClose Close http://application/_Main/btnClose Close Ok http://_asktermmesswert/Button1 Close http://application/_Main/btnClose
3 13 129999 154. 69dafac11ed871fb action http://application/_Main/Grundtabellen1 Basic tables 9295 04.1.2017 16:08:19 1182416 35 35 s 1 1483546099 action http://application/_Main/mnHomogeneityImportMesswerte Import test results 9574 04.1.2017 16:08:54 1182417 12 12 s 1107 1,11 s 2 1483546134 action http://application/_Main/_ImportGroups_FP/btnLoad Open 9576 04.1.2017 16:09:06 1182418 30 30 s 10551 10,55 s 3 1483546146 action http://application/_Main/_ImportGroups_FP/btnFiletransfer Transfer data 9578 04.1.2017 16:09:36 1182419 44 44 s 32089 32,09 s 4 1483546176 action http://application/_Main/mnHomogeneityBerechnung Calculation (ISO 13528:2015 and Harmonized Protocol) 9579 04.1.2017 16:10:20 1182420 889 0,89 s 5 1483546220 0 EUR € 2017-01-04 15 1483542620 2017-01-04 15:10:20 1483542620 1483542499 16:10:20 Mittwoch, 4. Januar 2017 Mittwoch, 4. Januar 2017 16:08:19 new 0 1 none 0 0 122 2 Minuten 2s 0 5 5 direct Direkte Zugriffe en Englisch unbekannt plugins/Morpheus/icons/dist/devices/unknown.png unbekannt unbekannt unbekannt plugins/Morpheus/icons/dist/os/UNK.png UNK UNK unbekannt unbekannt unbekannt plugins/Morpheus/icons/dist/browsers/UNK.png UNK 0 Afrika afr Südafrika za plugins/Morpheus/icons/dist/flags/za.png Gauteng 06 Johannesburg Johannesburg, Gauteng, Südafrika -26.205000 28.050000 15:08:19 15 0 1366x768 telkomadsl.co.za Telkomadsl http://www.telkomadsl.co.za/ From _1710 Serial _1710 Version 30..0 App PROLab Plus OsLanguage English http://application/_Main/Grundtabellen1 Basic tables http://application/_Main/mnHomogeneityImportMesswerte Import test results http://application/_Main/_ImportGroups_FP/btnLoad Open http://application/_Main/_ImportGroups_FP/btnFiletransfer Transfer data http://application/_Main/mnHomogeneityBerechnung Calculation (ISO 13528:2015 and Harmonized Protocol) Basic tables http://application/_Main/Grundtabellen1 Calculation (ISO 13528:2015 and Harmonized Protocol) http://application/_Main/mnHomogeneityBerechnung 4945 4,95 s
4 13 129898 85..0 79a87d1a340cd850 action http://application/_Main/bbLabToTest Laboratory allocation 9317 04.1.2017 15:28:18 1181575 21 21 s 1 1483543698 action http://application/_Main/_LabStructure/btnDelete Exclude selectedlaboratories 9835 04.1.2017 15:28:39 1181576 13 13 s 3481 3,48 s 2 1483543719 action http://application/_Main/_LabStructure/btnAdd Include selectedlaboratories 9913 04.1.2017 15:28:52 1181577 214 3 Minuten 34s 24 0,02 s 3 1483543732 action http://application/_Main/_LabStructure/btnClose Close 9866 04.1.2017 15:32:26 1181578 4 4 s 1 0,001 s 4 1483543946 action http://application/_Main/Grundtabellen1 Basic tables 9295 04.1.2017 15:32:30 1181579 8 8 s 4355 4,36 s 5 1483543950 action http://application/_Main/_EditBasicTables/btnClose Close 9267 04.1.2017 15:32:38 1181580 2 2 s 9 0,009 s 6 1483543958 action http://application/_Main/Grundtabellen1 Basic tables 9295 04.1.2017 15:32:40 1181581 334 5 Minuten 34s 4211 4,21 s 7 1483543960 action http://application/_Main/_EditBasicTables/btnClose Close 9267 04.1.2017 15:38:14 1181582 0 0 s 10 0,01 s 8 1483544294 action http://application/_Main/mnCalcZScores_Results Computation of scores and tolerance limits 9260 04.1.2017 15:38:14 1181583 0 0 s 34018 34,02 s 9 1483544294 4 Save as Excel file 04.1.2017 15:38:14 1181584 10 1483544294 action http://application/_Main/_CalcZScores_Results_MDI/JvSpeedButton5 Close form 9772 04.1.2017 15:38:14 1181585 5 0,005 s 11 1483544294 0 EUR € 2017-01-04 14 1483540694 2017-01-04 14:38:14 1483540694 1483540098 15:38:14 Mittwoch, 4. Januar 2017 Mittwoch, 4. Januar 2017 15:28:18 new 0 1 none 0 0 597 9 Minuten 57s 0 11 11 direct Direkte Zugriffe en Englisch unbekannt plugins/Morpheus/icons/dist/devices/unknown.png unbekannt unbekannt unbekannt plugins/Morpheus/icons/dist/os/UNK.png UNK UNK unbekannt unbekannt unbekannt plugins/Morpheus/icons/dist/browsers/UNK.png UNK 0 Europa eur Dänemark dk plugins/Morpheus/icons/dist/flags/dk.png Dänemark 56.000000 10.000000 14:28:18 14 0 1680x1050 Ip unbekannt From _1710 Serial _1710 Version 17..0 App PROLab Plus OsLanguage Danish http://application/_Main/bbLabToTest Laboratory allocation http://application/_Main/_LabStructure/btnDelete Exclude selectedlaboratories http://application/_Main/_LabStructure/btnAdd Include selectedlaboratories http://application/_Main/_LabStructure/btnClose Close http://application/_Main/Grundtabellen1 Basic tables http://application/_Main/_EditBasicTables/btnClose Close http://application/_Main/Grundtabellen1 Basic tables http://application/_Main/_EditBasicTables/btnClose Close http://application/_Main/mnCalcZScores_Results Computation of scores and tolerance limits Save as Excel file http://application/_Main/_CalcZScores_Results_MDI/JvSpeedButton5 Close form Laboratory allocation http://application/_Main/bbLabToTest Close form http://application/_Main/_CalcZScores_Results_MDI/JvSpeedButton5 2641 2,64 s 0 18873
Binary file not shown.
1 sep=;
2 title;isbn;publishedAt
3 Красивая кулинария;5454-5587-3210;21.05.2011
4 The Wine Connoisseurs;2547-8548-2541;12.12.2011
5 Weißwein;1313-4545-8875;23.02.2012
@@ -0,0 +1,5 @@
sep=;
title;isbn;publishedAt
Красивая кулинария;5454-5587-3210;21.05.2011
The Wine Connoisseurs;2547-8548-2541;12.12.2011
Weißwein;1313-4545-8875;23.02.2012
1 sep=;
2 title;isbn;publishedAt
3 Красивая кулинария;5454-5587-3210;21.05.2011
4 The Wine Connoisseurs;2547-8548-2541;12.12.2011
5 Weißwein;1313-4545-8875;23.02.2012
@@ -0,0 +1,5 @@
sep=;
title;isbn;publishedAt
Красивая кулинария;5454-5587-3210;21.05.2011
The Wine Connoisseurs;2547-8548-2541;12.12.2011
Weißwein;1313-4545-8875;23.02.2012
1 sep=;
2 title;isbn;publishedAt
3 Красивая кулинария;5454-5587-3210;21.05.2011
4 The Wine Connoisseurs;2547-8548-2541;12.12.2011
5 Weißwein;1313-4545-8875;23.02.2012
@@ -0,0 +1,22 @@
ID,dID,createdAt,else1,else2,else3,else4,else5,user,else6,else7,else8,else9,else10,else11,else12,else13,else14,else15,else16,else17,else18,else19,else20,else21,else22,else23,else24,else25,else26,else27,else28,else29,else30,else31,else32,else33,else34,else35,else36,else37,else38
418,0,2017-05-16,,,2018-01-22,22.01.2018 10:00:09,,admin,Ja,,10001,Abweichung,,10001,v1,1,ddd,100,1000,,HH,,v1,0,401,1,2,H1,,-1,10,1,111,Ja,2017-01-01,,12,0,11109,HH-100,default
419,0,2017-05-16,,,2017-05-16,14.07.2017 09:58:09,,admin,Ja,,,Abweichung,,10002,v2,1,ddd,200,500,DD,DD,,v2,1,402,2,4,H2,,-2,100,1,1111,Ja,2017-01-01,1,13,1,11109,DD-200,default
438,0,2017-05-16,,,2017-05-16,14.07.2017 09:58:29,,admin,Ja,,10021,Abweichung,,10021,v3,4,ddd,300,400,DD,DD,,v3,0,421,1,,H3,,-1,106,1,111,Ja,2017-05-08,,2,1,11109,DD-300,default
440,0,2017-05-16,,,,14.07.2017 09:58:53,,admin,Ja,,,Alt,,10023,v4,3,,400,500,BE,DD,,v4,1,423,3,,H4,,-3,143,1,1111,Ja,2017-01-01,1,33,1,11108,BE-400,default
441,0,2017-05-16,,,,14.07.2017 09:59:19,,admin,Ja,,,Fehlt,,10024,v5,3,,500,,BE,,,v5,2,424,4,,H5,,0,1435,0,111,Ja,2017-01-01,,12,1,0,BE-500,default
442,0,2017-05-16,,,,14.07.2017 10:00:46,,admin,Ja,,,Neu,,10025,v6,3,,100,,DD,,,v6,435,425,1,,H6,,0,10,0,1111,Ja,2017-01-01,,102,1,0,DD-100,default
443,0,2017-05-16,,,2017-07-04,14.07.2017 10:01:12,,admin,Ja,,,OK,,10026,v7,3,,200,200,DD,DD,,v7,32,426,2,2,H7,,0,100,0,111,Ja,2017-01-01,,77,1,0,DD-200,default
444,0,2017-05-16,,,,14.07.2017 10:02:13,,admin,Ja,,,Fehlt,,10027,v8,3,,300,,BE,,,v8,45,427,3,,H8,,0,200,0,1111,Ja,2017-01-01,,44,3,0,BE-300,default
445,0,2017-05-16,,,,14.07.2017 10:02:38,,admin,Ja,,,Fehlt,,10028,v9,3,,100,,BE,,,v9,45,428,4,,H9,,0,400,0,111,Ja,2017-01-01,,44,1,0,BE-100,default
446,0,2017-05-16,,,,14.07.2017 10:03:01,,admin,Ja,,,Fehlt,,10029,v10,3,,,400,,DD,,v10,45,429,,,H10,,0,1124,0,1111,Ja,2017-01-01,,89,1,0,,default
1 ID dID createdAt else1 else2 else3 else4 else5 user else6 else7 else8 else9 else10 else11 else12 else13 else14 else15 else16 else17 else18 else19 else20 else21 else22 else23 else24 else25 else26 else27 else28 else29 else30 else31 else32 else33 else34 else35 else36 else37 else38
2 418 0 2017-05-16 2018-01-22 22.01.2018 10:00:09 admin Ja 10001 Abweichung 10001 v1 1 ddd 100 1000 HH v1 0 401 1 2 H1 -1 10 1 111 Ja 2017-01-01 12 0 11109 HH-100 default
3 419 0 2017-05-16 2017-05-16 14.07.2017 09:58:09 admin Ja Abweichung 10002 v2 1 ddd 200 500 DD DD v2 1 402 2 4 H2 -2 100 1 1111 Ja 2017-01-01 1 13 1 11109 DD-200 default
4 438 0 2017-05-16 2017-05-16 14.07.2017 09:58:29 admin Ja 10021 Abweichung 10021 v3 4 ddd 300 400 DD DD v3 0 421 1 H3 -1 106 1 111 Ja 2017-05-08 2 1 11109 DD-300 default
5 440 0 2017-05-16 14.07.2017 09:58:53 admin Ja Alt 10023 v4 3 400 500 BE DD v4 1 423 3 H4 -3 143 1 1111 Ja 2017-01-01 1 33 1 11108 BE-400 default
6 441 0 2017-05-16 14.07.2017 09:59:19 admin Ja Fehlt 10024 v5 3 500 BE v5 2 424 4 H5 0 1435 0 111 Ja 2017-01-01 12 1 0 BE-500 default
7 442 0 2017-05-16 14.07.2017 10:00:46 admin Ja Neu 10025 v6 3 100 DD v6 435 425 1 H6 0 10 0 1111 Ja 2017-01-01 102 1 0 DD-100 default
8 443 0 2017-05-16 2017-07-04 14.07.2017 10:01:12 admin Ja OK 10026 v7 3 200 200 DD DD v7 32 426 2 2 H7 0 100 0 111 Ja 2017-01-01 77 1 0 DD-200 default
9 444 0 2017-05-16 14.07.2017 10:02:13 admin Ja Fehlt 10027 v8 3 300 BE v8 45 427 3 H8 0 200 0 1111 Ja 2017-01-01 44 3 0 BE-300 default
10 445 0 2017-05-16 14.07.2017 10:02:38 admin Ja Fehlt 10028 v9 3 100 BE v9 45 428 4 H9 0 400 0 111 Ja 2017-01-01 44 1 0 BE-100 default
11 446 0 2017-05-16 14.07.2017 10:03:01 admin Ja Fehlt 10029 v10 3 400 DD v10 45 429 H10 0 1124 0 1111 Ja 2017-01-01 89 1 0 default
@@ -0,0 +1,5 @@
SMS
0444
5555
6606
7777
1 SMS
2 0444
3 5555
4 6606
5 7777
@@ -0,0 +1,6 @@
keyword
liability waiver
release of liability form
release of liability
sample waiver
sample waiver form
1 keyword
2 liability waiver
3 release of liability form
4 release of liability
5 sample waiver
6 sample waiver form
@@ -0,0 +1,70 @@
<?php
namespace ParseCsv\tests\methods;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class ConstructTest extends TestCase {
/**
* @var Csv object
*/
protected $csv = null;
public function test_offset_param() {
$offset = 10;
$this->csv = new Csv(null, $offset);
$this->assertTrue(is_numeric($this->csv->offset));
$this->assertEquals($offset, $this->csv->offset);
}
public function test_limit_param() {
$limit = 10;
$this->csv = new Csv(null, null, $limit);
$this->assertTrue(is_numeric($this->csv->limit));
$this->assertEquals($limit, $this->csv->limit);
}
public function test_conditions_param() {
$conditions = 'some column NOT value';
$this->csv = new Csv(null, null, null, $conditions);
$this->assertTrue(is_string($this->csv->conditions));
$this->assertEquals($conditions, $this->csv->conditions);
}
public function test_keep_file_data_param() {
$keep = true;
$this->csv = new Csv(null, null, null, null, $keep);
$this->assertTrue(is_bool($this->csv->keep_file_data));
$this->assertEquals($keep, $this->csv->keep_file_data);
}
public function test_input_param() {
$csv = "col1,col2,col3\r\nval1,val2,val3\r\nval1A,val2A,val3A\r\n";
$this->csv = new Csv($csv, null, null, null, true);
$this->assertTrue(is_string($this->csv->file_data));
$this->assertEquals($csv, $this->csv->file_data);
}
/**
* @runInSeparateProcess because download.php uses header()
*
* @see https://github.com/sebastianbergmann/phpunit/issues/720#issuecomment-10421092
*/
public function testCodeExamples() {
chdir('examples');
foreach (glob('*.php') as $script_file) {
ob_start();
/** @noinspection PhpIncludeInspection */
require $script_file;
$ob_get_clean = ob_get_clean();
$verb = strtok($script_file, '_.');
if (!in_array($verb, ['download', 'save'], true)) {
$this->assertContains('<td>', $ob_get_clean);
}
}
chdir('..');
}
}
@@ -0,0 +1,82 @@
<?php
namespace ParseCsv\tests\methods;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class DataRowCountTest extends TestCase {
/**
* CSV
* The CSV object
*
* @access protected
* @var Csv
*/
protected $csv;
/**
* Setup
* Setup our test environment objects
*
* @access public
*/
public function setUp() {
$this->csv = new Csv();
}
public function countRowsProvider() {
return [
'auto-double-enclosure' => [
'auto-double-enclosure.csv',
2,
],
'auto-single-enclosure' => [
'auto-single-enclosure.csv',
2,
],
'UTF-8_sep_row' => [
'datatype.csv',
3,
],
];
}
/**
* @dataProvider countRowsProvider
*
* @param string $file
* @param int $expectedRows
*/
public function testGetTotalRowCountFromFile($file, $expectedRows) {
$this->csv->heading = true;
$this->csv->load_data(__DIR__ . '/fixtures/' . $file);
$this->assertEquals($expectedRows, $this->csv->getTotalDataRowCount());
}
public function testGetTotalRowCountMissingEndingLineBreak() {
$this->csv->heading = false;
$this->csv->enclosure = '"';
$sInput = "86545235689,a\r\n34365587654,b\r\n13469874576,\"c\r\nd\"";
$this->csv->load_data($sInput);
$this->assertEquals(3, $this->csv->getTotalDataRowCount());
}
public function testGetTotalRowCountSingleEnclosure() {
$this->csv->heading = false;
$this->csv->enclosure = "'";
$sInput = "86545235689,a\r\n34365587654,b\r\n13469874576,\'c\r\nd\'";
$this->csv->load_data($sInput);
$this->assertEquals(3, $this->csv->getTotalDataRowCount());
}
public function testGetTotalRowCountSingleRow() {
$this->csv->heading = false;
$this->csv->enclosure = "'";
$sInput = "86545235689";
$this->csv->load_data($sInput);
$this->assertEquals(1, $this->csv->getTotalDataRowCount());
}
}
@@ -0,0 +1,69 @@
<?php
/**
* Created by PhpStorm.
* User: sgorzaly
* Date: 19.02.18
* Time: 20:52
*/
namespace ParseCsv\tests\methods;
use ParseCsv\enums\DatatypeEnum;
use PHPUnit\Framework\TestCase;
class DatatypeTest extends TestCase {
public function testSampleIsValidInteger() {
$this->assertEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('1'));
$this->assertEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('+1'));
$this->assertEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('-1'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('--1'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('test'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('1.0'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('1,0'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('1,1'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('0.1'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('true'));
$this->assertNotEquals(DatatypeEnum::TYPE_INT, DatatypeEnum::getValidTypeFromSample('2018-02-19'));
}
public function testSampleIsValidBool() {
$this->assertEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('true'));
$this->assertEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('TRUE'));
$this->assertEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('false'));
$this->assertEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('FALSE'));
$this->assertNotEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('FALS'));
$this->assertNotEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('test'));
$this->assertNotEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('0'));
$this->assertNotEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('1'));
$this->assertNotEquals(DatatypeEnum::TYPE_BOOL, DatatypeEnum::getValidTypeFromSample('0.1'));
}
public function testSampleIsValidFloat() {
$this->assertEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1.0'));
$this->assertEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('-1.1'));
$this->assertEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('+1,1'));
$this->assertEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1,1'));
$this->assertEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1,1'));
$this->assertEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1e-03'));
$this->assertEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1e+03'));
$this->assertNotEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1'));
$this->assertNotEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('test'));
$this->assertNotEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1,,1'));
$this->assertNotEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('1..1'));
$this->assertNotEquals(DatatypeEnum::TYPE_FLOAT, DatatypeEnum::getValidTypeFromSample('2018-02-19'));
}
public function testSampleIsValidDate() {
$this->assertEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('2018-02-19'));
$this->assertEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('18-2-19'));
$this->assertEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('01.02.2018'));
$this->assertEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('1.2.18'));
$this->assertEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('07/31/2018'));
$this->assertNotEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('31/07/2018'));
$this->assertNotEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('1-2'));
$this->assertEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('1.2.'));
$this->assertNotEquals(DatatypeEnum::TYPE_DATE, DatatypeEnum::getValidTypeFromSample('test'));
}
}
@@ -0,0 +1,101 @@
<?php
namespace ParseCsv\tests\methods;
/**
* This is a very simple implementation of a stream wrapper. All URLs are mapped
* to just one buffer. It exists to prove that ParseCsv can read and write
* streams.
*
* @see https://www.php.net/manual/en/class.streamwrapper.php
*/
class ExampleStream {
private static $position = 0;
private static $stream_content;
public function stream_open($uri, $mode) {
if (strpos($mode, 'a') === false) {
self::$position = 0;
}
if (strpos($mode, 'w') !== false) {
self::$stream_content = '';
}
return true;
}
public function stream_read($count) {
$ret = substr(self::$stream_content, self::$position, $count);
self::$position += strlen($ret);
return $ret;
}
public function stream_write($data) {
$left = substr(self::$stream_content, 0, self::$position);
$right = substr(self::$stream_content, self::$position + strlen($data));
self::$stream_content = $left . $data . $right;
self::$position += strlen($data);
return strlen($data);
}
public function stream_stat() {
return ['size' => strlen(self::$stream_content)];
}
public function stream_tell() {
return self::$position;
}
public function stream_eof() {
return self::$position >= strlen(self::$stream_content);
}
public function url_stat() {
return ['size' => strlen(self::$stream_content)];
}
public function stream_seek($offset, $whence) {
switch ($whence) {
case SEEK_SET:
if ($offset < strlen(self::$stream_content) && $offset >= 0) {
self::$position = $offset;
return true;
} else {
return false;
}
break;
case SEEK_CUR:
if ($offset >= 0) {
self::$position += $offset;
return true;
} else {
return false;
}
break;
case SEEK_END:
if (strlen(self::$stream_content) + $offset >= 0) {
self::$position = strlen(self::$stream_content) + $offset;
return true;
} else {
return false;
}
break;
default:
return false;
}
}
public function stream_lock($operation) {
return true;
}
public function stream_metadata() {
return false;
}
}
@@ -0,0 +1,13 @@
<?php
namespace ParseCsv\tests\methods;
/**
* Class HasToString is just a helper to test if cells can be objects.
*/
class ObjectThatHasToStringMethod {
public function __toString() {
return 'some value';
}
}
@@ -0,0 +1,45 @@
<?php
namespace ParseCsv\tests\methods;
use PHPUnit\Framework\TestCase;
/**
* This test checks for backwards compatibility: Does it work to
* - require the old "parsecsv.lib.php" instead of composer autoloading?
* - use the old class name "parseCSV"?
*/
class OldRequireTest extends TestCase {
protected function setUp() {
rename('vendor/autoload.php', '__autoload');
}
protected function tearDown() {
rename('__autoload', 'vendor/autoload.php');
}
/**
* @runInSeparateProcess so that disabled autoloading has an effect
*/
public function testOldLibWithoutComposer() {
file_put_contents('__eval.php', '<?php require "parsecsv.lib.php"; new \ParseCsv\Csv;');
exec("php __eval.php", $output, $return_var);
unlink('__eval.php');
$this->assertEquals($output, []);
$this->assertEquals(0, $return_var);
}
/**
* @runInSeparateProcess so that disabled autoloading has an effect
*/
public function testOldLibWithOldClassName() {
file_put_contents('__eval.php', '<?php require "parsecsv.lib.php"; new parseCSV;');
exec("php __eval.php", $output, $return_var);
unlink('__eval.php');
$this->assertEquals($output, []);
$this->assertEquals(0, $return_var);
}
}
@@ -0,0 +1,21 @@
<?php
namespace ParseCsv\tests\methods;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class OutputTest extends TestCase {
/**
* @runInSeparateProcess because download.php uses header()
*/
public function testOutputWithFourParameters() {
$csv = new Csv();
$data = [0 => ['a', 'b', 'c'], 1 => ['d', 'e', 'f']];
$fields = ['col1', 'col2', 'col3'];
$output = $csv->output('test.csv', $data, $fields, ',');
$expected = "col1,col2,col3\ra,b,c\rd,e,f\r";
self::assertEquals($expected, $output);
}
}
+299
View File
@@ -0,0 +1,299 @@
<?php
namespace ParseCsv\tests\methods;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class ParseTest extends TestCase {
/**
* @var Csv object
*/
protected $csv;
/**
* Setup
* Setup our test environment objects
*
* @access public
*/
public function setUp() {
$this->csv = new Csv();
}
public function testParse() {
// can we trick 'is_readable' into whining? See #67.
$this->parseRepetitiveString('c:/looks/like/a/path');
$this->parseRepetitiveString('http://looks/like/an/url');
}
private function parseRepetitiveString($content) {
$this->csv->delimiter = ';';
$this->csv->heading = false;
$success = $this->csv->parse(str_repeat($content . ';', 500));
$this->assertEquals(true, $success);
$row = array_pop($this->csv->data);
$expected_data = array_fill(0, 500, $content);
$expected_data [] = '';
$this->assertEquals($expected_data, $row);
}
/**
* @depends testParse
*
* @dataProvider autoDetectionProvider
*
* @param string $file
*/
public function testSepRowAutoDetection($file) {
// This file (parse_test.php) is encoded in UTF-8, hence comparison will
// fail unless we to this:
$this->csv->output_encoding = 'UTF-8';
$this->csv->auto($file);
$this->assertEquals($this->_get_magazines_data(), $this->csv->data);
}
public function autoDetectionProvider() {
return [
'UTF8_no_BOM' => [__DIR__ . '/../example_files/UTF-8_sep_row_but_no_BOM.csv'],
'UTF8' => [__DIR__ . '/../example_files/UTF-8_with_BOM_and_sep_row.csv'],
'UTF16' => [__DIR__ . '/../example_files/UTF-16LE_with_BOM_and_sep_row.csv'],
];
}
public function testSingleColumnWithZeros() {
$this->csv->delimiter = null;
$this->csv->parse("URL\nhttp://www.amazon.com/ROX-Ice-Ball-Maker-Original/dp/B00MX59NMQ/ref=sr_1_1?ie=UTF8&qid=1435604374&sr=8-1&keywords=rox,+ice+molds");
$row = array_pop($this->csv->data);
$expected_data = ['URL' => 'http://www.amazon.com/ROX-Ice-Ball-Maker-Original/dp/B00MX59NMQ/ref=sr_1_1?ie=UTF8&qid=1435604374&sr=8-1&keywords=rox,+ice+molds'];
$this->assertEquals($expected_data, $row);
}
public function testAllNumericalCsv() {
$this->csv->heading = false;
$sInput = "86545235689\r\n34365587654\r\n13469874576";
$this->assertEquals(false, $this->csv->auto($sInput));
$this->assertEquals(null, $this->csv->delimiter);
$expected_data = explode("\r\n", $sInput);
$actual_data = array_map('reset', $this->csv->data);
$this->assertEquals($expected_data, $actual_data);
}
public function testMissingEndingLineBreak() {
$this->csv->heading = false;
$this->csv->enclosure = '"';
$sInput = "86545235689,a\r\n34365587654,b\r\n13469874576,\"c\r\nd\"";
$expected_data = [86545235689, 34365587654, 13469874576];
$actual_data = $this->invokeMethod($this->csv, '_parse_string', array($sInput));
$actual_column = array_map('reset', $actual_data);
$this->assertEquals($expected_data, $actual_column);
$this->assertEquals([
'a',
'b',
"c\r\nd",
], array_map('next', $actual_data));
}
public function testSingleColumn() {
$this->csv->auto(__DIR__ . '/../example_files/single_column.csv');
$expected = [
['SMS' => '0444'],
['SMS' => '5555'],
['SMS' => '6606'],
['SMS' => '7777'],
];
$this->assertEquals($expected, $this->csv->data);
}
public function testMatomoData() {
// Matomo (Piwik) export cannot be read with
$this->csv->use_mb_convert_encoding = true;
$this->csv->output_encoding = 'UTF-8';
$this->csv->auto(__DIR__ . '/../example_files/Piwik_API_download.csv');
$aAction27 = array_column($this->csv->data, 'url (actionDetails 27)');
$this->assertEquals([
'http://application/_Main/_GraphicMeanSTD_MDI/btnConfBandOptions',
'',
'',
], $aAction27);
$aCity = array_column($this->csv->data, 'city');
$this->assertEquals([
'São Paulo',
'Johannesburg',
'',
], $aCity);
}
/**
* Tests if we can handle BOMs in string data, in contrast to loading files.
*/
public function testStringWithLeadingBOM() {
$string_with_bom = strtr(
file_get_contents(__DIR__ . '/../example_files/UTF-8_with_BOM_and_sep_row.csv'),
["sep=;\n" => '']);
// Is the BOM still there?
self::assertSame(0xEF, ord($string_with_bom));
$this->csv->output_encoding = 'UTF-8';
$this->csv->delimiter = ';';
self::assertTrue($this->csv->load_data($string_with_bom));
self::assertTrue($this->csv->parse($this->csv->file_data));
// This also tests if ::load_data removed the BOM from the data;
// otherwise the 'title' column would have 3 extra bytes.
$this->assertEquals([
'title',
'isbn',
'publishedAt',
], array_keys(reset($this->csv->data)));
$titles = array_column($this->csv->data, 'title');
$this->assertEquals([
'Красивая кулинария',
'The Wine Connoisseurs',
'Weißwein',
], $titles);
}
public function testWithMultipleNewlines() {
$this->csv->auto(__DIR__ . '/../example_files/multiple_empty_lines.csv');
$aElse9 = array_column($this->csv->data, 'else9');
/** @noinspection SpellCheckingInspection */
$this->assertEquals([
'Abweichung',
'Abweichung',
'Abweichung',
'Alt',
'Fehlt',
'Neu',
'OK',
'Fehlt',
'Fehlt',
'Fehlt',
], $aElse9);
}
/**
* @depends testSepRowAutoDetection
*/
public function testGetColumnDatatypes() {
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
$this->csv->getDatatypes();
$expected = [
'title' => 'string',
'isbn' => 'string',
'publishedAt' => 'date',
'published' => 'boolean',
'count' => 'integer',
'price' => 'float',
];
$this->assertEquals($expected, $this->csv->data_types);
}
/**
* @depends testSepRowAutoDetection
*/
public function testAutoDetectFileHasHeading() {
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
$this->assertTrue($this->csv->autoDetectFileHasHeading());
$this->csv->heading = false;
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
$this->assertTrue($this->csv->autoDetectFileHasHeading());
$this->csv->heading = false;
$sInput = "86545235689\r\n34365587654\r\n13469874576";
$this->csv->auto($sInput);
$this->assertFalse($this->csv->autoDetectFileHasHeading());
$this->csv->heading = true;
$sInput = "86545235689\r\n34365587654\r\n13469874576";
$this->csv->auto($sInput);
$this->assertFalse($this->csv->autoDetectFileHasHeading());
}
public function testVeryLongNonExistingFile() {
$this->csv->parse(str_repeat('long_string', PHP_MAXPATHLEN));
$this->csv->auto(str_repeat('long_string', PHP_MAXPATHLEN));
}
protected function _get_magazines_data() {
return [
[
'title' => 'Красивая кулинария',
'isbn' => '5454-5587-3210',
'publishedAt' => '21.05.2011',
],
[
'title' => 'The Wine Connoisseurs',
'isbn' => '2547-8548-2541',
'publishedAt' => '12.12.2011',
],
[
'title' => 'Weißwein',
'isbn' => '1313-4545-8875',
'publishedAt' => '23.02.2012',
],
];
}
public function autoQuotesDataProvider() {
return array(
array('auto-double-enclosure.csv', '"'),
array('auto-single-enclosure.csv', "'"),
);
}
/**
* @depends testSepRowAutoDetection
*
* @dataProvider autoQuotesDataProvider
*
* @param string $file
* @param string $enclosure
*/
public function testAutoQuotes($file, $enclosure) {
$csv = new Csv();
$csv->auto(__DIR__ . '/fixtures/' . $file, true, null, null, $enclosure);
$this->assertArrayHasKey('column1', $csv->data[0], 'Data parsed incorrectly with enclosure ' . $enclosure);
$this->assertEquals('value1', $csv->data[0]['column1'], 'Data parsed incorrectly with enclosure ' . $enclosure);
}
/**
* Call protected/private method of a class.
*
* @param object &$object Instantiated object that we will run method on.
* @param string $methodName Method name to call
* @param array $parameters Array of parameters to pass into method.
*
* @return mixed Method return.
*/
private function invokeMethod(&$object, $methodName, array $parameters = array()) {
$reflection = new \ReflectionClass(get_class($object));
$method = $reflection->getMethod($methodName);
$method->setAccessible(true);
return $method->invokeArgs($object, $parameters);
}
public function testWaiverFieldSeparator() {
$this->assertSame(false, $this->csv->auto(__DIR__ . '/../example_files/waiver_field_separator.csv'));
$expected = [
'liability waiver',
'release of liability form',
'release of liability',
'sample waiver',
'sample waiver form',
];
$actual = array_column($this->csv->data, 'keyword');
$this->assertSame($expected, $actual);
}
}
+77
View File
@@ -0,0 +1,77 @@
<?php
namespace ParseCsv\tests\methods;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class SaveTest extends TestCase {
/** @var Csv */
private $csv;
private $temp_filename;
/**
* Setup our test environment objects; will be called before each test.
*/
public function setUp() {
$this->csv = new Csv();
$this->csv->auto(__DIR__ . '/../example_files/single_column.csv');
// Remove last 2 lines to simplify comparison
unset($this->csv->data[2], $this->csv->data[3]);
$temp_dir = str_replace("\\", '/', sys_get_temp_dir());
if (substr($temp_dir, -1) != '/') {
// From the PHP.net documentation:
// This function does not always add trailing slash. This behaviour
// is inconsistent across systems.
$temp_dir .= '/';
}
$this->temp_filename = $temp_dir . 'parsecsv_test_file.csv';
}
public function testSaveWithDefaultSettings() {
$expected = "SMS\r0444\r5555\r";
$this->saveAndCompare($expected);
}
public function testSaveWithDosLineEnding() {
$this->csv->linefeed = "\r\n";
$expected = "SMS\r\n0444\r\n5555\r\n";
$this->saveAndCompare($expected);
}
public function testSaveWithUnixLineEnding() {
$this->csv->linefeed = "\n";
$expected = "SMS\n0444\n5555\n";
$this->saveAndCompare($expected);
}
public function testSaveWithNewHeader() {
$this->csv->linefeed = "\n";
$this->csv->titles = array("NewTitle");
$expected = "NewTitle\n0444\n5555\n";
$this->saveAndCompare($expected);
}
public function testSaveWithoutHeader() {
$this->csv->linefeed = "\n";
$this->csv->heading = false;
$expected = "0444\n5555\n";
$this->saveAndCompare($expected);
}
public function testAllQuotes() {
$this->csv->enclose_all = true;
$expected = "\"SMS\"\r\"0444\"\r\"5555\"\r";
$this->saveAndCompare($expected);
}
private function saveAndCompare($expected) {
$this->csv->save($this->temp_filename);
$content = file_get_contents($this->temp_filename);
$this->assertEquals($expected, $content);
}
}
@@ -0,0 +1,71 @@
<?php
namespace ParseCsv\tests\methods;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
/**
* Writes roughly 1 MB of data. This is useful because of a limit of 8 KB
* encountered with stream operations in certain PHP versions.
*/
class StreamTest extends TestCase {
public function setUp() {
static $done;
if ($done) {
// Make sure we register the stream just once - or PHP will scream.
return;
}
stream_wrapper_register("example", ExampleStream::class)
or die("Failed to register protocol");
$done = 1;
}
public function testReadStream() {
$csv = new Csv();
// Write data to our stream:
$filename = 'example://tmp';
copy(__DIR__ . '/fixtures/datatype.csv', $filename);
$many_dots = str_repeat('.', 1000 * 1000) . ";;;;;\n";
file_put_contents($filename, $many_dots, FILE_APPEND);
self::assertSame(';', $csv->auto(file_get_contents($filename)));
self::assertCount(4, $csv->data);
self::assertCount(6, reset($csv->data));
}
public function testWriteStream() {
$csv = new Csv();
$csv->linefeed = "\n";
$many_dots = str_repeat('.', 1000 * 1000);
$csv->data = [
[
'Name' => 'Rudolf',
'Question' => 'Which color is his nose?',
],
[
'Name' => 'Sponge Bob',
'Question' => 'Which shape are his pants?',
],
[
'Name' => $many_dots,
'Question' => 'Can you count one million dots?',
],
];
// Just export the first column, but with a new name
$csv->titles = ['Name' => 'Character'];
// Write data to our stream:
$filename = 'example://data';
copy(__DIR__ . '/fixtures/datatype.csv', $filename);
self::assertSame(true, $csv->save($filename));
$expected = "Character\nRudolf\nSponge Bob\n";
$expected .= $many_dots . "\n";
self::assertSame($expected, file_get_contents($filename));
}
}
@@ -0,0 +1,108 @@
<?php
namespace ParseCsv\tests\methods;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class UnparseTest extends Testcase {
/** @var Csv */
private $csv;
/**
* Setup our test environment objects; will be called before each test.
*/
public function setUp() {
$this->csv = new Csv();
$this->csv->auto(__DIR__ . '/fixtures/auto-double-enclosure.csv');
}
public function testUnparseWithParameters() {
$fields = array('a' => 'AA', 'b' => 'BB');
$data = [['a' => 'value1', 'b' => 'value2']];
$csv_object = new Csv();
$csv_string = $csv_object->unparse($data, $fields);
$this->assertEquals("AA,BB\rvalue1,value2\r", $csv_string);
$csv_object = new Csv();
$csv_object->linefeed = "\n";
$csv_string = $csv_object->unparse([[55, 66]]);
$this->assertEquals("55,66\n", $csv_string);
$csv_object = new Csv();
$data2 = [['a' => "multi\rline", 'b' => 'value2']];
$csv_object->enclosure = "'";
$csv_string = $csv_object->unparse($data2, $fields);
$this->assertEquals("AA,BB\r'multi\rline',value2\r", $csv_string);
}
public function testUnparseDefault() {
$expected = "column1,column2\rvalue1,value2\rvalue3,value4\r";
$this->unparseAndCompare($expected);
}
public function testUnparseDefaultWithoutHeading() {
$this->csv->heading = false;
$this->csv->auto(__DIR__ . '/fixtures/auto-double-enclosure.csv');
$expected = "column1,column2\rvalue1,value2\rvalue3,value4\r";
$this->unparseAndCompare($expected);
}
public function testUnparseRenameFields() {
$expected = "C1,C2\rvalue1,value2\rvalue3,value4\r";
$this->unparseAndCompare($expected, array("C1", "C2"));
}
public function testReorderFields() {
$expected = "column2,column1\rvalue2,value1\rvalue4,value3\r";
$this->unparseAndCompare($expected, array("column2", "column1"));
}
public function testSubsetFields() {
$expected = "column1\rvalue1\rvalue3\r";
$this->unparseAndCompare($expected, array("column1"));
}
public function testReorderAndRenameFields() {
$fields = array(
'column2' => 'C2',
'column1' => 'C1',
);
$expected = "C2,C1\rvalue2,value1\rvalue4,value3\r";
$this->unparseAndCompare($expected, $fields);
}
public function testUnparseDefaultFirstRowMissing() {
unset($this->csv->data[0]);
$expected = "column1,column2\rvalue3,value4\r";
$this->unparseAndCompare($expected);
}
public function testUnparseDefaultWithoutData() {
unset($this->csv->data[0]);
unset($this->csv->data[1]);
$expected = "column1,column2\r";
$this->unparseAndCompare($expected);
}
public function testObjectCells() {
$this->csv->data = [
[
'column1' => new ObjectThatHasToStringMethod(),
'column2' => 'boring',
],
];
$this->csv->linefeed = "\n";
$expected = "column1,column2\nsome value,boring\n";
$this->unparseAndCompare($expected);
}
private function unparseAndCompare($expected, $fields = array()) {
$str = $this->csv->unparse($this->csv->data, $fields);
$this->assertEquals($expected, $str);
}
}
@@ -0,0 +1,3 @@
"column1","column2"
"value1","value2"
"value3","value4"
1 column1 column2
2 value1 value2
3 value3 value4
@@ -0,0 +1,3 @@
'column1','column2'
'value1','value2'
'value3','value4'
1 'column1' 'column2'
2 'value1' 'value2'
3 'value3' 'value4'
@@ -0,0 +1,5 @@
sep=;
title;isbn;publishedAt;published;count;price
Красивая кулинария;5454-5587-3210;21.05.2011;true;1;10.99
The Wine Connoisseurs;2547-8548-2541;12.12.2011;TRUE;;20.33
Weißwein;1313-4545-8875;23.02.2012;false;10;10
1 sep=;
2 title;isbn;publishedAt;published;count;price
3 Красивая кулинария;5454-5587-3210;21.05.2011;true;1;10.99
4 The Wine Connoisseurs;2547-8548-2541;12.12.2011;TRUE;;20.33
5 Weißwein;1313-4545-8875;23.02.2012;false;10;10
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="Bootstrap.php"
colors="false"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnError="true"
stopOnFailure="true"
stopOnIncomplete="true"
stopOnSkipped="false">
<testsuites>
<testsuite name="parseCSV Test Suite">
<directory suffix="est.php">properties/</directory>
<directory suffix="est.php">methods/</directory>
</testsuite>
</testsuites>
</phpunit>
@@ -0,0 +1,33 @@
<?php
namespace ParseCsv\tests\properties;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class BaseClass extends TestCase {
/**
* CSV
* The parseCSV object
*
* @var Csv
*/
protected $csv;
/**
* Setup
* Setup our test environment objects
*/
protected function setUp() {
$this->csv = new Csv();
}
protected function _compareWithExpected($expected) {
$this->csv->auto(__DIR__ . '/../../examples/_books.csv');
$actual = array_map(function ($row) {
return $row['title'];
}, $this->csv->data);
$this->assertEquals($expected, array_values($actual));
}
}
@@ -0,0 +1,121 @@
<?php
namespace ParseCsv\tests\properties;
class ConditionsTest extends BaseClass {
public function testNotDanBrown() {
$this->csv->conditions = 'author does not contain dan brown';
$this->_compareWithExpected([
'The Killing Kind',
'The Third Secret',
'The Last Templar',
'The Traveller',
'Crisis Four',
'Prey',
'The Broker (Paperback)',
'Without Blood (Paperback)',
'State of Fear (Paperback)',
'The Rule of Four (Paperback)',
]);
}
public function testRatingEquals() {
$rating_of_3 = [
'The Last Templar',
'The Broker (Paperback)',
'Without Blood (Paperback)',
];
$this->csv->conditions = 'rating = 3';
$this->_compareWithExpected($rating_of_3);
$this->csv->conditions = 'rating is 3';
$this->_compareWithExpected($rating_of_3);
$this->csv->conditions = 'rating equals 3';
$this->_compareWithExpected($rating_of_3);
}
public function testRatingNotEquals() {
$rating_not_4 = [
'The Killing Kind',
'The Third Secret',
'The Last Templar',
'The Traveller',
'Prey',
'The Broker (Paperback)',
'Without Blood (Paperback)',
'State of Fear (Paperback)',
'Digital Fortress : A Thriller (Mass Market Paperback)',
'Angels & Demons (Mass Market Paperback)',
];
// $this->csv->conditions = 'rating != 4';
// $this->_compareWithExpected($rating_not_4);
$this->csv->conditions = 'rating is not 4';
$this->_compareWithExpected($rating_not_4);
// $this->csv->conditions = 'rating does not contain 4';
// $this->_compareWithExpected($rating_not_4);
}
public function testRatingLessThan() {
$less_than_1 = [
'The Killing Kind',
'The Third Secret',
];
$this->csv->conditions = 'rating < 1';
$this->_compareWithExpected($less_than_1);
$this->csv->conditions = 'rating is less than 1';
$this->_compareWithExpected($less_than_1);
}
public function testRatingLessOrEquals() {
$less_or_equals_1 = [
'The Killing Kind',
'The Third Secret',
];
$this->csv->conditions = 'rating <= 1';
$this->_compareWithExpected($less_or_equals_1);
$this->csv->conditions = 'rating is less than or equals 1';
$this->_compareWithExpected($less_or_equals_1);
}
public function testRatingGreaterThan() {
$greater_4 = [
'The Traveller',
'Prey',
'State of Fear (Paperback)',
'Digital Fortress : A Thriller (Mass Market Paperback)',
'Angels & Demons (Mass Market Paperback)',
];
$this->csv->conditions = 'rating > 4';
$this->_compareWithExpected($greater_4);
$this->csv->conditions = 'rating is greater than 4';
$this->_compareWithExpected($greater_4);
}
public function testRatingGreaterOrEquals() {
$greater_or_equal_4 = [
'The Traveller',
'Crisis Four',
'Prey',
'State of Fear (Paperback)',
'The Rule of Four (Paperback)',
'Deception Point (Paperback)',
'Digital Fortress : A Thriller (Mass Market Paperback)',
'Angels & Demons (Mass Market Paperback)',
'The Da Vinci Code (Hardcover)',
];
$this->csv->conditions = 'rating >= 4';
$this->_compareWithExpected($greater_or_equal_4);
$this->csv->conditions = 'rating is greater than or equals 4';
$this->_compareWithExpected($greater_or_equal_4);
}
public function testTitleContainsSecretOrCode() {
$this->csv->conditions = 'title contains code OR title contains SECRET';
$this->_compareWithExpected([
'The Third Secret',
'The Da Vinci Code (Hardcover)',
]);
}
}
@@ -0,0 +1,167 @@
<?php
namespace ParseCsv\tests\properties;
use ParseCsv\Csv;
use PHPUnit\Framework\TestCase;
class DefaultValuesPropertiesTest extends TestCase {
/**
* CSV
* The parseCSV object
*
* @access protected
* @var Csv
*/
protected $csv = null;
/**
* Setup
* Setup our test environment objects
*
* @access public
*/
public function setUp() {
//setup parse CSV
$this->csv = new Csv();
}
/**
* Tear down
* Tear down our test environment objects
*
* @access public
*/
public function tearDown() {
$this->csv = null;
}
public function test_heading_default() {
$this->assertTrue(is_bool($this->csv->heading));
$this->assertTrue($this->csv->heading);
}
public function test_fields_default() {
$this->assertTrue(is_array($this->csv->fields));
$this->assertCount(0, $this->csv->fields);
}
public function test_sort_by_default() {
$this->assertNull($this->csv->sort_by);
}
public function test_sort_reverse_default() {
$this->assertTrue(is_bool($this->csv->sort_reverse));
$this->assertFalse($this->csv->sort_reverse);
}
public function test_sort_type_default() {
$this->assertEquals('regular', $this->csv->sort_type);
}
public function test_delimiter_default() {
$this->assertTrue(is_string($this->csv->delimiter));
$this->assertEquals(',', $this->csv->delimiter);
}
public function test_enclosure_default() {
$this->assertTrue(is_string($this->csv->enclosure));
$this->assertEquals('"', $this->csv->enclosure);
}
public function test_enclose_all_default() {
$this->assertTrue(is_bool($this->csv->enclose_all));
$this->assertFalse($this->csv->enclose_all);
}
public function test_conditions_default() {
$this->assertNull($this->csv->conditions);
}
public function test_offset_default() {
$this->assertNull($this->csv->offset);
}
public function test_limit_default() {
$this->assertNull($this->csv->limit);
}
public function test_auto_depth_default() {
$this->assertTrue(is_numeric($this->csv->auto_depth));
$this->assertEquals(15, $this->csv->auto_depth);
}
public function test_auto_non_chars_default() {
$this->assertTrue(is_string($this->csv->auto_non_chars));
$this->assertEquals("a-zA-Z0-9\n\r", $this->csv->auto_non_chars);
}
public function test_auto_preferred_default() {
$this->assertTrue(is_string($this->csv->auto_preferred));
$this->assertEquals(",;\t.:|", $this->csv->auto_preferred);
}
public function test_convert_encoding_default() {
$this->assertTrue(is_bool($this->csv->convert_encoding));
$this->assertFalse($this->csv->convert_encoding);
}
public function test_input_encoding_default() {
$this->assertTrue(is_string($this->csv->input_encoding));
$this->assertEquals('ISO-8859-1', $this->csv->input_encoding);
}
public function test_output_encoding_default() {
$this->assertTrue(is_string($this->csv->output_encoding));
$this->assertEquals('ISO-8859-1', $this->csv->output_encoding);
}
public function test_linefeed_default() {
$this->assertTrue(is_string($this->csv->linefeed));
$this->assertEquals("\r", $this->csv->linefeed);
}
public function test_output_delimiter_default() {
$this->assertTrue(is_string($this->csv->output_delimiter));
$this->assertEquals(',', $this->csv->output_delimiter);
}
public function test_output_filename_default() {
$this->assertTrue(is_string($this->csv->output_filename));
$this->assertEquals('data.csv', $this->csv->output_filename);
}
public function test_keep_file_data_default() {
$this->assertTrue(is_bool($this->csv->keep_file_data));
$this->assertFalse($this->csv->keep_file_data);
}
public function test_file_default() {
$this->assertNull($this->csv->file);
}
public function test_file_data_default() {
$this->assertNull($this->csv->file_data);
}
public function test_error_default() {
$this->assertTrue(is_numeric($this->csv->error));
$this->assertEquals(0, $this->csv->error);
}
public function test_error_info_default() {
$this->assertTrue(is_array($this->csv->error_info));
$this->assertCount(0, $this->csv->error_info);
}
public function test_titles_default() {
$this->assertTrue(is_array($this->csv->titles));
$this->assertCount(0, $this->csv->titles);
}
public function test_data_default() {
$this->assertTrue(is_array($this->csv->data));
$this->assertCount(0, $this->csv->data);
}
}
@@ -0,0 +1,79 @@
<?php
namespace ParseCsv\tests\properties;
/**
* Tests related to the $offset property
*/
class OffsetTest extends BaseClass {
public function testOffsetOfOne() {
$this->csv->offset = 1;
$this->csv->auto(__DIR__ . '/../methods/fixtures/datatype.csv');
$this->assertCount(3, $this->csv->data);
if (!function_exists('array_column')) {
// function only available in PHP >= 5.5
return;
}
$expected = [
'Красивая кулинария',
'The Wine Connoisseurs',
'Weißwein',
];
$actual = array_column($this->csv->data, 'title');
$this->assertEquals($expected, $actual);
}
public function numberRangeZeroToFourProvider() {
return array_map(function ($number) {
return [$number];
}, range(0, 4));
}
/**
* @dataProvider numberRangeZeroToFourProvider
*
* @param integer $offset
*/
public function testOffsetOfOneNoHeader($offset) {
$this->csv->offset = $offset;
$this->csv->heading = false;
$this->csv->auto(__DIR__ . '/../methods/fixtures/datatype.csv');
$this->assertCount(4 - $offset, $this->csv->data);
}
public function testDataArrayKeysWhenSettingOffsetWithHeading() {
$this->csv->offset = 2;
$this->csv->auto(__DIR__ . '/../methods/fixtures/datatype.csv');
$expected = [
[
'title' => 'The Wine Connoisseurs',
'isbn' => '2547-8548-2541',
'publishedAt' => '12.12.2011',
'published' => 'TRUE',
'count' => '',
'price' => 20.33,
],
[
'title' => 'Weißwein',
'isbn' => '1313-4545-8875',
'publishedAt' => '23.02.2012',
'published' => 'false',
'count' => 10,
'price' => 10,
],
];
$this->assertEquals($expected, $this->csv->data);
}
public function testDataArrayKeysWhenSettingOffsetWithoutHeading() {
$this->csv->heading = false;
$this->csv->offset = 2;
$this->csv->auto(__DIR__ . '/../methods/fixtures/datatype.csv');
$expected = range(0, 5, 1);
$this->assertEquals($expected, array_keys($this->csv->data[0]));
}
}
@@ -0,0 +1,171 @@
<?php
namespace ParseCsv\tests\properties;
use ParseCsv\Csv;
use ParseCsv\enums\SortEnum;
use PHPUnit\Framework\TestCase;
class PublicPropertiesTest extends TestCase {
/**
* CSV
* The parseCSV object
*
* @access protected
* @var Csv
*/
protected $csv = null;
/**
* Reflection Object
* The reflection class object
*
* @access protected
* @var \ReflectionClass
*/
protected $reflection = null;
/**
* Reflection Properties
* The reflected class properties
*
* @var \ReflectionProperty[]
* @access protected
*/
protected $properties = null;
/**
* Setup
* Setup our test environment objects
*
* @access public
*/
public function setUp() {
//setup parse CSV
$this->csv = new Csv();
//setup the reflection class
$this->reflection = new \ReflectionClass($this->csv);
//setup the reflected class properties
$this->properties = $this->reflection->getProperties();
}
/**
* Tear down
* Tear down our test environment objects
*
* @access public
*/
public function tearDown() {
$this->csv = null;
$this->reflection = null;
$this->properties = null;
}
/**
* test_propertiesCount
* Counts the number of properties to make sure we didn't add or
* subtract any without thinking
*
* @access public
*/
public function test_propertiesCount() {
$this->assertCount(29, $this->properties);
}
/**
* test_property_names
* We have an expected set of properties that should exists
* Make sure our expected number of properties matches the real
* count of properties and also check to make sure our expected
* properties exists within the class
*
* @access public
*/
public function test_property_names() {
//set our expected properties name(s)
$expected_names = array(
'heading',
'fields',
'sort_by',
'sort_reverse',
'sort_type',
'delimiter',
'enclosure',
'enclose_all',
'conditions',
'offset',
'limit',
'auto_depth',
'auto_non_chars',
'auto_preferred',
'convert_encoding',
'input_encoding',
'output_encoding',
'use_mb_convert_encoding',
'linefeed',
'output_delimiter',
'output_filename',
'keep_file_data',
'file',
'file_data',
'error',
'error_info',
'titles',
'data',
'data_types',
);
// Find our real properties
$real_properties = array_map(function (\ReflectionProperty $property) {
return $property->getName();
}, $this->properties);
// Lets make sure our expected matches the number of real properties
$this->assertEquals($expected_names, $real_properties);
}
/**
* test_count_public_properties
* We at this point only have public properties so
* lets verify all properties are public
*
* @access public
*/
public function test_count_public_properties() {
$counter = 0;
$propertiesCount = count($this->properties);
for ($a = 0; $a < $propertiesCount; $a++) {
if ($this->properties[$a]->isPublic() === true) {
$counter++;
}
}
$this->assertCount($counter, $this->properties);
}
public function testDefaultSortTypeIsRegular() {
$this->assertEquals(SortEnum::SORT_TYPE_REGULAR, $this->csv->sort_type);
}
public function testSetSortType() {
$this->csv->sort_type = 'numeric';
$this->assertEquals(SortEnum::SORT_TYPE_NUMERIC, $this->csv->sort_type);
$this->csv->sort_type = 'string';
$this->assertEquals(SortEnum::SORT_TYPE_STRING, $this->csv->sort_type);
}
public function testGetSorting() {
$this->csv->sort_type = 'numeric';
$sorting = SortEnum::getSorting($this->csv->sort_type);
$this->assertEquals(SORT_NUMERIC, $sorting);
$this->csv->sort_type = 'string';
$sorting = SortEnum::getSorting($this->csv->sort_type);
$this->assertEquals(SORT_STRING, $sorting);
}
}
@@ -0,0 +1,60 @@
<?php
namespace ParseCsv\tests\properties;
class SortByTest extends BaseClass {
public function testSortByRating() {
$this->csv->sort_by = 'rating';
$this->csv->conditions = 'title does not contain Blood';
$this->_compareWithExpected([
// Rating 0
'The Killing Kind',
'The Third Secret',
// Rating 3
'The Last Templar',
'The Broker (Paperback)',
// Rating 4
'Deception Point (Paperback)',
'The Rule of Four (Paperback)',
'The Da Vinci Code (Hardcover)',
// Rating 5
'State of Fear (Paperback)',
'Prey',
'Digital Fortress : A Thriller (Mass Market Paperback)',
'Angels & Demons (Mass Market Paperback)',
]);
}
public function testReverseSortByRating() {
$this->csv->sort_by = 'rating';
$this->csv->conditions =
'title does not contain Prey AND ' .
'title does not contain Fortress AND ' .
'title does not contain Blood AND ' .
'title does not contain Fear';
$this->csv->sort_reverse = true;
$this->_compareWithExpected([
// Rating 5
'Angels & Demons (Mass Market Paperback)',
'The Traveller',
// Rating 4
'The Da Vinci Code (Hardcover)',
'The Rule of Four (Paperback)',
'Deception Point (Paperback)',
// Rating 3
'The Broker (Paperback)',
'The Last Templar',
// Rating 0
'The Third Secret',
'The Killing Kind',
]);
}
}