isConfigured()) { echo "ERROR: GitHub storage is not properly configured.\n"; echo "Please check your GitHub token and repository settings.\n"; exit(1); } echo "✓ GitHub configuration is valid.\n"; // Test 2: Test directory creation echo "2. Testing directory creation...\n"; $userPath = $storage->getUserPath(); if (!$userPath) { echo "ERROR: Could not determine user path.\n"; exit(1); } echo "User path: $userPath\n"; // Test 3: Test file saving echo "3. Testing file save...\n"; $testContent = "\n\n
\nThis is a test file created at " . date('Y-m-d H:i:s') . "
\n\n"; $testFilename = "test-" . date('YmdHis') . ".html"; $result = $storage->save($testFilename, $testContent); if ($result) { echo "✓ File saved successfully: $testFilename\n"; // Test 4: Verify file can be loaded echo "4. Testing file load...\n"; $loadedContent = $storage->load($testFilename); if ($loadedContent === $testContent) { echo "✓ File loaded successfully and content matches.\n"; } else { echo "WARNING: File loaded but content doesn't match exactly.\n"; echo "Expected length: " . strlen($testContent) . "\n"; echo "Actual length: " . strlen($loadedContent) . "\n"; } } else { echo "ERROR: Failed to save test file.\n"; exit(1); } echo "\nAll tests completed successfully!\n"; ?>