Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b022662dfc | ||
|
|
3039ebf913 | ||
|
|
e2e080c404 | ||
|
|
4671143d1c | ||
|
|
b492558cca |
@@ -460,16 +460,18 @@ final class CoreLibsDebugSupportTest extends TestCase
|
|||||||
* Undocumented function
|
* Undocumented function
|
||||||
*
|
*
|
||||||
* @cover ::getCallerFileLine
|
* @cover ::getCallerFileLine
|
||||||
* @testWith ["/storage/var/www/html/developers/clemens/core_data/php_libraries/trunk/www/vendor/phpunit/phpunit/src/Framework/TestCase.php:1608"]
|
* @testWith ["vendor/phpunit/phpunit/src/Framework/TestCase.php:"]
|
||||||
* @testdox getCallerFileLine check if it returns $expected [$_dataName]
|
* @testdox getCallerFileLine check based on regex /[\w\-\/]/vendor/phpunit/phpunit/src/Framework/TestCase.php:\d+ [$_dataName]
|
||||||
*
|
*
|
||||||
* @param string $expected
|
* @param string $expected
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testGetCallerFileLine(string $expected): void
|
public function testGetCallerFileLine(): void
|
||||||
{
|
{
|
||||||
$this->assertEquals(
|
// regex prefix with path "/../" and then fixed vendor + \d+
|
||||||
$expected,
|
$regex = "/^\/[\w\-\/]+\/vendor\/phpunit\/phpunit\/src\/Framework\/TestCase.php:\d+$/";
|
||||||
|
$this->assertMatchesRegularExpression(
|
||||||
|
$regex,
|
||||||
Support::getCallerFileLine()
|
Support::getCallerFileLine()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -518,11 +520,17 @@ final class CoreLibsDebugSupportTest extends TestCase
|
|||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
// add one "run" before "runBare"
|
// add one "run" before "runBare"
|
||||||
|
// array_splice(
|
||||||
|
// $expected,
|
||||||
|
// 7,
|
||||||
|
// 0,
|
||||||
|
// ['run']
|
||||||
|
// );
|
||||||
array_splice(
|
array_splice(
|
||||||
$expected,
|
$expected,
|
||||||
7,
|
|
||||||
0,
|
0,
|
||||||
['run']
|
0,
|
||||||
|
['include']
|
||||||
);
|
);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$expected,
|
$expected,
|
||||||
|
|||||||
@@ -20,10 +20,15 @@ final class CoreLibsLoggingLoggingTest extends TestCase
|
|||||||
private const LOG_FOLDER = __DIR__ . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR;
|
private const LOG_FOLDER = __DIR__ . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR;
|
||||||
private const REGEX_BASE = "\[[\d\-\s\.:]+\]\s{1}" // date
|
private const REGEX_BASE = "\[[\d\-\s\.:]+\]\s{1}" // date
|
||||||
. "\[[\w\.]+(:\d+)?\]\s{1}" // host:port
|
. "\[[\w\.]+(:\d+)?\]\s{1}" // host:port
|
||||||
. "\[[\w+\.\/]+:\d+\]\s{1}" // folder/file
|
. "\[[\w\-\.\/]+:\d+\]\s{1}" // folder/file
|
||||||
. "\[\w+\]\s{1}" // run id
|
. "\[\w+\]\s{1}" // run id
|
||||||
. "{[\w\\\\]+(::\w+)?}\s{1}"; // class
|
. "{[\w\\\\]+(::\w+)?}\s{1}"; // class
|
||||||
|
|
||||||
|
public static function tearDownAfterClass(): void
|
||||||
|
{
|
||||||
|
array_map('unlink', glob(self::LOG_FOLDER . '*.log'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test set for options BASIC
|
* test set for options BASIC
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ class IO
|
|||||||
/** @var array<mixed> */
|
/** @var array<mixed> */
|
||||||
private array $pk_name_table = [];
|
private array $pk_name_table = [];
|
||||||
/** @var string internal primary key name, for cross calls in async */
|
/** @var string internal primary key name, for cross calls in async */
|
||||||
private string $pk_name;
|
private string $pk_name = '';
|
||||||
/** @var bool if we use RETURNING in the INSERT call */
|
/** @var bool if we use RETURNING in the INSERT call */
|
||||||
private bool $returning_id = false;
|
private bool $returning_id = false;
|
||||||
/** @var string if a sync is running holds the hash key of the query */
|
/** @var string if a sync is running holds the hash key of the query */
|
||||||
@@ -1267,7 +1267,7 @@ class IO
|
|||||||
// ONLY insert with set pk name
|
// ONLY insert with set pk name
|
||||||
($this->__checkQueryForInsert($this->query, true) && $this->pk_name != 'NULL') ||
|
($this->__checkQueryForInsert($this->query, true) && $this->pk_name != 'NULL') ||
|
||||||
// insert or update with returning add
|
// insert or update with returning add
|
||||||
($this->__checkQueryForInsert($this->query) && $this->returning_id)
|
($this->__checkQueryForInsert($this->query) && $this->returning_id)
|
||||||
) {
|
) {
|
||||||
$this->__dbSetInsertId(
|
$this->__dbSetInsertId(
|
||||||
$this->returning_id,
|
$this->returning_id,
|
||||||
|
|||||||
@@ -34,29 +34,29 @@ class Support
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prints a html formatted (pre) array
|
* prints a html formatted (pre) data
|
||||||
*
|
*
|
||||||
* @param array<mixed> $array any array
|
* @param mixed $data any data
|
||||||
* @param bool $no_html default add <pre>
|
* @param bool $no_html default add <pre>
|
||||||
* @return string formatted array for output with <pre> tag added
|
* @return string formatted array for output with <pre> tag added
|
||||||
*/
|
*/
|
||||||
public static function printAr(array $array, bool $no_html = false): string
|
public static function printAr(mixed $data, bool $no_html = false): string
|
||||||
{
|
{
|
||||||
return $no_html ?
|
return $no_html ?
|
||||||
print_r($array, true) :
|
print_r($data, true) :
|
||||||
'<pre>' . print_r($array, true) . '</pre>';
|
'<pre>' . print_r($data, true) . '</pre>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alternate name for printAr function
|
* alternate name for printAr function
|
||||||
*
|
*
|
||||||
* @param array<mixed> $array any array
|
* @param mixed $data any array
|
||||||
* @param bool $no_html default add <pre>
|
* @param bool $no_html default add <pre>
|
||||||
* @return string formatted array for output with <pre> tag added
|
* @return string formatted array for output with <pre> tag added
|
||||||
*/
|
*/
|
||||||
public static function printArray(array $array, bool $no_html = false): string
|
public static function printArray(mixed $data, bool $no_html = false): string
|
||||||
{
|
{
|
||||||
return self::printAr($array, $no_html);
|
return self::printAr($data, $no_html);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,12 +65,12 @@ class Support
|
|||||||
* Do not use this without using it in a string in debug function
|
* Do not use this without using it in a string in debug function
|
||||||
* Note: for full data debug dumps use Support::dumpVar()
|
* Note: for full data debug dumps use Support::dumpVar()
|
||||||
*
|
*
|
||||||
* @param array<mixed> $a Array to format
|
* @param mixed $data Data to print
|
||||||
* @return string print_r formated
|
* @return string print_r formated
|
||||||
*/
|
*/
|
||||||
public static function prAr(array $a): string
|
public static function prAr(mixed $data): string
|
||||||
{
|
{
|
||||||
return self::printAr($a, true);
|
return self::printAr($data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1082,12 +1082,12 @@ class Logging
|
|||||||
* But this does not wrap it in <pre></pre>
|
* But this does not wrap it in <pre></pre>
|
||||||
* Do not use this without using it in a string in debug function
|
* Do not use this without using it in a string in debug function
|
||||||
*
|
*
|
||||||
* @param array<mixed> $a Array to format
|
* @param mixed $data Data to format
|
||||||
* @return string print_r formated
|
* @return string print_r formated
|
||||||
*/
|
*/
|
||||||
public function prAr(array $a): string
|
public function prAr(mixed $data): string
|
||||||
{
|
{
|
||||||
return Support::printArray($a, true);
|
return Support::printArray($data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user