You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
662 B
29 lines
662 B
<?php
|
|
|
|
namespace Tests\Generators;
|
|
|
|
use Tests\TestCase;
|
|
|
|
class ModelGeneratorTest extends TestCase
|
|
{
|
|
/** @test */
|
|
public function it_creates_correct_model_class_content()
|
|
{
|
|
$this->artisan('make:crud', ['name' => $this->modelName, '--no-interaction' => true]);
|
|
|
|
$modelPath = app_path($this->modelName.'.php');
|
|
$this->assertFileExists($modelPath);
|
|
$modelClassContent = "<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class {$this->modelName} extends Model
|
|
{
|
|
protected \$fillable = ['name', 'description'];
|
|
}
|
|
";
|
|
$this->assertEquals($modelClassContent, file_get_contents($modelPath));
|
|
}
|
|
}
|