dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxSelfTestRunner_test.php File Reference

Go to the source code of this file.

Functions

 selftest_assert (bool $condition, string $message)
 selftest_remove_tree (string $path)

Variables

 $fixture = sys_get_temp_dir() . '/dbx-selftest-runner-' . bin2hex(random_bytes(4))
 $testDir = $fixture . '/dbx/modules/demo/tests'
 $logDir = $fixture . '/files/sys/selftest'
 try
 $runnerSource = (string)file_get_contents(dirname(__DIR__) . '/include/dbxSelfTestRunner.class.php')
 $controllerSource = (string)file_get_contents(dirname(__DIR__) . '/include/dbxSelfTestController.class.php')
 $dashboardSource = (string)file_get_contents(dirname(__DIR__) . '/tpl/js/selftest.js')
 $startFunction = strpos($dashboardSource, 'async function startRun(profile, ids)')
 $busyGuard = $startFunction === false ? false : strpos($dashboardSource, 'if (state.busy) return;', $startFunction)
 $busyLock = $busyGuard === false ? false : strpos($dashboardSource, 'setBusy(true);', $busyGuard)
 $startRequest = $busyLock === false ? false : strpos($dashboardSource, 'request(urls.start', $busyLock)
 $phpResolver = new ReflectionMethod($runner, 'resolvePhpCliBinary')
 $phpCli = $phpResolver->invoke($runner)
 $catalog = $runner->catalog('full')
 $demo = array_values(array_filter($catalog, static fn(array $test): bool => ($test['relative_path'] ?? '') === 'dbx/modules/demo/tests/demo_test.php'))
 $browserDemo = array_values(array_filter($catalog, static fn(array $test): bool => ($test['relative_path'] ?? '') === 'dbx/modules/demo/tests/demo_test.js'))
 $run = $runner->startRun('full', array($demo[0]['id']), 'single')
 $result = $runner->executeRunTest($run['id'], $demo[0]['id'])
 $finished = $runner->finishRun($run['id'])
 $browserRun = $runner->startRun('full', array($browserDemo[0]['id']), 'single')
 $browserResult
 $staleRun = $runner->startRun('full', array($demo[0]['id']), 'single')
 $stalePath = (string)$runner->runLogPath($staleRun['id'])
 $staleHistory
 finally

Function Documentation

◆ selftest_assert()

selftest_assert ( bool $condition,
string $message )

Definition at line 6 of file dbxSelfTestRunner_test.php.

References exit, and if.

◆ selftest_remove_tree()

selftest_remove_tree ( string $path)

Definition at line 13 of file dbxSelfTestRunner_test.php.

References $iterator, and if.

Variable Documentation

◆ $browserDemo

$browserDemo = array_values(array_filter($catalog, static fn(array $test): bool => ($test['relative_path'] ?? '') === 'dbx/modules/demo/tests/demo_test.js'))

Definition at line 59 of file dbxSelfTestRunner_test.php.

◆ $browserResult

$browserResult
Initial value:
= $runner->recordBrowserTestResult($browserRun['id'], $browserDemo[0]['id'], array(
'status' => 'passed',
'output' => 'PASS browser demo',
'duration_ms' => 12,
))
foreach(array_slice($argv ?? array(), 1) as $argument) $runner
Definition run.php:15

Definition at line 74 of file dbxSelfTestRunner_test.php.

◆ $browserRun

$browserRun = $runner->startRun('full', array($browserDemo[0]['id']), 'single')

Definition at line 73 of file dbxSelfTestRunner_test.php.

◆ $busyGuard

$busyGuard = $startFunction === false ? false : strpos($dashboardSource, 'if (state.busy) return;', $startFunction)

Definition at line 46 of file dbxSelfTestRunner_test.php.

◆ $busyLock

$busyLock = $busyGuard === false ? false : strpos($dashboardSource, 'setBusy(true);', $busyGuard)

Definition at line 47 of file dbxSelfTestRunner_test.php.

◆ $catalog

◆ $controllerSource

$controllerSource = (string)file_get_contents(dirname(__DIR__) . '/include/dbxSelfTestController.class.php')

Definition at line 40 of file dbxSelfTestRunner_test.php.

◆ $dashboardSource

$dashboardSource = (string)file_get_contents(dirname(__DIR__) . '/tpl/js/selftest.js')

Definition at line 41 of file dbxSelfTestRunner_test.php.

◆ $demo

$demo = array_values(array_filter($catalog, static fn(array $test): bool => ($test['relative_path'] ?? '') === 'dbx/modules/demo/tests/demo_test.php'))

◆ $finished

$finished = $runner->finishRun($run['id'])

Definition at line 67 of file dbxSelfTestRunner_test.php.

◆ $fixture

$fixture = sys_get_temp_dir() . '/dbx-selftest-runner-' . bin2hex(random_bytes(4))

Definition at line 26 of file dbxSelfTestRunner_test.php.

◆ $logDir

$logDir = $fixture . '/files/sys/selftest'

Definition at line 28 of file dbxSelfTestRunner_test.php.

Referenced by dbx\dbxSelfTest\dbxSelfTestRunner\logDir().

◆ $phpCli

$phpCli = $phpResolver->invoke($runner)

Definition at line 54 of file dbxSelfTestRunner_test.php.

◆ $phpResolver

$phpResolver = new ReflectionMethod($runner, 'resolvePhpCliBinary')

Definition at line 53 of file dbxSelfTestRunner_test.php.

◆ $result

$result = $runner->executeRunTest($run['id'], $demo[0]['id'])

Definition at line 65 of file dbxSelfTestRunner_test.php.

◆ $run

◆ $runnerSource

$runnerSource = (string)file_get_contents(dirname(__DIR__) . '/include/dbxSelfTestRunner.class.php')

Definition at line 39 of file dbxSelfTestRunner_test.php.

◆ $staleHistory

$staleHistory
Initial value:
= array_values(array_filter(
$runner->history(20),
static fn(array $item): bool => ($item['id'] ?? '') === $staleRun['id']
))

Definition at line 86 of file dbxSelfTestRunner_test.php.

◆ $stalePath

$stalePath = (string)$runner->runLogPath($staleRun['id'])

Definition at line 83 of file dbxSelfTestRunner_test.php.

◆ $staleRun

$staleRun = $runner->startRun('full', array($demo[0]['id']), 'single')

Definition at line 82 of file dbxSelfTestRunner_test.php.

◆ $startFunction

$startFunction = strpos($dashboardSource, 'async function startRun(profile, ids)')

Definition at line 45 of file dbxSelfTestRunner_test.php.

◆ $startRequest

$startRequest = $busyLock === false ? false : strpos($dashboardSource, 'request(urls.start', $busyLock)

Definition at line 48 of file dbxSelfTestRunner_test.php.

◆ $testDir

$testDir = $fixture . '/dbx/modules/demo/tests'

Definition at line 27 of file dbxSelfTestRunner_test.php.

◆ finally

finally
Initial value:

Definition at line 92 of file dbxSelfTestRunner_test.php.

◆ try

try
Initial value:
{
Zentraler, auch ohne Web-Kernel nutzbarer Test-Orchestrator.

Definition at line 37 of file dbxSelfTestRunner_test.php.