mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
* Added magic `*_exists` properties. * fix return datatype * disabled by default --------- Co-authored-by: Joel Stein <[email protected]>
33 lines
981 B
PHP
33 lines
981 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\RelationCountProperties;
|
|
|
|
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
|
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
|
|
|
class Test extends AbstractModelsCommand
|
|
{
|
|
protected function getEnvironmentSetUp($app)
|
|
{
|
|
parent::getEnvironmentSetUp($app);
|
|
|
|
$app['config']->set('ide-helper.write_model_relation_count_properties', false);
|
|
$app['config']->set('ide-helper.write_model_relation_exists_properties', false);
|
|
}
|
|
|
|
public function test(): void
|
|
{
|
|
$command = $this->app->make(ModelsCommand::class);
|
|
|
|
$tester = $this->runCommand($command, [
|
|
'--write' => true,
|
|
]);
|
|
|
|
$this->assertSame(0, $tester->getStatusCode());
|
|
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
|
$this->assertMatchesMockedSnapshot();
|
|
}
|
|
}
|