Skip to content

Commit

Permalink
Remove unnecessary test code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jul 3, 2024
1 parent c9f25d9 commit 71a95c4
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions packages/framework/tests/Feature/PostsAuthorIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,15 @@ protected function setUp(): void
*/
public function testCreatePostWithUndefinedAuthor()
{
// Create a new post
(new CreatesNewMarkdownPostFile(
title: 'post-with-undefined-author',
description: '',
category: '',
author: 'test_undefined_author'
))->save();

// Check that the post was created
$this->assertFileExists(Hyde::path('_posts/post-with-undefined-author.md'));

// Build the static page
$this->artisan('rebuild _posts/post-with-undefined-author.md')->assertExitCode(0);

// Check that the file was created
$this->assertFileExists(Hyde::path('_site/posts/post-with-undefined-author.html'));

// Check that the author is rendered as is in the DOM
Expand All @@ -55,7 +49,6 @@ public function testCreatePostWithUndefinedAuthor()
file_get_contents(Hyde::path('_site/posts/post-with-undefined-author.html'))
);

// Remove the test files
Filesystem::unlink('_posts/post-with-undefined-author.md');
Filesystem::unlink('_site/posts/post-with-undefined-author.html');
}
Expand All @@ -65,26 +58,21 @@ public function testCreatePostWithUndefinedAuthor()
*/
public function testCreatePostWithDefinedAuthorWithName()
{
// Create a new post
(new CreatesNewMarkdownPostFile(
title: 'post-with-defined-author-with-name',
description: '',
category: '',
author: 'named_author'
))->save();

// Check that the post was created
$this->assertFileExists(Hyde::path('_posts/post-with-defined-author-with-name.md'));

Config::set('hyde.authors', [
Author::create('named_author', 'Test Author', null),
]);

// Check that the post was created
$this->assertFileExists(Hyde::path('_posts/post-with-defined-author-with-name.md'));
// Build the static page
$this->artisan('rebuild _posts/post-with-defined-author-with-name.md')->assertExitCode(0);
// Check that the file was created
$this->assertFileExists(Hyde::path('_site/posts/post-with-defined-author-with-name.html'));

// Check that the author is contains the set name in the DOM
Expand All @@ -93,7 +81,6 @@ public function testCreatePostWithDefinedAuthorWithName()
file_get_contents(Hyde::path('_site/posts/post-with-defined-author-with-name.html'))
);

// Remove the test files
Filesystem::unlink('_posts/post-with-defined-author-with-name.md');
Filesystem::unlink('_site/posts/post-with-defined-author-with-name.html');
}
Expand All @@ -103,26 +90,21 @@ public function testCreatePostWithDefinedAuthorWithName()
*/
public function testCreatePostWithDefinedAuthorWithWebsite()
{
// Create a new post
(new CreatesNewMarkdownPostFile(
title: 'post-with-defined-author-with-name',
description: '',
category: '',
author: 'test_author_with_website'
))->save();

// Check that the post was created
$this->assertFileExists(Hyde::path('_posts/post-with-defined-author-with-name.md'));

Config::set('hyde.authors', [
Author::create('test_author_with_website', 'Test Author', 'https://example.org'),
]);

// Check that the post was created
$this->assertFileExists(Hyde::path('_posts/post-with-defined-author-with-name.md'));
// Build the static page
$this->artisan('rebuild _posts/post-with-defined-author-with-name.md')->assertExitCode(0);
// Check that the file was created
$this->assertFileExists(Hyde::path('_site/posts/post-with-defined-author-with-name.html'));

// Check that the author is contains the set name in the DOM
Expand All @@ -137,7 +119,6 @@ public function testCreatePostWithDefinedAuthorWithWebsite()
file_get_contents(Hyde::path('_site/posts/post-with-defined-author-with-name.html'))
);

// Remove the test files
Filesystem::unlink('_posts/post-with-defined-author-with-name.md');
Filesystem::unlink('_site/posts/post-with-defined-author-with-name.html');
}
Expand Down

0 comments on commit 71a95c4

Please sign in to comment.