Adds a new scaffolding command, `/core:scaffold`, to generate boilerplate code for models, actions, controllers, and modules. The command includes subcommands for each component: - `/core:scaffold model <name>` - `/core:scaffold action <name>` - `/core:scaffold controller <name>` - `/core:scaffold module <name>` The templates follow the conventions of the Host UK monorepo and include necessary boilerplate code, namespaces, and directory structures. A placeholder test file is also included.
33 lines
951 B
PHP
33 lines
951 B
PHP
<?php
|
|
|
|
// Note: This test file is a placeholder and cannot be run in the current environment
|
|
// as the 'core' CLI tool is not available.
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ScaffoldTest extends TestCase
|
|
{
|
|
public function test_model_generation()
|
|
{
|
|
// This test would ideally run the scaffold command and verify the output.
|
|
// Example:
|
|
// passthru('/usr/bin/core /core:scaffold model User');
|
|
// $this->assertFileExists('app/Models/User.php');
|
|
$this->markTestSkipped('Cannot be run in this environment.');
|
|
}
|
|
|
|
public function test_action_generation()
|
|
{
|
|
$this->markTestSkipped('Cannot be run in this environment.');
|
|
}
|
|
|
|
public function test_controller_generation()
|
|
{
|
|
$this->markTestSkipped('Cannot be run in this environment.');
|
|
}
|
|
|
|
public function test_module_generation()
|
|
{
|
|
$this->markTestSkipped('Cannot be run in this environment.');
|
|
}
|
|
}
|