Skip to content

Commit

Permalink
fix failing render command test
Browse files Browse the repository at this point in the history
separate two schema checks because they change output order sometimes
  • Loading branch information
wakebit committed Apr 24, 2023
1 parent 4e29e97 commit 1ecdfdf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/src/Command/Schema/RenderCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ public function testRender(): void
$console = $this->app->get(Kernel::class);
$exitCode = $console->call('cycle:schema:render', ['-nc' => true]);
$realOutput = $console->output();
$expectedOutput = [
$articlesOutput = [
'[customer] :: default.customers',
'Entity:', Customer::class,
'Mapper:', Mapper::class,
'Repository:', Repository::class,
'Primary key:', 'id',
'Fields', '(property -> db.field -> typecast)', 'id -> id -> int', 'name -> name',
'Relations:', 'not defined',
];

$customersOutput = [
'[article] :: default.articles',
'Entity:', Article::class,
'Mapper:', Mapper::class,
Expand All @@ -43,6 +45,7 @@ public function testRender(): void
: new \Illuminate\Foundation\Testing\Constraints\SeeInOrder($realOutput);

$this->assertSame(Command::SUCCESS, $exitCode);
$this->assertThat($expectedOutput, $constraint);
$this->assertThat($articlesOutput, $constraint);
$this->assertThat($customersOutput, $constraint);
}
}

0 comments on commit 1ecdfdf

Please sign in to comment.