Skip to content

Commit

Permalink
Generate array input test
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 18, 2022
1 parent 31db6af commit b210812
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,26 @@ public function test_command_with_text_input()
}

// array
public function test_command_with_array_input()
{
InputStreamHandler::mockInput("Foo\nBar");
$this->makeSchemaFile([
'fields' => [[
'type' => 'array',
'name' => 'tags',
'min' => '0',
'max' => '0',
],
],
]);

$this->artisan('make:publication test-publication')
->assertExitCode(0);

$this->assertTrue(File::exists(Hyde::path('test-publication/hello-world.md')));
$this->assertStringContainsString("Foo\nBar", file_get_contents(Hyde::path('test-publication/hello-world.md')));
}

protected function makeSchemaFile(array $merge = []): void
{
file_put_contents(
Expand Down

0 comments on commit b210812

Please sign in to comment.