mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
formatting
This commit is contained in:
@@ -26,24 +26,6 @@ class Test extends AbstractModelsCommand
|
|||||||
|
|
||||||
$this->assertSame(0, $tester->getStatusCode());
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
||||||
$this->assertMatchesMockedSnapshot();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @test */
|
|
||||||
public function it_doesnt_generate_phpdoc_for_model_doesnt_have_factory()
|
|
||||||
{
|
|
||||||
if (!version_compare(Application::VERSION, '8.2', '>=')) {
|
|
||||||
$this->markTestSkipped(
|
|
||||||
'This test only works in Laravel >= 8.2'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$command = $this->app->make(ModelsCommand::class);
|
|
||||||
|
|
||||||
$tester = $this->runCommand($command, [
|
|
||||||
'--write' => true,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->assertStringNotContainsString('not found', $tester->getDisplay());
|
$this->assertStringNotContainsString('not found', $tester->getDisplay());
|
||||||
$this->assertMatchesMockedSnapshot();
|
$this->assertMatchesMockedSnapshot();
|
||||||
}
|
}
|
||||||
|
|||||||
-56
@@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Models\ModelWithoutFactory
|
|
||||||
*
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory query()
|
|
||||||
* @mixin \Eloquent
|
|
||||||
*/
|
|
||||||
class ModelWithoutFactory extends Model
|
|
||||||
{
|
|
||||||
use HasFactory;
|
|
||||||
}
|
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Models;
|
|
||||||
|
|
||||||
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\SimpleFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Models\Simple
|
|
||||||
*
|
|
||||||
* @property integer $id
|
|
||||||
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\SimpleFactory factory(...$parameters)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
|
|
||||||
* @mixin \Eloquent
|
|
||||||
*/
|
|
||||||
class Simple extends Model
|
|
||||||
{
|
|
||||||
use HasFactory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new factory instance for the model.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
|
||||||
*/
|
|
||||||
protected static function newFactory()
|
|
||||||
{
|
|
||||||
return SimpleFactory::new();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user