diff --git a/4dev/tests/Convert/CoreLibsConvertStringsTest.php b/4dev/tests/Convert/CoreLibsConvertStringsTest.php
index 0b2f79a5..c6c92251 100644
--- a/4dev/tests/Convert/CoreLibsConvertStringsTest.php
+++ b/4dev/tests/Convert/CoreLibsConvertStringsTest.php
@@ -13,6 +13,8 @@ use PHPUnit\Framework\TestCase;
*/
final class CoreLibsConvertStringsTest extends TestCase
{
+ private const DATA_FOLDER = __DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR;
+
/**
* Undocumented function
*
@@ -330,6 +332,52 @@ final class CoreLibsConvertStringsTest extends TestCase
\CoreLibs\Convert\Strings::stripMultiplePathSlashes($input)
);
}
+
+ /**
+ * Undocumented function
+ *
+ * @return array
+ */
+ public function providerStripUTF8BomBytes(): array
+ {
+ return [
+ "utf8-bom" => [
+ "file" => "UTF8BOM.csv",
+ "expect" => "Asset Type,Epic,File Name\n",
+ ],
+ "utf8" => [
+ "file" => "UTF8.csv",
+ "expect" => "Asset Type,Epic,File Name\n",
+ ],
+ ];
+ }
+
+ /**
+ * test utf8 bom remove
+ *
+ * @covers ::stripUTF8BomBytes
+ * @dataProvider providerStripUTF8BomBytes
+ * @testdox stripUTF8BomBytes $file will be $expected [$_dataName]
+ *
+ * @param string $file
+ * @param string $expected
+ * @return void
+ */
+ public function testStripUTF8BomBytes(string $file, string $expected): void
+ {
+ // load sample file
+ if (!is_file(self::DATA_FOLDER . $file)) {
+ $this->markTestSkipped('File: ' . $file . ' could not be opened');
+ }
+ $file = file_get_contents(self::DATA_FOLDER . $file);
+ if ($file === false) {
+ $this->markTestSkipped('File: ' . $file . ' could not be read');
+ }
+ $this->assertEquals(
+ $expected,
+ \CoreLibs\Convert\Strings::stripUTF8BomBytes($file)
+ );
+ }
}
// __END__
diff --git a/4dev/tests/Convert/data/UTF8.csv b/4dev/tests/Convert/data/UTF8.csv
new file mode 100644
index 00000000..e19b2444
--- /dev/null
+++ b/4dev/tests/Convert/data/UTF8.csv
@@ -0,0 +1 @@
+Asset Type,Epic,File Name
diff --git a/4dev/tests/Convert/data/UTF8BOM.csv b/4dev/tests/Convert/data/UTF8BOM.csv
new file mode 100644
index 00000000..87ddd559
--- /dev/null
+++ b/4dev/tests/Convert/data/UTF8BOM.csv
@@ -0,0 +1 @@
+Asset Type,Epic,File Name
diff --git a/4dev/tests/Get/CoreLibsGetSystemTest.php b/4dev/tests/Get/CoreLibsGetSystemTest.php
index a73e91fc..9017a6d8 100644
--- a/4dev/tests/Get/CoreLibsGetSystemTest.php
+++ b/4dev/tests/Get/CoreLibsGetSystemTest.php
@@ -216,6 +216,29 @@ final class CoreLibsGetSystemTest extends TestCase
);
}
}
+
+ /**
+ * Undocumented function
+ *
+ * @covers ::getIpAddresses
+ * @testdox getIpAddresses check
+ *
+ * @return void
+ */
+ public function testGetIpAddresses()
+ {
+ // response must have "REMOTE_ADDR" entry, others are optional
+ // NOTE: we have no IP addresses on command line
+ $this->assertTrue(
+ true,
+ "We do not have REMOTE_ADDR on command line"
+ );
+ // $this->assertContains(
+ // 'REMOTE_ADDR',
+ // array_keys(\CoreLibs\Get\System::getIpAddresses()),
+ // 'failed REMOTE_ADDR assert'
+ // );
+ }
}
// __END__
diff --git a/www/admin/class_test.system.php b/www/admin/class_test.system.php
index 86c0fd3b..f59a68a1 100644
--- a/www/admin/class_test.system.php
+++ b/www/admin/class_test.system.php
@@ -41,7 +41,7 @@ print "GETPAGENAME(0): " . System::getPageName() . "
";
print "GETPAGENAME(1): " . System::getPageName(System::NO_EXTENSION) . "
";
print "GETPAGENAME(2): " . System::getPageName(System::FULL_PATH) . "
";
print "System::getPageNameArray():
";
-print "GETPAGENAMEARRAY: " . \CoreLibs\Debug\Support::printAr(System::getPageNameArray()) . "
";
+print "GETPAGENAMEARRAY: " . DgS::printAr(System::getPageNameArray()) . "
";
// seting errro codes file upload
print "System::fileUploadErrorMessage():
";
print "FILEUPLOADERRORMESSAGE(): " . System::fileUploadErrorMessage(-1) . "
";
@@ -51,4 +51,6 @@ print "FILEUPLOADERRORMESSAGE(UPLOAD_ERR_CANT_WRITE): "
print "System::checkCLI():
";
print "Are we in an CLI: " . (System::checkCLI() ? 'Yes' : 'No') . "
";
+print "Get Addresses: " . DgS::printAr(System::getIpAddresses()) . "
";
+
print "