From cc90bb88107e39cc81e7824287e2bf0d918dced0 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 3 Jul 2024 20:10:03 +0200 Subject: [PATCH 01/24] Remove newlines from code comments --- .../tests/Feature/PostsAuthorIntegrationTest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php b/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php index 9ecfc06093f..449f4ae9cc2 100644 --- a/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php +++ b/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php @@ -12,8 +12,7 @@ use Illuminate\Support\Facades\Config; /** - * Test that the Author feature works in - * conjunction with the static Post generator. + * Test that the Author feature works in conjunction with the static Post generator. * * @see StaticSiteBuilderPostModuleTest */ @@ -27,11 +26,9 @@ protected function setUp(): void } /** - * Baseline test to create a post without a defined author, - * and assert that the username is displayed as is. + * Baseline test to create a post without a defined author, and assert that the username is displayed as is. * - * Check that the author was not defined. - * We do this by building the static site and inspecting the DOM. + * Check that the author was not defined. We do this by building the static site and inspecting the DOM. */ public function testCreatePostWithUndefinedAuthor() { From e9a28322660c55fd74d3baa6ad7754ce7d435ceb Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 3 Jul 2024 20:10:19 +0200 Subject: [PATCH 02/24] Reword commends to be more fluent --- packages/framework/tests/Feature/PostsAuthorIntegrationTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php b/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php index 449f4ae9cc2..7273bf93be2 100644 --- a/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php +++ b/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php @@ -28,7 +28,7 @@ protected function setUp(): void /** * Baseline test to create a post without a defined author, and assert that the username is displayed as is. * - * Check that the author was not defined. We do this by building the static site and inspecting the DOM. + * Checks that the author was not defined, we do this by building the static site and inspecting the DOM. */ public function testCreatePostWithUndefinedAuthor() { From dab8512350bbd658529cac6a3c8047efce1817c9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 3 Jul 2024 20:10:43 +0200 Subject: [PATCH 03/24] Remove unnecessary identifier from test file name --- .../Feature/PostsAuthorIntegrationTest.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php b/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php index 7273bf93be2..2935ad70f88 100644 --- a/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php +++ b/packages/framework/tests/Feature/PostsAuthorIntegrationTest.php @@ -34,30 +34,30 @@ public function testCreatePostWithUndefinedAuthor() { // Create a new post (new CreatesNewMarkdownPostFile( - title: 'test-2dcbb2c-post-with-undefined-author', + title: 'test-post-with-undefined-author', description: '', category: '', author: 'test_undefined_author' ))->save(true); // Check that the post was created - $this->assertFileExists(Hyde::path('_posts/test-2dcbb2c-post-with-undefined-author.md')); + $this->assertFileExists(Hyde::path('_posts/test-post-with-undefined-author.md')); // Build the static page - $this->artisan('rebuild _posts/test-2dcbb2c-post-with-undefined-author.md')->assertExitCode(0); + $this->artisan('rebuild _posts/test-post-with-undefined-author.md')->assertExitCode(0); // Check that the file was created - $this->assertFileExists(Hyde::path('_site/posts/test-2dcbb2c-post-with-undefined-author.html')); + $this->assertFileExists(Hyde::path('_site/posts/test-post-with-undefined-author.html')); // Check that the author is rendered as is in the DOM $this->assertStringContainsString( '>test_undefined_author', - file_get_contents(Hyde::path('_site/posts/test-2dcbb2c-post-with-undefined-author.html')) + file_get_contents(Hyde::path('_site/posts/test-post-with-undefined-author.html')) ); // Remove the test files - Filesystem::unlink('_posts/test-2dcbb2c-post-with-undefined-author.md'); - Filesystem::unlink('_site/posts/test-2dcbb2c-post-with-undefined-author.html'); + Filesystem::unlink('_posts/test-post-with-undefined-author.md'); + Filesystem::unlink('_site/posts/test-post-with-undefined-author.html'); } /** @@ -67,35 +67,35 @@ public function testCreatePostWithDefinedAuthorWithName() { // Create a new post (new CreatesNewMarkdownPostFile( - title: 'test-2dcbb2c-post-with-defined-author-with-name', + title: 'test-post-with-defined-author-with-name', description: '', category: '', author: 'test_named_author' ))->save(true); // Check that the post was created - $this->assertFileExists(Hyde::path('_posts/test-2dcbb2c-post-with-defined-author-with-name.md')); + $this->assertFileExists(Hyde::path('_posts/test-post-with-defined-author-with-name.md')); Config::set('hyde.authors', [ Author::create('test_named_author', 'Test Author', null), ]); // Check that the post was created - $this->assertFileExists(Hyde::path('_posts/test-2dcbb2c-post-with-defined-author-with-name.md')); + $this->assertFileExists(Hyde::path('_posts/test-post-with-defined-author-with-name.md')); // Build the static page - $this->artisan('rebuild _posts/test-2dcbb2c-post-with-defined-author-with-name.md')->assertExitCode(0); + $this->artisan('rebuild _posts/test-post-with-defined-author-with-name.md')->assertExitCode(0); // Check that the file was created - $this->assertFileExists(Hyde::path('_site/posts/test-2dcbb2c-post-with-defined-author-with-name.html')); + $this->assertFileExists(Hyde::path('_site/posts/test-post-with-defined-author-with-name.html')); // Check that the author is contains the set name in the DOM $this->assertStringContainsString( 'Test Author', - file_get_contents(Hyde::path('_site/posts/test-2dcbb2c-post-with-defined-author-with-name.html')) + file_get_contents(Hyde::path('_site/posts/test-post-with-defined-author-with-name.html')) ); // Remove the test files - Filesystem::unlink('_posts/test-2dcbb2c-post-with-defined-author-with-name.md'); - Filesystem::unlink('_site/posts/test-2dcbb2c-post-with-defined-author-with-name.html'); + Filesystem::unlink('_posts/test-post-with-defined-author-with-name.md'); + Filesystem::unlink('_site/posts/test-post-with-defined-author-with-name.html'); } /** @@ -105,40 +105,40 @@ public function testCreatePostWithDefinedAuthorWithWebsite() { // Create a new post (new CreatesNewMarkdownPostFile( - title: 'test-2dcbb2c-post-with-defined-author-with-name', + title: 'test-post-with-defined-author-with-name', description: '', category: '', author: 'test_author_with_website' ))->save(true); // Check that the post was created - $this->assertFileExists(Hyde::path('_posts/test-2dcbb2c-post-with-defined-author-with-name.md')); + $this->assertFileExists(Hyde::path('_posts/test-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/test-2dcbb2c-post-with-defined-author-with-name.md')); + $this->assertFileExists(Hyde::path('_posts/test-post-with-defined-author-with-name.md')); // Build the static page - $this->artisan('rebuild _posts/test-2dcbb2c-post-with-defined-author-with-name.md')->assertExitCode(0); + $this->artisan('rebuild _posts/test-post-with-defined-author-with-name.md')->assertExitCode(0); // Check that the file was created - $this->assertFileExists(Hyde::path('_site/posts/test-2dcbb2c-post-with-defined-author-with-name.html')); + $this->assertFileExists(Hyde::path('_site/posts/test-post-with-defined-author-with-name.html')); // Check that the author is contains the set name in the DOM $this->assertStringContainsString( 'Test Author', - file_get_contents(Hyde::path('_site/posts/test-2dcbb2c-post-with-defined-author-with-name.html')) + file_get_contents(Hyde::path('_site/posts/test-post-with-defined-author-with-name.html')) ); // Check that the author is contains the set website in the DOM $this->assertStringContainsString( '