Composer updates
This commit is contained in:
42
www/admin/class_test.class-calls.php
Normal file
42
www/admin/class_test.class-calls.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php // phpcs:ignore warning
|
||||
|
||||
/**
|
||||
* @phan-file-suppress PhanTypeSuspiciousStringExpression
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
|
||||
|
||||
ob_start();
|
||||
|
||||
// sample config
|
||||
require 'config.php';
|
||||
// define log file id
|
||||
$LOG_FILE_ID = 'classTest_class_calls';
|
||||
ob_end_flush();
|
||||
|
||||
$log = new CoreLibs\Logging\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'log_file_id' => $LOG_FILE_ID,
|
||||
'log_per_date' => true,
|
||||
]);
|
||||
// db connection and attach logger
|
||||
$db = new CoreLibs\DB\IO(DB_CONFIG, $log);
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
$PAGE_NAME = 'TEST CLASS: CLASS CALLS';
|
||||
print "<!DOCTYPE html>";
|
||||
print "<html><head><title>" . $PAGE_NAME . "</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
|
||||
|
||||
$test = new \TestCalls\Test($db, $log);
|
||||
|
||||
$test->testDbCall();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
// __END__
|
||||
@@ -73,6 +73,36 @@ $db->dbSetEncoding('SJIS');
|
||||
print "ENCODING TEST: " . $db->dbVersionInfo('client_encoding') . "/" . $db->dbGetEncoding() . "<br>";
|
||||
$db->dbResetEncoding();
|
||||
|
||||
// empty calls, none of the below should fail
|
||||
//
|
||||
$db->dbGetInsertPKName();
|
||||
//
|
||||
$db->dbGetInsertPK();
|
||||
//
|
||||
$db->dbGetReturningExt();
|
||||
$db->dbGetReturningExt('foo');
|
||||
$db->dbGetReturningExt('foo', 0);
|
||||
$db->dbGetReturningExt(pos:0);
|
||||
//
|
||||
$db->dbGetReturningArray();
|
||||
//
|
||||
$db->dbGetNumRows();
|
||||
//
|
||||
$db->dbGetNumFields();
|
||||
//
|
||||
$db->dbGetFieldNames();
|
||||
//
|
||||
$db->dbGetFieldTypes();
|
||||
//
|
||||
$db->dbGetFieldNameTypes();
|
||||
//
|
||||
$db->dbGetFieldName(0);
|
||||
//
|
||||
$db->dbGetFieldType(0);
|
||||
$db->dbGetFieldType('foo');
|
||||
//
|
||||
$db->dbGetPrepareCursorValue('foo', 'bar');
|
||||
|
||||
// TEST CACHE READS
|
||||
|
||||
$res = $db->dbReturn("SELECT * FROM max_test");
|
||||
|
||||
@@ -169,6 +169,7 @@ class TestL
|
||||
public function test(?string $ts = null): bool
|
||||
{
|
||||
print "* GETCALLERCLASS(INSIDE CLASS): " . \CoreLibs\Debug\Support::getCallerClass() . "<br>";
|
||||
print "* GETCALLERTOPCLASS(INSIDE CLASS): " . \CoreLibs\Debug\Support::getCallerTopLevelClass() . "<br>";
|
||||
$this->log->debug('TESTL', 'Logging in class testL' . ($ts !== null ? ': ' . $ts : ''));
|
||||
$this->log->debug('TESTL', 'Some other message');
|
||||
return true;
|
||||
@@ -191,6 +192,7 @@ class TestR extends TestL
|
||||
public function subTest(): bool
|
||||
{
|
||||
print "** GETCALLERCLASS(INSIDE EXTND CLASS): " . \CoreLibs\Debug\Support::getCallerClass() . "<br>";
|
||||
print "** GETCALLERTOPCLASS(INSIDE EXTND CLASS): " . \CoreLibs\Debug\Support::getCallerTopLevelClass() . "<br>";
|
||||
$this->log->debug('TESTR', 'Logging in class testR (extends testL)');
|
||||
$this->test('TESTR INSIDE');
|
||||
$this->log->debug('TESTR', 'Array: '
|
||||
|
||||
@@ -63,6 +63,11 @@ print "J/S::E-JSON ERROR: " . $json_class::jsonGetLastError() . ": " . $json_cla
|
||||
// print "S::JSON: $json: " . DgS::printAr($output) . "<br>";
|
||||
// print "S::JSON ERROR: " . Jason::jsonGetLastError() . ": " . Jason::jsonGetLastError(true) . "<br>";
|
||||
|
||||
// convert an array to json
|
||||
$array = ['foo' => 'bar'];
|
||||
$output = Json::jsonConvertArrayTo($array);
|
||||
print "S::JSON: " . DgS::printAr($array) . " => " . $output . "<br>";
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
// __END__
|
||||
|
||||
@@ -114,6 +114,7 @@ $test_files = [
|
||||
'class_test.autoloader.php' => 'Class Test: AUTOLOADER',
|
||||
'class_test.config.link.php' => 'Class Test: CONFIG LINK',
|
||||
'class_test.config.direct.php' => 'Class Test: CONFIG DIRECT',
|
||||
'class_test.class-calls.php' => 'Class Test: CLASS CALLS',
|
||||
'subfolder/class_test.config.direct.php' => 'Class Test: CONFIG DIRECT SUB',
|
||||
];
|
||||
|
||||
|
||||
@@ -40,5 +40,6 @@ print "test.env: STATUS: " . $status . "<br>";
|
||||
print "AFTER reading test.env file: " . \CoreLibs\Debug\Support::printAr($_ENV) . "<br>";
|
||||
|
||||
print "</body></html>";
|
||||
// ;;
|
||||
|
||||
// __END__
|
||||
|
||||
Reference in New Issue
Block a user