- Move 12 markdown files from root to docs/ subdirectories - Organize documentation by category: • docs/troubleshooting/ (1 file) - Technical troubleshooting guides • docs/deployment/ (4 files) - Deployment and security documentation • docs/guides/ (3 files) - Feature-specific guides • docs/planning/ (4 files) - Planning and improvement proposals Root directory cleanup: - Reduced from 16 to 4 markdown files in root - Only essential project files remain: • CLAUDE.md (AI instructions) • README.md (Main project readme) • CLEANUP_PLAN.md (Current cleanup plan) • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements) This improves: ✅ Documentation discoverability ✅ Logical organization by purpose ✅ Clean root directory ✅ Better maintainability
83 lines
2.2 KiB
PHP
83 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Framework\Meta\MetaData;
|
|
use App\Framework\Meta\OpenGraphType;
|
|
use App\Framework\View\DomWrapper;
|
|
use App\Framework\View\Processors\MetaManipulator;
|
|
use App\Framework\View\RenderContext;
|
|
|
|
// Test 1: MetaData Factory Method
|
|
echo "=== Test 1: MetaData Factory Method ===\n";
|
|
|
|
$metaData = MetaData::create(
|
|
title: 'Test Seite',
|
|
description: 'Dies ist eine Test-Beschreibung',
|
|
ogType: OpenGraphType::WEBSITE
|
|
);
|
|
|
|
echo "Title: " . $metaData->title . "\n";
|
|
echo "Description: " . $metaData->description . "\n";
|
|
echo "OpenGraph Type: " . $metaData->openGraph->type->value . "\n";
|
|
|
|
// Test 2: RenderContext mit MetaData
|
|
echo "\n=== Test 2: RenderContext mit MetaData ===\n";
|
|
|
|
$renderContext = new RenderContext(
|
|
template: 'test-template',
|
|
metaData: $metaData,
|
|
data: ['content' => 'Test Content']
|
|
);
|
|
|
|
echo "Template: " . $renderContext->template . "\n";
|
|
echo "MetaData Title: " . $renderContext->metaData->title . "\n";
|
|
|
|
// Test 3: MetaManipulator mit HTML
|
|
echo "\n=== Test 3: MetaManipulator Processing ===\n";
|
|
|
|
$testHtml = '<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Original Title</title>
|
|
<meta name="description" content="Original Description">
|
|
<meta property="og:type" content="article">
|
|
</head>
|
|
<body>
|
|
<h1>Test Content</h1>
|
|
</body>
|
|
</html>';
|
|
|
|
$dom = DomWrapper::fromString($testHtml);
|
|
$manipulator = new MetaManipulator();
|
|
|
|
$processedDom = $manipulator->process($dom, $renderContext);
|
|
$processedHtml = $processedDom->toHtml();
|
|
|
|
echo "Processed HTML:\n";
|
|
echo substr($processedHtml, 0, 500) . "...\n";
|
|
|
|
// Check if meta tags were updated
|
|
if (str_contains($processedHtml, 'Test Seite | Michael Schiemer')) {
|
|
echo "✅ Title wurde korrekt gesetzt\n";
|
|
} else {
|
|
echo "❌ Title wurde nicht gesetzt\n";
|
|
}
|
|
|
|
if (str_contains($processedHtml, 'Dies ist eine Test-Beschreibung')) {
|
|
echo "✅ Description wurde korrekt gesetzt\n";
|
|
} else {
|
|
echo "❌ Description wurde nicht gesetzt\n";
|
|
}
|
|
|
|
if (str_contains($processedHtml, 'og:type" content="website"')) {
|
|
echo "✅ OpenGraph Type wurde korrekt gesetzt\n";
|
|
} else {
|
|
echo "❌ OpenGraph Type wurde nicht gesetzt\n";
|
|
}
|
|
|
|
echo "\n=== Integration Test Abgeschlossen ===\n";
|