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 faa07cf commit 675e0c6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/src/Console/Command/Schema/RenderCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,28 @@ public function testRender(): void
$commandTester = new CommandTester($this->container->get(RenderCommand::class));
$exitCode = $commandTester->execute(['-nc' => true], ['verbosity' => OutputInterface::VERBOSITY_VERBOSE]);
$realOutput = $commandTester->getDisplay();
$expectedOutput = [
'[customer] :: default.customers',
'Entity:', Customer::class,
$articlesOutput = [
'[article] :: default.articles',
'Entity:', Article::class,
'Mapper:', Mapper::class,
'Repository:', Repository::class,
'Primary key:', 'id',
'Fields', '(property -> db.field -> typecast)', 'id -> id -> int', 'name -> name',
'Fields', '(property -> db.field -> typecast)', 'id -> id -> int', 'title -> title', 'description -> description',
'Relations:', 'not defined',
];

'[article] :: default.articles',
'Entity:', Article::class,
$customersOutput = [
'[customer] :: default.customers',
'Entity:', Customer::class,
'Mapper:', Mapper::class,
'Repository:', Repository::class,
'Primary key:', 'id',
'Fields', '(property -> db.field -> typecast)', 'id -> id -> int', 'title -> title', 'description -> description',
'Fields', '(property -> db.field -> typecast)', 'id -> id -> int', 'name -> name',
'Relations:', 'not defined',
];

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

0 comments on commit 675e0c6

Please sign in to comment.