๐งช **COMPREHENSIVE COUNTRY DETECTION TEST SUITE** ================================================ 1๏ธโฃ **Basic Country Detection** ----------------------------- โ Indonesia โ Indonesian โ United States โ English โ China โ Chinese โ Saudi Arabia โ Arabic โ Thailand โ Thai โ Brazil โ Portuguese โ Spain โ Spanish โ Japan โ Japanese โ Korea โ Korean โ No country โ English (fallback) 2๏ธโฃ **Helper Methods Tests** ------------------------- โ Indonesia is supported โ France is not supported โ Arabic has 17 countries โ Spanish has 19 countries โ All 9 languages are mapped 3๏ธโฃ **Edge Cases & Validation** ----------------------------- โ Invalid Empty string header โ null โ Invalid 3-letter country code โ null โ Invalid Numeric country code โ null โ Lowercase id โ ID conversion 4๏ธโฃ **Browser Integration Tests** -------------------------------
Call to undefined function shell_exec()
dev-utils/test-country-detection-suite.php
102 ['country' => 'CN', 'expected' => 'zh'],
103 ['country' => 'SA', 'expected' => 'ar'],
104];
105
106foreach ($browserTests as $test) {
107 $result = shell_exec("curl -s -H \"CF-IPCountry: {$test['country']}\" \"http://dracin-git.test/\" 2>/dev/null | grep \"suggestedLanguage\" | sed 's/.*suggestedLanguage":"\\([^&]*\\)".*/\\1/' | head -1");
108 $result = trim($result);
109 runTest("Browser: {$test['country']} โ {$test['expected']}", $result === $test['expected']);
110}
111
112echo "\n5๏ธโฃ **RSS Integration Tests**\n";
113echo "---------------------------\n";
114
115// Test RSS feeds are working
116$rssResult = shell_exec('curl -s "http://dracin-git.test/rss.xml" 2>/dev/null | head -1');
117runTest('RSS feeds accessible', strpos($rssResult, '<?xml') === 0);
118
119