Fortify Bible reference interpretation
This commit is contained in:
@@ -6,14 +6,13 @@ The lab mounts plugin source from this workspace into disposable WordPress conta
|
||||
|
||||
## Environments
|
||||
|
||||
Initial matrix:
|
||||
Default matrix:
|
||||
|
||||
| Environment | WordPress Image | PHP | Database |
|
||||
| --- | --- | --- | --- |
|
||||
| `wp7-php84` | `wordpress:php8.4-apache` | 8.4 | MariaDB 11 |
|
||||
| `wp6-php74` | `wordpress:php7.4-apache` with WP `6.8.2` download | 7.4 | MariaDB 10.6 |
|
||||
|
||||
The `wp7-php84` image installs the latest WordPress available in the image line. The `wp6-php74` environment uses the available PHP 7.4 WordPress image, then forces a WordPress 6.8.2 core download before install. The test script records the actual WordPress version after install.
|
||||
The `wp7-php84` image installs the latest WordPress available in the image line. Legacy WordPress/PHP environments should be added only for an explicit compatibility pass, not as part of the default bounded release gate.
|
||||
|
||||
## Commands
|
||||
|
||||
|
||||
@@ -4,12 +4,5 @@
|
||||
"wordpressImage": "wordpress:php8.4-apache",
|
||||
"dbImage": "mariadb:11",
|
||||
"hostPort": 8070
|
||||
},
|
||||
{
|
||||
"name": "wp6-php74",
|
||||
"wordpressImage": "wordpress:php7.4-apache",
|
||||
"dbImage": "mariadb:10.6",
|
||||
"hostPort": 8068,
|
||||
"wordpressVersion": "6.8.2"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
{
|
||||
"environment": "wp6-php74",
|
||||
"wordpressImage": "wordpress:php7.4-apache",
|
||||
"dbImage": "mariadb:10.6",
|
||||
"hostPort": 8068,
|
||||
"startedAt": "2026-07-11T19:49:33.8231872-05:00",
|
||||
"checks": [
|
||||
{
|
||||
"name": "wp-cli available",
|
||||
"passed": true,
|
||||
"detail": ""
|
||||
},
|
||||
{
|
||||
"name": "wordpress core version prepared",
|
||||
"passed": true,
|
||||
"detail": "target=6.8.2"
|
||||
},
|
||||
{
|
||||
"name": "wordpress installed",
|
||||
"passed": true,
|
||||
"detail": "installed"
|
||||
},
|
||||
{
|
||||
"name": "runtime versions",
|
||||
"passed": true,
|
||||
"detail": "WP=6.8.2 PHP=7.4.33"
|
||||
},
|
||||
{
|
||||
"name": "plugin activated",
|
||||
"passed": true,
|
||||
"detail": ""
|
||||
},
|
||||
{
|
||||
"name": "plugin version detected",
|
||||
"passed": true,
|
||||
"detail": "version=1.1.5"
|
||||
},
|
||||
{
|
||||
"name": "verse table created",
|
||||
"passed": true,
|
||||
"detail": "wp_brt_verses"
|
||||
},
|
||||
{
|
||||
"name": "WEB import completed",
|
||||
"passed": true,
|
||||
"detail": "WEB import complete: 36,601 verses installed."
|
||||
},
|
||||
{
|
||||
"name": "KJV import completed",
|
||||
"passed": true,
|
||||
"detail": "KJV import complete: 35,948 verses installed."
|
||||
},
|
||||
{
|
||||
"name": "ASV import completed",
|
||||
"passed": true,
|
||||
"detail": "ASV import complete: 31,086 verses installed."
|
||||
},
|
||||
{
|
||||
"name": "YLT import completed",
|
||||
"passed": true,
|
||||
"detail": "YLT import complete: 31,102 verses installed."
|
||||
},
|
||||
{
|
||||
"name": "translation rows stored",
|
||||
"passed": true,
|
||||
"detail": "[{\"translation\":\"ASV\",\"row_count\":\"31086\"},{\"translation\":\"KJV\",\"row_count\":\"35948\"},{\"translation\":\"WEB\",\"row_count\":\"36601\"},{\"translation\":\"YLT\",\"row_count\":\"31102\"}]"
|
||||
},
|
||||
{
|
||||
"name": "canonical book coverage",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup John 3:16",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup John 3.16",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Jn3:16",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Romans 8:28",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup James 1:5",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Mark 10:45",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Mark10:45",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Mk 10:45",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Ezekiel 36:26",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Eze 36:26",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup 2 John 1:6",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup 2Jn1:6",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup 2 Jo 1:6",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "test post created",
|
||||
"passed": true,
|
||||
"detail": ""
|
||||
}
|
||||
],
|
||||
"phpVersion": "7.4.33",
|
||||
"wordpressVersion": "6.8.2",
|
||||
"pluginVersion": "1.1.5",
|
||||
"completedAt": "2026-07-11T19:52:42.5557675-05:00",
|
||||
"passed": true
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"wordpressImage": "wordpress:php8.4-apache",
|
||||
"dbImage": "mariadb:11",
|
||||
"hostPort": 8070,
|
||||
"startedAt": "2026-07-11T19:46:20.2262126-05:00",
|
||||
"startedAt": "2026-07-11T20:12:33.4678261-05:00",
|
||||
"checks": [
|
||||
{
|
||||
"name": "wp-cli available",
|
||||
@@ -28,13 +28,18 @@
|
||||
{
|
||||
"name": "plugin version detected",
|
||||
"passed": true,
|
||||
"detail": "version=1.1.5"
|
||||
"detail": "version=1.1.6"
|
||||
},
|
||||
{
|
||||
"name": "verse table created",
|
||||
"passed": true,
|
||||
"detail": "wp_brt_verses"
|
||||
},
|
||||
{
|
||||
"name": "interpretation registry",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "WEB import completed",
|
||||
"passed": true,
|
||||
@@ -90,6 +95,16 @@
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Jas 1:5",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Jm 1:5",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Mark 10:45",
|
||||
"passed": true,
|
||||
@@ -105,6 +120,11 @@
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Mar 10:45",
|
||||
"passed": true,
|
||||
"detail": "ok"
|
||||
},
|
||||
{
|
||||
"name": "REST lookup Ezekiel 36:26",
|
||||
"passed": true,
|
||||
@@ -138,7 +158,7 @@
|
||||
],
|
||||
"phpVersion": "8.4.23",
|
||||
"wordpressVersion": "7.0.1",
|
||||
"pluginVersion": "1.1.5",
|
||||
"completedAt": "2026-07-11T19:49:33.7883010-05:00",
|
||||
"pluginVersion": "1.1.6",
|
||||
"completedAt": "2026-07-11T20:16:05.3978156-05:00",
|
||||
"passed": true
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ $GeneratedRoot = Join-Path $LabRoot 'generated'
|
||||
$ResultsRoot = Join-Path $LabRoot 'results'
|
||||
$PluginSource = Join-Path $WorkspaceRoot 'plugins\bible-reference-tooltips'
|
||||
$PluginSlug = 'bible-reference-tooltips'
|
||||
$ExpectedPluginVersion = '1.1.5'
|
||||
$ExpectedPluginVersion = '1.1.6'
|
||||
|
||||
function Get-TestLabEnvironments {
|
||||
Get-Content -LiteralPath $ConfigPath -Raw | ConvertFrom-Json
|
||||
|
||||
@@ -80,6 +80,48 @@ echo $wpdb->get_var($wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->prefix . 'brt_v
|
||||
$tableExists = (Invoke-WpCli $environment 'wp eval-file /tmp/brt-table.php --path=/var/www/html' | Out-String).Trim()
|
||||
Add-Check 'verse table created' ($tableExists -eq 'wp_brt_verses') $tableExists
|
||||
|
||||
$interpretationPhp = @'
|
||||
<?php
|
||||
$plugin = new Bible_Reference_Tooltips();
|
||||
$ref = new ReflectionClass($plugin);
|
||||
$call = function($method, ...$args) use ($plugin, $ref) {
|
||||
$m = $ref->getMethod($method);
|
||||
$m->setAccessible(true);
|
||||
return $m->invokeArgs($plugin, $args);
|
||||
};
|
||||
$checks = [];
|
||||
foreach ([
|
||||
['parse_reference', 'James 1:5', 'JAS'],
|
||||
['parse_reference', 'Jas 1:5', 'JAS'],
|
||||
['parse_reference', 'Jm 1:5', 'JAS'],
|
||||
['parse_reference', 'Mark10:45', 'MRK'],
|
||||
['parse_reference', '2Jn1:6', '2JN'],
|
||||
['parse_reference', 'Eze 36:26', 'EZK'],
|
||||
] as $case) {
|
||||
$parsed = $call($case[0], $case[1]);
|
||||
if (!$parsed || $parsed['book'] !== $case[2]) $checks[] = $case[1] . '=>' . json_encode($parsed);
|
||||
}
|
||||
foreach ([
|
||||
['EZE 36:26 source', 'EZE', 'EZK'],
|
||||
['MAR 10:45 source', 'MAR', 'MRK'],
|
||||
['JOH 3:16 source', 'JOH', 'JHN'],
|
||||
['JAM 1:5 source', 'JAM', 'JAS'],
|
||||
['1JO 1:9 source', '1JO', '1JN'],
|
||||
] as $case) {
|
||||
$book = $call('normalize_source_book', $case[1], 'ebible_vpl');
|
||||
if (!$book || $book['abbr'] !== $case[2]) $checks[] = $case[0] . '=>' . json_encode($book);
|
||||
}
|
||||
$aliases = $call('frontend_book_alias_patterns');
|
||||
$alias_keys = array_map('strtolower', $aliases);
|
||||
foreach (['James', 'Jm', 'Eze', 'Mar', '2\\s*Jn'] as $needle) {
|
||||
if (!in_array(strtolower($needle), $alias_keys, true)) $checks[] = 'missing frontend alias ' . $needle;
|
||||
}
|
||||
echo $checks ? json_encode($checks) : 'ok';
|
||||
'@
|
||||
Write-ContainerPhpFile $environment '/tmp/brt-interpretation.php' $interpretationPhp
|
||||
$interpretation = (Invoke-WpCli $environment 'wp eval-file /tmp/brt-interpretation.php --path=/var/www/html' | Out-String).Trim()
|
||||
Add-Check 'interpretation registry' ($interpretation -eq 'ok') $interpretation
|
||||
|
||||
$translationsToImport = @('WEB', 'KJV', 'ASV', 'YLT')
|
||||
foreach ($translationCode in $translationsToImport) {
|
||||
$importPhp = @"
|
||||
@@ -126,7 +168,7 @@ echo $missing ? json_encode($missing) : 'ok';
|
||||
$bookCoverage = (Invoke-WpCli $environment 'wp eval-file /tmp/brt-book-coverage.php --path=/var/www/html' | Out-String).Trim()
|
||||
Add-Check 'canonical book coverage' ($bookCoverage -eq 'ok') $bookCoverage
|
||||
|
||||
$refs = @('John 3:16', 'John 3.16', 'Jn3:16', 'Romans 8:28', 'James 1:5', 'Mark 10:45', 'Mark10:45', 'Mk 10:45', 'Ezekiel 36:26', 'Eze 36:26', '2 John 1:6', '2Jn1:6', '2 Jo 1:6')
|
||||
$refs = @('John 3:16', 'John 3.16', 'Jn3:16', 'Romans 8:28', 'James 1:5', 'Jas 1:5', 'Jm 1:5', 'Mark 10:45', 'Mark10:45', 'Mk 10:45', 'Mar 10:45', 'Ezekiel 36:26', 'Eze 36:26', '2 John 1:6', '2Jn1:6', '2 Jo 1:6')
|
||||
foreach ($ref in $refs) {
|
||||
$lookupPhp = @"
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user