Testing
Ensure your plugin works correctly before deployment.
Manual Testing Steps
1. Copy Plugin to Plugins Folder
cp -r my-plugin /var/www/pteroca/plugins/2. Scan for Plugin
docker exec pteroca_web_dev php bin/console pteroca:plugin:scan3. Check Plugin Info
docker exec pteroca_web_dev php bin/console pteroca:plugin:info my-pluginExpected output:
Plugin: my-plugin
Display Name: My Awesome Plugin
Version: 1.0.0
Author: Your Name <[email protected]>
Status: DISCOVERED
Capabilities: routes, entities, migrations, ui4. Run Security Scan
Look for:
✅ No dangerous functions
✅ No eval() usage
✅ No shell_exec() usage
✅ Secure file operations
5. Enable Plugin
Watch for errors during:
Bootstrap initialization
Migration execution
Asset publishing
Service registration
6. Check Health
Verify:
✅ All capabilities working
✅ Database tables created
✅ Services registered
✅ Routes loaded
7. Test Functionality
In Browser:
Access plugin routes:
https://your-domain.com/plugins/my-plugin/Check widgets appear on dashboard
Verify admin menu items
Test server tabs (if applicable)
Check settings configuration page
Test forms and CRUD operations
Via CLI:
8. Check Logs for Errors
Look for:
PHP errors
SQL errors
Missing files
Permission issues
9. Disable and Re-enable
Verify:
Cleanup runs properly
Re-initialization works
Data persists
Settings remain
Debugging
Check Logs
Verify Autoloading
Check Routes
Verify Migrations
Test Database Queries
Common Issues
Class Not Found
Problem: Class 'Plugins\MyPlugin\Controller\MyController' not found
Solutions:
Check namespace matches directory structure (PSR-4)
Clear cache:
php bin/console cache:clearVerify composer autoloading (if using composer.json)
Routes Not Working
Problem: 404 errors when accessing plugin routes
Solutions:
Check route naming convention:
plugin_{name}_{action}Verify controller is tagged:
controller.service_argumentsClear cache
Check routes loaded:
debug:router | grep plugin_my_plugin
Assets Not Loading
Problem: CSS/JS files return 404
Solutions:
Republish assets:
Check file permissions
Verify asset paths in plugin.json
Check symlinks in
public/assets/plugins/my-plugin/
Database Errors
Problem: SQL syntax errors or table doesn't exist
Solutions:
Check migration SQL syntax
Verify table names use
plg_prefixTest migration manually:
Check database user permissions
Widget Not Appearing
Problem: Widget doesn't show on dashboard
Solutions:
Verify widget is tagged:
tags: ['widget']Check
isVisible()returns trueCheck context matches:
WidgetContext::DASHBOARDClear cache
Check for JavaScript errors in browser console
Settings Not Saving
Problem: Plugin settings don't persist
Solutions:
Verify settings context:
plugin:my-pluginCheck
config_schemain plugin.jsonVerify database table
settingexistsCheck user permissions
Browser Testing
Check JavaScript Console
Open browser DevTools (F12)
Go to Console tab
Look for errors when:
Loading pages
Clicking buttons
Submitting forms
Check Network Tab
Go to Network tab in DevTools
Verify:
Assets load successfully (200 status)
API calls return correct responses
No CORS errors
Proper content types
Test in Multiple Browsers
Chrome/Chromium
Firefox
Safari (if applicable)
Edge
Test Responsive Design
Desktop (1920x1080)
Tablet (768x1024)
Mobile (375x667)
Performance Testing
Check Plugin Load Time
Monitor Memory Usage
Profile Database Queries
Enable Symfony profiler in development and check query count/time.
Automated Testing (Optional)
Unit Tests
Integration Tests
Run Tests
Checklist Before Release
Related Guides
Best Practices - Code quality guidelines
Plugin Structure - Verify file organization
Dependencies - Service debugging
Last updated