Skip to content

Commit

Permalink
Extract setup method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Oct 21, 2023
1 parent 73f3439 commit 6633d2b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/framework/tests/Unit/CreatesNewMarkdownPostFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
*/
class CreatesNewMarkdownPostFileTest extends TestCase
{
public function testWithDefaultData()
protected function setUp(): void
{
parent::setUp();

Carbon::setTestNow(Carbon::create(2024));
}

public function testWithDefaultData()
{
$action = new CreatesNewMarkdownPostFile('Example Title', null, null, null);
$array = $action->toArray();

Expand All @@ -34,8 +39,6 @@ public function testWithDefaultData()

public function testWithCustomData()
{
Carbon::setTestNow(Carbon::create(2024));

$action = new CreatesNewMarkdownPostFile('foo', 'bar', 'baz', 'qux');
$array = $action->toArray();

Expand All @@ -50,8 +53,6 @@ public function testWithCustomData()

public function testSave()
{
Carbon::setTestNow(Carbon::create(2024));

$action = new CreatesNewMarkdownPostFile('Example Post', null, null, null);
$action->save();

Expand Down

0 comments on commit 6633d2b

Please sign in to comment.