Skip to content

Commit

Permalink
Clean up test
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Oct 21, 2023
1 parent 02931c9 commit 57d170b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/framework/tests/Unit/CreatesNewMarkdownPostFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,27 @@ protected function setUp(): void
public function testWithDefaultData()
{
$action = new CreatesNewMarkdownPostFile('Example Title', null, null, null);
$array = $action->toArray();

$this->assertSame([
'title' => 'Example Title',
'description' => 'A short description used in previews and SEO',
'category' => 'blog',
'author' => 'default',
'date' => '2024-01-01 00:00',
], $array);
], $action->toArray());
}

public function testWithCustomData()
{
$action = new CreatesNewMarkdownPostFile('foo', 'bar', 'baz', 'qux', '2024-06-01 12:20');
$array = $action->toArray();

$this->assertSame([
'title' => 'foo',
'description' => 'bar',
'category' => 'baz',
'author' => 'qux',
'date' => '2024-06-01 12:20',
], $array);
], $action->toArray());
}

public function testSave()
Expand Down Expand Up @@ -101,8 +99,6 @@ public function testCustomDateNormalisation()
{
$action = new CreatesNewMarkdownPostFile('Example Post', null, null, null, 'Jan 1 2024 8am');

$array = $action->toArray();

$this->assertSame('2024-01-01 08:00', $array['date']);
$this->assertSame('2024-01-01 08:00', $action->toArray()['date']);
}
}

0 comments on commit 57d170b

Please sign in to comment.