Testing & Development
Testing Instructions
Running Package Tests
bash
# Run all tests
vendor/bin/phpunit
# Run specific test suites
vendor/bin/phpunit tests/Feature/DynamicApiTest.php
vendor/bin/phpunit tests/Unit/SchemaRegistryTest.php
# Run tests with coverage
vendor/bin/phpunit --coverage-html coverageManual Testing
Create test data and verify API functionality:
bash
# Create test user
php artisan tinker
>>> $user = \App\Models\User::create(['name' => 'Test User', 'email' => 'test@example.com', 'password' => bcrypt('password')]);
# Test API endpoints
curl -X GET http://your-app.test/api/v1/users
curl -X GET http://your-app.test/api/v1/users/1
curl -X POST http://your-app.test/api/v1/users -H "Content-Type: application/json" -d '{"name":"New User","email":"new@example.com"}'Development Setup
Setting up for Package Development
bash
# Clone the repository
git clone https://github.com/your-username/record-api.git
cd record-api
# Install dependencies
composer install
# Set up testing environment
cp .env.example .env.testing
php artisan key:generate --env=testing
# Run tests
vendor/bin/phpunitCode Quality Tools
bash
# Install development tools
composer require --dev rector/rector
composer require --dev phpunit/phpunit
# Fix code style
vendor/bin/rector process srcContributing Guidelines
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass
- Submit a pull request