101 lines
1.7 KiB
Markdown
101 lines
1.7 KiB
Markdown
# CLQMS Suggested Commands
|
|
|
|
## Testing
|
|
```bash
|
|
# Run all tests
|
|
./vendor/bin/phpunit
|
|
|
|
# Run specific test file
|
|
./vendor/bin/phpunit tests/feature/Patients/PatientCreateTest.php
|
|
|
|
# Run specific test method
|
|
./vendor/bin/phpunit --filter testCreatePatientSuccess tests/feature/Patients/PatientCreateTest.php
|
|
|
|
# Run tests with coverage
|
|
./vendor/bin/phpunit --coverage-html build/logs/html
|
|
|
|
# Run tests by suite
|
|
./vendor/bin/phpunit --testsuite App
|
|
|
|
# Run via composer
|
|
composer test
|
|
```
|
|
|
|
## Development Server
|
|
```bash
|
|
# Start PHP development server
|
|
php spark serve
|
|
|
|
# Or specify port
|
|
php spark serve --port 8080
|
|
```
|
|
|
|
## Database
|
|
```bash
|
|
# Run migrations
|
|
php spark migrate
|
|
|
|
# Rollback migrations
|
|
php spark migrate:rollback
|
|
|
|
# Create new migration
|
|
php spark make:migration CreateUsersTable
|
|
|
|
# Run database seeds
|
|
php spark db:seed DBSeeder
|
|
php spark db:seed PatientSeeder
|
|
```
|
|
|
|
## Code Generation (Scaffolding)
|
|
```bash
|
|
# Create controller
|
|
php spark make:controller Users
|
|
|
|
# Create model
|
|
php spark make:model UserModel
|
|
|
|
# Create migration
|
|
php spark make:migration CreateUsersTable
|
|
|
|
# Create seeder
|
|
php spark make:seeder UserSeeder
|
|
```
|
|
|
|
## API Documentation
|
|
```bash
|
|
# After updating YAML files, regenerate bundled docs
|
|
node public/bundle-api-docs.js
|
|
|
|
# Produces: public/api-docs.bundled.yaml
|
|
```
|
|
|
|
## Utilities (Windows)
|
|
```bash
|
|
# List files
|
|
dir
|
|
|
|
# Search in files (PowerShell)
|
|
Select-String -Path "app\*.php" -Pattern "PatientModel"
|
|
|
|
# Or using git bash (if available)
|
|
grep -r "PatientModel" app/
|
|
|
|
# Clear writable cache
|
|
del /q writable\cache\*
|
|
```
|
|
|
|
## Git Commands
|
|
```bash
|
|
# Check status
|
|
git status
|
|
|
|
# Add files
|
|
git add .
|
|
|
|
# Commit (only when explicitly asked)
|
|
git commit -m "message"
|
|
|
|
# View recent commits
|
|
git log --oneline -10
|
|
```
|