Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Database Testing
gigerit/laravel-mysql-optimizer
cursor
database
mysql
laravel
optimize
table
mariadb

Testing database operations requires special care. Follow these practices:

Install
php artisan boost:add-skill gigerit/laravel-mysql-optimizer

Save this content to: .cursor/rules/database-testing.mdc

# Database Testing Guidelines

Testing database operations requires special care. Follow these practices:

## Test Database Safety
- Use separate test databases—never test against production data
- Use Laravel's database testing traits appropriately
- **NEVER** use RefreshDatabase traits that wipe entire databases without explicit authorization
- Implement proper test data seeding and cleanup

## Testing Database Operations
- Test both successful optimization scenarios and error conditions
- Mock database connections when testing error handling
- Verify table optimization statistics and results
- Test timeout and memory limit scenarios
- Validate proper cleanup after failed operations

## Integration Testing
- Test console commands with real database tables
- Verify queued job processing works correctly
- Test configuration loading and validation
- Ensure proper service provider registration

## Performance Testing
- Test optimization performance with varying table sizes
- Verify memory usage doesn't exceed reasonable limits
- Test concurrent optimization scenarios
- Validate timeout handling for large tables

## Test Organization
- Group tests by functionality (Console, Actions, Jobs)
- Use descriptive test method names that explain the scenario
- Include both positive and negative test cases
- Test edge cases like empty tables, missing tables, and invalid configurations

Database Testing Guidelines

Testing database operations requires special care. Follow these practices:

Test Database Safety

  • Use separate test databases—never test against production data
  • Use Laravel's database testing traits appropriately
  • NEVER use RefreshDatabase traits that wipe entire databases without explicit authorization
  • Implement proper test data seeding and cleanup

Testing Database Operations

  • Test both successful optimization scenarios and error conditions
  • Mock database connections when testing error handling
  • Verify table optimization statistics and results
  • Test timeout and memory limit scenarios
  • Validate proper cleanup after failed operations

Integration Testing

  • Test console commands with real database tables
  • Verify queued job processing works correctly
  • Test configuration loading and validation
  • Ensure proper service provider registration

Performance Testing

  • Test optimization performance with varying table sizes
  • Verify memory usage doesn't exceed reasonable limits
  • Test concurrent optimization scenarios
  • Validate timeout handling for large tables

Test Organization

  • Group tests by functionality (Console, Actions, Jobs)
  • Use descriptive test method names that explain the scenario
  • Include both positive and negative test cases
  • Test edge cases like empty tables, missing tables, and invalid configurations
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo