diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 436901227a8..2dbd819bd06 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -457,11 +457,34 @@ jobs: - name: Create README.md run: echo '# CI/CD generated reports for [${{ github.sha }}](https://github.com/hydephp/develop/commit/${{ github.sha }})' > master/README.md + # Generate directory listing + + - name: Download directory listing generator script + run: wget https://raw.githubusercontent.com/caendesilva/php-directory-listing/a741e74af1a3e5b8d8b730a437c1666945fbedab/directory-listing.php -O .build.php + + - name: Check download integrity + run: | + hash=$(sha256sum .build.php | awk '{print $1}') + if [ $hash = "af021b1bef61e31f426dcbc80540aa192e5a7cecf0db4f6b946851ab3101627d" ] ; then echo "Checksum $hash matches"; else echo "Checksum $hash not matching!" && exit 1 ; fi + + - name: Set path labels + run: | + echo "hydephp/develop" > .dl-pathlabel + echo "hydephp/develop/master" > master/.dl-pathlabel + + - name: Compile static root directory listing + run: php .build.php + + - name: Compile static master directory listing + run: cp .build.php master/.build.php && cd master && php .build.php + + # End directory listing + - name: Commit changes uses: EndBug/add-and-commit@v9 with: pull: 'origin gh-pages' - add: 'master' + add: '["master", "index.html"]' message: 'Upload live reports from test suite run ${{ github.sha }}' diff --git a/.idea/php.xml b/.idea/php.xml index 291ca1bf3df..4b3b2d00d12 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -11,7 +11,7 @@ - + @@ -177,6 +177,9 @@ + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eba21a1b0e..c5e5eebe17d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,41 @@ HydePHP consists of two primary components, Hyde/Hyde and Hyde/Framework. Develo +## [1.5.0](https://github.com/hydephp/develop/releases/tag/1.5.0) - 2024-02-13 + +### Improved Patch Release Strategy + +This release experiments some changes into how releases are handled to clarify the patch versioning of distributed packages compared to the monorepo source versioning. + +In short: We are now experimenting with rolling patch releases, where patches are released as soon as they're ready, leading to faster rollout of bugfixes. +This means that the patch version discrepancy between the monorepo and the distributed packages will be increased, but hopefully the end results will still be clearer, +thanks to the second related change: Prefixing the subpackage changes in this changelog with the package name. If there is no prefix, the change applies to the core package or the monorepo. + +All this to say, please keep in mind that when the monorepo gets a new minor version, the prefixed changes may already have been released as patches in their respective packages. +### Added +- Added the existing `media_extensions` option to the `hyde` configuration file in https://github.com/hydephp/develop/pull/1531 +- Added configuration options to add custom HTML to the `` and ` {{-- Add any extra scripts to include before the closing tag --}} -@stack('scripts') \ No newline at end of file +@stack('scripts') + +{{-- If the user has defined any custom scripts, render them here --}} +{!! config('hyde.scripts') !!} +{!! Includes::html('scripts') !!} diff --git a/packages/framework/src/Console/Commands/ServeCommand.php b/packages/framework/src/Console/Commands/ServeCommand.php index 98972f3442d..8660cc12e4f 100644 --- a/packages/framework/src/Console/Commands/ServeCommand.php +++ b/packages/framework/src/Console/Commands/ServeCommand.php @@ -14,6 +14,7 @@ use Illuminate\Support\Facades\Process; use function sprintf; +use function in_array; use function str_replace; use function class_exists; diff --git a/packages/framework/src/Facades/Config.php b/packages/framework/src/Facades/Config.php index 405aa727ac8..7c1c3fe9b27 100644 --- a/packages/framework/src/Facades/Config.php +++ b/packages/framework/src/Facades/Config.php @@ -7,6 +7,7 @@ use TypeError; use function sprintf; +use function gettype; use function call_user_func; /** diff --git a/packages/framework/src/Foundation/HydeKernel.php b/packages/framework/src/Foundation/HydeKernel.php index fdd5c788639..4b09b109027 100644 --- a/packages/framework/src/Foundation/HydeKernel.php +++ b/packages/framework/src/Foundation/HydeKernel.php @@ -50,7 +50,7 @@ class HydeKernel implements SerializableContract use Serializable; use Macroable; - final public const VERSION = '1.4.3'; + final public const VERSION = '1.5.0'; protected static self $instance; diff --git a/packages/framework/src/Framework/Actions/ConvertsMarkdownToPlainText.php b/packages/framework/src/Framework/Actions/ConvertsMarkdownToPlainText.php index c5638e536c3..d0a99ba1f0f 100644 --- a/packages/framework/src/Framework/Actions/ConvertsMarkdownToPlainText.php +++ b/packages/framework/src/Framework/Actions/ConvertsMarkdownToPlainText.php @@ -93,6 +93,7 @@ protected function applyStringTransformations(string $markdown): string foreach ($lines as $line => $contents) { $contents = $this->removeTables($contents); $contents = $this->removeBlockquotes($contents); + $contents = $this->trimWhitespace($contents); $lines[$line] = $contents; } @@ -127,4 +128,16 @@ protected function removeBlockquotes(string $contents): string return $contents; } + + protected function trimWhitespace(string $contents): string + { + // If it is a list, don't trim the whitespace + $firstCharacter = substr(trim($contents), 0, 1); + + if ($firstCharacter === '-' || $firstCharacter === '*' || $firstCharacter === '+' || is_numeric($firstCharacter)) { + return $contents; + } + + return trim($contents); + } } diff --git a/packages/framework/src/Support/Includes.php b/packages/framework/src/Support/Includes.php index 23a0b5ed5a4..c271475103e 100644 --- a/packages/framework/src/Support/Includes.php +++ b/packages/framework/src/Support/Includes.php @@ -7,11 +7,11 @@ use Hyde\Hyde; use Hyde\Markdown\Models\Markdown; use Illuminate\Support\Facades\Blade; +use Hyde\Framework\Concerns\InteractsWithDirectories; use function basename; use function file_exists; use function file_get_contents; -use function mkdir; /** * The Includes facade provides a simple way to access partials in the includes directory. @@ -20,6 +20,8 @@ */ class Includes { + use InteractsWithDirectories; + /** * @var string The directory where includes are stored. */ @@ -58,6 +60,24 @@ public static function get(string $filename, ?string $default = null): ?string return file_get_contents($path); } + /** + * Get the HTML contents of a partial file in the includes directory. + * + * @param string $filename The name of the partial file, with or without the extension. + * @param string|null $default The default value to return if the partial is not found. + * @return string|null The raw contents of the partial file, or the default value if not found. + */ + public static function html(string $filename, ?string $default = null): ?string + { + $path = static::path(basename($filename, '.html').'.html'); + + if (! file_exists($path)) { + return $default === null ? null : $default; + } + + return file_get_contents($path); + } + /** * Get the rendered Markdown of a partial file in the includes directory. * @@ -93,11 +113,4 @@ public static function blade(string $filename, ?string $default = null): ?string return Blade::render(file_get_contents($path)); } - - protected static function needsDirectory(string $directory): void - { - if (! file_exists($directory)) { - mkdir($directory, recursive: true); - } - } } diff --git a/packages/framework/tests/Feature/Actions/ConvertsMarkdownToPlainTextTest.php b/packages/framework/tests/Feature/Actions/ConvertsMarkdownToPlainTextTest.php index c8c2f220b82..60c0228fd3d 100644 --- a/packages/framework/tests/Feature/Actions/ConvertsMarkdownToPlainTextTest.php +++ b/packages/framework/tests/Feature/Actions/ConvertsMarkdownToPlainTextTest.php @@ -259,11 +259,11 @@ public function testItRemovesCode() public function testItRemovesCodeBlocks() { $markdown = <<<'MD' -

Hello World

+

Hello World

MD; $text = <<<'TXT' - Hello World + Hello World TXT; $this->assertSame($text, $this->convert($markdown)); @@ -367,9 +367,9 @@ public function testItRemovesHtml() $text = <<<'TXT' This word is bold. This word is italic. - - © My Company - + + © My Company + Hello World TXT; @@ -487,6 +487,23 @@ public function testItRemovesTables() $this->assertSame($text, $this->convert($markdown)); } + public function testItTrimsIndentation() + { + $markdown = <<<'MD' + foo + bar + baz + MD; + + $text = <<<'TXT' + foo + bar + baz + TXT; + + $this->assertSame($text, $this->convert($markdown)); + } + public function testWithEmptyString() { $this->assertSame('', $this->convert('')); diff --git a/packages/framework/tests/Feature/Actions/CreatesNewPageSourceFileTest.php b/packages/framework/tests/Feature/Actions/CreatesNewPageSourceFileTest.php index 67cf466df26..0748dbfa370 100644 --- a/packages/framework/tests/Feature/Actions/CreatesNewPageSourceFileTest.php +++ b/packages/framework/tests/Feature/Actions/CreatesNewPageSourceFileTest.php @@ -18,7 +18,7 @@ */ class CreatesNewPageSourceFileTest extends TestCase { - public function test_class_can_be_instantiated() + public function testClassCanBeInstantiated() { $this->assertInstanceOf( CreatesNewPageSourceFile::class, @@ -26,7 +26,7 @@ public function test_class_can_be_instantiated() ); } - public function test_that_an_exception_is_thrown_for_invalid_page_type() + public function testThatAnExceptionIsThrownForInvalidPageType() { $this->expectException(UnsupportedPageTypeException::class); $this->expectExceptionMessage('The page type must be either "markdown", "blade", or "documentation"'); @@ -34,7 +34,7 @@ public function test_that_an_exception_is_thrown_for_invalid_page_type() (new CreatesNewPageSourceFile('Test Page', 'invalid'))->save(); } - public function test_that_an_exception_is_thrown_if_file_already_exists_and_overwrite_is_false() + public function testThatAnExceptionIsThrownIfFileAlreadyExistsAndOverwriteIsFalse() { $this->file('_pages/foo.md', 'foo'); @@ -47,7 +47,7 @@ public function test_that_an_exception_is_thrown_if_file_already_exists_and_over Filesystem::unlink('_pages/foo.md'); } - public function test_that_can_save_file_returns_true_if_file_already_exists_and_overwrite_is_true() + public function testThatCanSaveFileReturnsTrueIfFileAlreadyExistsAndOverwriteIsTrue() { $this->file('_pages/foo.md', 'foo'); @@ -56,7 +56,7 @@ public function test_that_can_save_file_returns_true_if_file_already_exists_and_ Filesystem::unlink('_pages/foo.md'); } - public function test_exception_is_thrown_for_conflicting_blade_pages() + public function testExceptionIsThrownForConflictingBladePages() { $this->file('_pages/foo.blade.php', 'foo'); @@ -69,7 +69,7 @@ public function test_exception_is_thrown_for_conflicting_blade_pages() Filesystem::unlink('_pages/foo.blade.php'); } - public function test_exception_is_thrown_for_conflicting_documentation_pages() + public function testExceptionIsThrownForConflictingDocumentationPages() { $this->file('_docs/foo.md', 'foo'); @@ -82,7 +82,7 @@ public function test_exception_is_thrown_for_conflicting_documentation_pages() Filesystem::unlink('_docs/foo.md'); } - public function test_that_a_markdown_file_can_be_created_and_contains_expected_content() + public function testThatAMarkdownFileCanBeCreatedAndContainsExpectedContent() { (new CreatesNewPageSourceFile('Test Page'))->save(); @@ -95,7 +95,7 @@ public function test_that_a_markdown_file_can_be_created_and_contains_expected_c Filesystem::unlink('_pages/test-page.md'); } - public function test_that_a_blade_file_can_be_created_and_contains_expected_content() + public function testThatABladeFileCanBeCreatedAndContainsExpectedContent() { (new CreatesNewPageSourceFile('Test Page', BladePage::class))->save(); @@ -119,7 +119,7 @@ public function test_that_a_blade_file_can_be_created_and_contains_expected_cont Filesystem::unlink('_pages/test-page.blade.php'); } - public function test_that_a_documentation_file_can_be_created_and_contains_expected_content() + public function testThatADocumentationFileCanBeCreatedAndContainsExpectedContent() { (new CreatesNewPageSourceFile('Test Page', DocumentationPage::class))->save(); @@ -133,7 +133,7 @@ public function test_that_a_documentation_file_can_be_created_and_contains_expec Filesystem::unlink('_docs/test-page.md'); } - public function test_that_a_markdown_file_can_be_created_with_custom_content() + public function testThatAMarkdownFileCanBeCreatedWithCustomContent() { (new CreatesNewPageSourceFile('Test Page', customContent: 'Hello World!'))->save(); @@ -156,7 +156,7 @@ public function test_that_a_markdown_file_can_be_created_with_custom_content() Filesystem::unlink('_pages/test-page.md'); } - public function test_that_a_blade_file_can_be_created_with_custom_content() + public function testThatABladeFileCanBeCreatedWithCustomContent() { (new CreatesNewPageSourceFile('Test Page', BladePage::class, customContent: 'Hello World!'))->save(); @@ -184,7 +184,7 @@ public function test_that_a_blade_file_can_be_created_with_custom_content() Filesystem::unlink('_pages/test-page.blade.php'); } - public function test_that_the_file_path_can_be_returned() + public function testThatTheFilePathCanBeReturned() { $this->assertSame( Hyde::path('_pages/test-page.md'), @@ -200,21 +200,21 @@ public function test_that_the_file_path_can_be_returned() Filesystem::unlink('_pages/test-page.blade.php'); } - public function test_file_is_created_using_slug_generated_from_title() + public function testFileIsCreatedUsingSlugGeneratedFromTitle() { (new CreatesNewPageSourceFile('Foo Bar'))->save(); $this->assertFileExists(Hyde::path('_pages/foo-bar.md')); Filesystem::unlink('_pages/foo-bar.md'); } - public function test_action_can_generate_nested_pages() + public function testActionCanGenerateNestedPages() { (new CreatesNewPageSourceFile('foo/bar'))->save(); $this->assertFileExists(Hyde::path('_pages/foo/bar.md')); Filesystem::deleteDirectory('_pages/foo'); } - public function test_can_create_deeply_nested_pages() + public function testCanCreateDeeplyNestedPages() { (new CreatesNewPageSourceFile('/foo/bar/Foo Bar'))->save(); $this->assertFileExists(Hyde::path('_pages/foo/bar/foo-bar.md')); diff --git a/packages/framework/tests/Feature/AssetServiceTest.php b/packages/framework/tests/Feature/AssetServiceTest.php index 0f36c294238..b45d4d7b0f0 100644 --- a/packages/framework/tests/Feature/AssetServiceTest.php +++ b/packages/framework/tests/Feature/AssetServiceTest.php @@ -15,14 +15,14 @@ */ class AssetServiceTest extends TestCase { - public function test_media_link_returns_media_path_with_cache_key() + public function testMediaLinkReturnsMediaPathWithCacheKey() { $service = new AssetService(); $this->assertIsString($path = $service->mediaLink('app.css')); $this->assertEquals('media/app.css?v='.md5_file(Hyde::path('_media/app.css')), $path); } - public function test_media_link_returns_media_path_without_cache_key_if_cache_busting_is_disabled() + public function testMediaLinkReturnsMediaPathWithoutCacheKeyIfCacheBustingIsDisabled() { config(['hyde.enable_cache_busting' => false]); $service = new AssetService(); @@ -30,7 +30,7 @@ public function test_media_link_returns_media_path_without_cache_key_if_cache_bu $this->assertEquals('media/app.css', $path); } - public function test_media_link_supports_custom_media_directories() + public function testMediaLinkSupportsCustomMediaDirectories() { $this->directory('_assets'); $this->file('_assets/app.css'); diff --git a/packages/framework/tests/Feature/AuthorPostsIntegrationTest.php b/packages/framework/tests/Feature/AuthorPostsIntegrationTest.php index dedfcdcdb1c..bea078f5945 100644 --- a/packages/framework/tests/Feature/AuthorPostsIntegrationTest.php +++ b/packages/framework/tests/Feature/AuthorPostsIntegrationTest.php @@ -33,7 +33,7 @@ protected function setUp(): void * Check that the author was not defined. * We do this by building the static site and inspecting the DOM. */ - public function test_create_post_with_undefined_author() + public function testCreatePostWithUndefinedAuthor() { // Create a new post (new CreatesNewMarkdownPostFile( @@ -66,7 +66,7 @@ public function test_create_post_with_undefined_author() /** * Test that a defined author has its name injected into the DOM. */ - public function test_create_post_with_defined_author_with_name() + public function testCreatePostWithDefinedAuthorWithName() { // Create a new post (new CreatesNewMarkdownPostFile( @@ -104,7 +104,7 @@ public function test_create_post_with_defined_author_with_name() /** * Test that a defined author with website has its site linked. */ - public function test_create_post_with_defined_author_with_website() + public function testCreatePostWithDefinedAuthorWithWebsite() { // Create a new post (new CreatesNewMarkdownPostFile( diff --git a/packages/framework/tests/Feature/BladeMatterParserTest.php b/packages/framework/tests/Feature/BladeMatterParserTest.php index bc5300c8f23..d10deb88dbf 100644 --- a/packages/framework/tests/Feature/BladeMatterParserTest.php +++ b/packages/framework/tests/Feature/BladeMatterParserTest.php @@ -13,14 +13,14 @@ */ class BladeMatterParserTest extends TestCase { - public function test_can_parse_front_matter() + public function testCanParseFrontMatter() { $parser = new BladeMatterParser('@php($foo = "bar")'); $parser->parse(); $this->assertEquals(['foo' => 'bar'], $parser->get()); } - public function test_parse_string_helper_method() + public function testParseStringHelperMethod() { $this->assertSame( (new BladeMatterParser('foo'))->parse()->get(), @@ -28,7 +28,7 @@ public function test_parse_string_helper_method() ); } - public function test_parse_file_helper_method() + public function testParseFileHelperMethod() { $this->file('foo', 'foo'); $this->assertSame( @@ -37,7 +37,7 @@ public function test_parse_file_helper_method() ); } - public function test_can_parse_multiple_front_matter_lines() + public function testCanParseMultipleFrontMatterLines() { $document = <<<'BLADE' @php($foo = 'bar') @@ -47,7 +47,7 @@ public function test_can_parse_multiple_front_matter_lines() $this->assertEquals(['foo' => 'bar', 'bar' => 'baz', 'baz' => 'qux'], BladeMatterParser::parseString($document)); } - public function test_can_parse_front_matter_with_various_formats() + public function testCanParseFrontMatterWithVariousFormats() { $matrix = [ '@php($foo = "bar")' => ['foo' => 'bar'], @@ -61,41 +61,41 @@ public function test_can_parse_front_matter_with_various_formats() } } - public function test_can_parse_front_matter_with_array() + public function testCanParseFrontMatterWithArray() { $document = "@php(\$foo = ['bar' => 'baz'])"; $this->assertEquals(['foo' => ['bar' => 'baz']], BladeMatterParser::parseString($document)); } - public function test_line_matches_front_matter() + public function testLineMatchesFrontMatter() { $this->assertTrue(ParserTestClass::lineMatchesFrontMatter('@php($foo = "bar")')); $this->assertFalse(ParserTestClass::lineMatchesFrontMatter('foo bar')); } - public function test_directive_cannot_have_leading_whitespace() + public function testDirectiveCannotHaveLeadingWhitespace() { $this->assertFalse(ParserTestClass::lineMatchesFrontMatter(' @php($foo = "bar")')); } - public function test_directive_signature_cannot_contain_whitespace() + public function testDirectiveSignatureCannotContainWhitespace() { $this->assertFalse(ParserTestClass::lineMatchesFrontMatter('@php( $foo = "bar")')); $this->assertFalse(ParserTestClass::lineMatchesFrontMatter('@ php($foo = "bar")')); $this->assertFalse(ParserTestClass::lineMatchesFrontMatter('@ php ($foo = "bar")')); } - public function test_extract_key() + public function testExtractKey() { $this->assertSame('foo', ParserTestClass::extractKey('@php($foo = "bar")')); } - public function test_extract_value() + public function testExtractValue() { $this->assertSame('bar', ParserTestClass::extractValue('@php($foo = "bar")')); } - public function test_get_value_with_type() + public function testGetValueWithType() { $this->assertSame('string', ParserTestClass::getValueWithType('string')); $this->assertSame('string', ParserTestClass::getValueWithType('string')); @@ -110,7 +110,7 @@ public function test_get_value_with_type() $this->assertSame(['foo' => 'bar'], ParserTestClass::getValueWithType("['foo' => 'bar']")); } - public function test_parse_array_string() + public function testParseArrayString() { $this->assertSame(['foo' => 'bar'], ParserTestClass::parseArrayString('["foo" => "bar"]')); $this->assertSame(['foo' => 'bar'], ParserTestClass::parseArrayString('["foo" => "bar"]')); @@ -123,13 +123,13 @@ public function test_parse_array_string() $this->assertSame(['foo' => 1], ParserTestClass::parseArrayString('["foo" => 1]')); } - public function test_parse_invalid_array_string() + public function testParseInvalidArrayString() { $this->expectException(RuntimeException::class); ParserTestClass::parseArrayString('foo'); } - public function test_parse_multidimensional_array_string() + public function testParseMultidimensionalArrayString() { $this->expectException(RuntimeException::class); ParserTestClass::parseArrayString('["foo" => ["bar" => "baz"]]'); diff --git a/packages/framework/tests/Feature/Commands/BuildRssFeedCommandTest.php b/packages/framework/tests/Feature/Commands/BuildRssFeedCommandTest.php index c24051fb98e..1575896ada2 100644 --- a/packages/framework/tests/Feature/Commands/BuildRssFeedCommandTest.php +++ b/packages/framework/tests/Feature/Commands/BuildRssFeedCommandTest.php @@ -14,7 +14,7 @@ */ class BuildRssFeedCommandTest extends TestCase { - public function test_rss_feed_is_generated_when_conditions_are_met() + public function testRssFeedIsGeneratedWhenConditionsAreMet() { config(['hyde.url' => 'https://example.com']); config(['hyde.rss.enabled' => true]); @@ -27,7 +27,7 @@ public function test_rss_feed_is_generated_when_conditions_are_met() Filesystem::unlink('_site/feed.xml'); } - public function test_rss_filename_can_be_changed() + public function testRssFilenameCanBeChanged() { config(['hyde.url' => 'https://example.com']); config(['hyde.rss.enabled' => true]); diff --git a/packages/framework/tests/Feature/Commands/BuildSearchCommandTest.php b/packages/framework/tests/Feature/Commands/BuildSearchCommandTest.php index 6accb4a1370..d345354f738 100644 --- a/packages/framework/tests/Feature/Commands/BuildSearchCommandTest.php +++ b/packages/framework/tests/Feature/Commands/BuildSearchCommandTest.php @@ -18,7 +18,7 @@ */ class BuildSearchCommandTest extends TestCase { - public function test_it_creates_the_search_json_file() + public function testItCreatesTheSearchJsonFile() { $this->assertFileDoesNotExist(Hyde::path('_site/docs/search.json')); @@ -29,7 +29,7 @@ public function test_it_creates_the_search_json_file() Filesystem::unlink('_site/docs/search.html'); } - public function test_it_creates_the_search_page() + public function testItCreatesTheSearchPage() { $this->assertFileDoesNotExist(Hyde::path('_site/docs/search.html')); @@ -40,7 +40,7 @@ public function test_it_creates_the_search_page() Filesystem::unlink('_site/docs/search.html'); } - public function test_it_does_not_create_the_search_page_if_disabled() + public function testItDoesNotCreateTheSearchPageIfDisabled() { config(['docs.create_search_page' => false]); @@ -50,7 +50,7 @@ public function test_it_does_not_create_the_search_page_if_disabled() Filesystem::unlink('_site/docs/search.json'); } - public function test_it_does_not_display_the_estimation_message_when_it_is_less_than_1_second() + public function testItDoesNotDisplayTheEstimationMessageWhenItIsLessThan1Second() { $this->artisan('build:search') ->doesntExpectOutputToContain('> This will take an estimated') @@ -60,7 +60,7 @@ public function test_it_does_not_display_the_estimation_message_when_it_is_less_ Filesystem::unlink('_site/docs/search.html'); } - public function test_search_files_can_be_generated_for_custom_docs_output_directory() + public function testSearchFilesCanBeGeneratedForCustomDocsOutputDirectory() { DocumentationPage::setOutputDirectory('foo'); @@ -71,7 +71,7 @@ public function test_search_files_can_be_generated_for_custom_docs_output_direct Filesystem::deleteDirectory('_site/foo'); } - public function test_search_files_can_be_generated_for_custom_site_output_directory() + public function testSearchFilesCanBeGeneratedForCustomSiteOutputDirectory() { Hyde::setOutputDirectory('foo'); @@ -82,7 +82,7 @@ public function test_search_files_can_be_generated_for_custom_site_output_direct Filesystem::deleteDirectory('foo'); } - public function test_search_files_can_be_generated_for_custom_site_and_docs_output_directories() + public function testSearchFilesCanBeGeneratedForCustomSiteAndDocsOutputDirectories() { Hyde::setOutputDirectory('foo'); DocumentationPage::setOutputDirectory('bar'); @@ -94,7 +94,7 @@ public function test_search_files_can_be_generated_for_custom_site_and_docs_outp Filesystem::deleteDirectory('foo'); } - public function test_search_files_can_be_generated_for_custom_site_and_nested_docs_output_directories() + public function testSearchFilesCanBeGeneratedForCustomSiteAndNestedDocsOutputDirectories() { Hyde::setOutputDirectory('foo/bar'); DocumentationPage::setOutputDirectory('baz'); diff --git a/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php b/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php index 56dd2b17261..af77486f2cc 100644 --- a/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php +++ b/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php @@ -14,7 +14,7 @@ */ class BuildSitemapCommandTest extends TestCase { - public function test_sitemap_is_generated_when_conditions_are_met() + public function testSitemapIsGeneratedWhenConditionsAreMet() { config(['hyde.url' => 'https://example.com']); config(['hyde.generate_sitemap' => true]); diff --git a/packages/framework/tests/Feature/Commands/ChangeSourceDirectoryCommandTest.php b/packages/framework/tests/Feature/Commands/ChangeSourceDirectoryCommandTest.php index fc107f8938d..5a0fc3ce447 100644 --- a/packages/framework/tests/Feature/Commands/ChangeSourceDirectoryCommandTest.php +++ b/packages/framework/tests/Feature/Commands/ChangeSourceDirectoryCommandTest.php @@ -13,7 +13,7 @@ */ class ChangeSourceDirectoryCommandTest extends TestCase { - public function test_command_moves_source_directories_to_new_supplied_directory_and_updates_the_configuration_file() + public function testCommandMovesSourceDirectoriesToNewSuppliedDirectoryAndUpdatesTheConfigurationFile() { $this->file('_pages/tracker.txt', 'This should be moved to the new location'); @@ -51,7 +51,7 @@ public function test_command_moves_source_directories_to_new_supplied_directory_ Filesystem::putContents('config/hyde.php', $config); } - public function test_with_missing_config_search_string() + public function testWithMissingConfigSearchString() { $this->file('_pages/tracker.txt', 'This should be moved to the new location'); @@ -90,14 +90,14 @@ public function test_with_missing_config_search_string() Filesystem::putContents('config/hyde.php', $config); } - public function test_with_name_matching_current_value() + public function testWithNameMatchingCurrentValue() { $this->artisan('change:sourceDirectory /') ->expectsOutput("The directory '/' is already set as the project source root!") ->assertExitCode(409); } - public function test_with_existing_directory() + public function testWithExistingDirectory() { $this->directory('test'); $this->directory('test/_pages'); @@ -108,7 +108,7 @@ public function test_with_existing_directory() ->assertExitCode(409); } - public function test_with_target_containing_subdirectory_file() + public function testWithTargetContainingSubdirectoryFile() { $this->directory('test'); $this->file('test/_pages'); @@ -118,7 +118,7 @@ public function test_with_target_containing_subdirectory_file() ->assertExitCode(409); } - public function test_with_target_being_file() + public function testWithTargetBeingFile() { $this->file('test'); diff --git a/packages/framework/tests/Feature/Commands/DebugCommandTest.php b/packages/framework/tests/Feature/Commands/DebugCommandTest.php index 938a0caf528..5cd341b0dc7 100644 --- a/packages/framework/tests/Feature/Commands/DebugCommandTest.php +++ b/packages/framework/tests/Feature/Commands/DebugCommandTest.php @@ -18,12 +18,12 @@ protected function setUp(): void $this->app->bind('git.version', fn () => 'foo'); } - public function test_debug_command_can_run() + public function testDebugCommandCanRun() { $this->artisan('debug')->assertExitCode(0); } - public function test_it_prints_debug_information() + public function testItPrintsDebugInformation() { $this->artisan('debug') ->expectsOutput('HydePHP Debug Screen') @@ -36,7 +36,7 @@ public function test_it_prints_debug_information() ->assertExitCode(0); } - public function test_it_prints_verbose_debug_information() + public function testItPrintsVerboseDebugInformation() { $this->artisan('debug --verbose') ->expectsOutput('HydePHP Debug Screen') diff --git a/packages/framework/tests/Feature/Commands/MakePageCommandTest.php b/packages/framework/tests/Feature/Commands/MakePageCommandTest.php index bae51389d1b..182c3850b41 100644 --- a/packages/framework/tests/Feature/Commands/MakePageCommandTest.php +++ b/packages/framework/tests/Feature/Commands/MakePageCommandTest.php @@ -40,12 +40,12 @@ protected function tearDown(): void parent::tearDown(); } - public function test_command_can_run() + public function testCommandCanRun() { $this->artisan('make:page "foo test page"')->assertExitCode(0); } - public function test_command_output() + public function testCommandOutput() { $this->artisan('make:page "foo test page"') ->expectsOutputToContain('Creating a new page!') @@ -53,19 +53,19 @@ public function test_command_output() ->assertExitCode(0); } - public function test_command_allows_user_to_specify_page_type() + public function testCommandAllowsUserToSpecifyPageType() { $this->artisan('make:page "foo test page" --type=markdown')->assertExitCode(0); $this->artisan('make:page "foo test page" --type=blade')->assertExitCode(0); } - public function test_type_option_is_case_insensitive() + public function testTypeOptionIsCaseInsensitive() { $this->artisan('make:page "foo test page" --type=Markdown')->assertExitCode(0); $this->artisan('make:page "foo test page" --type=Blade')->assertExitCode(0); } - public function test_command_fails_if_user_specifies_invalid_page_type() + public function testCommandFailsIfUserSpecifiesInvalidPageType() { $this->expectException(Exception::class); $this->expectExceptionMessage('The page type [invalid] is not supported.'); @@ -73,21 +73,21 @@ public function test_command_fails_if_user_specifies_invalid_page_type() $this->artisan('make:page "foo test page" --type=invalid')->assertExitCode(400); } - public function test_command_creates_markdown_file() + public function testCommandCreatesMarkdownFile() { $this->artisan('make:page "foo test page"')->assertExitCode(0); $this->assertFileExists($this->markdownPath); } - public function test_command_creates_blade_file() + public function testCommandCreatesBladeFile() { $this->artisan('make:page "foo test page" --type="blade"')->assertExitCode(0); $this->assertFileExists($this->bladePath); } - public function test_command_creates_documentation_file() + public function testCommandCreatesDocumentationFile() { $this->artisan('make:page "foo test page" --type="documentation"')->assertExitCode(0); @@ -95,7 +95,7 @@ public function test_command_creates_documentation_file() Filesystem::unlink('_docs/foo-test-page.md'); } - public function test_command_fails_if_file_already_exists() + public function testCommandFailsIfFileAlreadyExists() { file_put_contents($this->markdownPath, 'This should not be overwritten'); @@ -107,7 +107,7 @@ public function test_command_fails_if_file_already_exists() $this->assertEquals('This should not be overwritten', file_get_contents($this->markdownPath)); } - public function test_command_overwrites_existing_files_when_force_option_is_used() + public function testCommandOverwritesExistingFilesWhenForceOptionIsUsed() { file_put_contents($this->markdownPath, 'This should be overwritten'); @@ -116,7 +116,7 @@ public function test_command_overwrites_existing_files_when_force_option_is_used $this->assertNotEquals('This should be overwritten', file_get_contents($this->markdownPath)); } - public function test_command_prompts_for_title_if_it_was_not_specified() + public function testCommandPromptsForTitleIfItWasNotSpecified() { $this->artisan('make:page') ->expectsQuestion('What is the title of the page?', 'Test Page') @@ -126,7 +126,7 @@ public function test_command_prompts_for_title_if_it_was_not_specified() Filesystem::unlink('_pages/test-page.md'); } - public function test_command_falls_back_to_default_title_if_user_enters_nothing() + public function testCommandFallsBackToDefaultTitleIfUserEntersNothing() { $this->artisan('make:page') ->expectsQuestion('What is the title of the page?', null) @@ -136,7 +136,7 @@ public function test_command_falls_back_to_default_title_if_user_enters_nothing( Filesystem::unlink('_pages/my-new-page.md'); } - public function test_page_type_shorthand_can_be_used_to_create_blade_pages() + public function testPageTypeShorthandCanBeUsedToCreateBladePages() { $this->artisan('make:page "foo test page" --blade') ->expectsOutput("Creating a new Blade page with title: foo test page\n") @@ -145,7 +145,7 @@ public function test_page_type_shorthand_can_be_used_to_create_blade_pages() $this->assertFileExists($this->bladePath); } - public function test_page_type_shorthand_can_be_used_to_create_documentation_pages() + public function testPageTypeShorthandCanBeUsedToCreateDocumentationPages() { $this->artisan('make:page "foo test page" --docs') ->expectsOutput("Creating a new Documentation page with title: foo test page\n") diff --git a/packages/framework/tests/Feature/Commands/MakePostCommandTest.php b/packages/framework/tests/Feature/Commands/MakePostCommandTest.php index f275a9e010d..86dee0670e0 100644 --- a/packages/framework/tests/Feature/Commands/MakePostCommandTest.php +++ b/packages/framework/tests/Feature/Commands/MakePostCommandTest.php @@ -14,7 +14,7 @@ */ class MakePostCommandTest extends TestCase { - public function test_command_has_expected_output_and_creates_valid_file() + public function testCommandHasExpectedOutputAndCreatesValidFile() { // Assert that no old file exists which would cause issues $this->assertFileDoesNotExist(Hyde::path('_posts/test-post.md')); @@ -46,7 +46,7 @@ public function test_command_has_expected_output_and_creates_valid_file() Filesystem::unlink('_posts/test-post.md'); } - public function test_that_files_are_not_overwritten_when_force_flag_is_not_set() + public function testThatFilesAreNotOverwrittenWhenForceFlagIsNotSet() { file_put_contents(Hyde::path('_posts/test-post.md'), 'This should not be overwritten'); $this->artisan('make:post') @@ -69,7 +69,7 @@ public function test_that_files_are_not_overwritten_when_force_flag_is_not_set() Filesystem::unlink('_posts/test-post.md'); } - public function test_that_files_are_overwritten_when_force_flag_is_set() + public function testThatFilesAreOverwrittenWhenForceFlagIsSet() { file_put_contents(Hyde::path('_posts/test-post.md'), 'This should be overwritten'); $this->artisan('make:post --force') @@ -94,7 +94,7 @@ public function test_that_files_are_overwritten_when_force_flag_is_set() Filesystem::unlink('_posts/test-post.md'); } - public function test_that_title_can_be_specified_in_command_signature() + public function testThatTitleCanBeSpecifiedInCommandSignature() { $this->artisan('make:post "Test Post"') ->expectsOutputToContain('Selected title: Test Post') @@ -108,7 +108,7 @@ public function test_that_title_can_be_specified_in_command_signature() Filesystem::unlink('_posts/test-post.md'); } - public function test_that_command_can_be_canceled() + public function testThatCommandCanBeCanceled() { $this->artisan('make:post "Test Post"') ->expectsOutputToContain('Selected title: Test Post') diff --git a/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php b/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php index 0ece3ba6c0f..e25bed1a5d4 100644 --- a/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php +++ b/packages/framework/tests/Feature/Commands/PackageDiscoverCommandTest.php @@ -13,7 +13,7 @@ */ class PackageDiscoverCommandTest extends TestCase { - public function test_package_discover_command_registers_manifest_path() + public function testPackageDiscoverCommandRegistersManifestPath() { $this->artisan('package:discover')->assertExitCode(0); diff --git a/packages/framework/tests/Feature/Commands/PublishConfigsCommandTest.php b/packages/framework/tests/Feature/Commands/PublishConfigsCommandTest.php index 4547367c9c3..e2b32d657a2 100644 --- a/packages/framework/tests/Feature/Commands/PublishConfigsCommandTest.php +++ b/packages/framework/tests/Feature/Commands/PublishConfigsCommandTest.php @@ -30,7 +30,7 @@ public function tearDown(): void parent::tearDown(); } - public function test_command_has_expected_output() + public function testCommandHasExpectedOutput() { $this->artisan('publish:configs') ->expectsChoice('Which configuration files do you want to publish?', 'All configs', $this->expectedOptions()) @@ -38,7 +38,7 @@ public function test_command_has_expected_output() ->assertExitCode(0); } - public function test_config_files_are_published() + public function testConfigFilesArePublished() { $this->assertDirectoryDoesNotExist(Hyde::path('config')); @@ -51,7 +51,7 @@ public function test_config_files_are_published() $this->assertDirectoryExists(Hyde::path('config')); } - public function test_command_overwrites_existing_files() + public function testCommandOverwritesExistingFiles() { File::makeDirectory(Hyde::path('config')); File::put(Hyde::path('config/hyde.php'), 'foo'); diff --git a/packages/framework/tests/Feature/Commands/PublishHomepageCommandTest.php b/packages/framework/tests/Feature/Commands/PublishHomepageCommandTest.php index 6bf15b2b641..bd0bdfc0e8d 100644 --- a/packages/framework/tests/Feature/Commands/PublishHomepageCommandTest.php +++ b/packages/framework/tests/Feature/Commands/PublishHomepageCommandTest.php @@ -28,12 +28,12 @@ protected function tearDown(): void parent::tearDown(); } - public function test_there_are_no_default_pages() + public function testThereAreNoDefaultPages() { $this->assertFileDoesNotExist(Hyde::path('_pages/index.blade.php')); } - public function test_command_returns_expected_output() + public function testCommandReturnsExpectedOutput() { $this->artisan('publish:homepage welcome') ->expectsConfirmation('Would you like to rebuild the site?') @@ -42,7 +42,7 @@ public function test_command_returns_expected_output() $this->assertFileExistsThenDeleteIt(); } - public function test_command_returns_expected_output_with_rebuild() + public function testCommandReturnsExpectedOutputWithRebuild() { $this->artisan('publish:homepage welcome') ->expectsConfirmation('Would you like to rebuild the site?', 'yes') @@ -54,7 +54,7 @@ public function test_command_returns_expected_output_with_rebuild() $this->resetSite(); } - public function test_command_prompts_for_output() + public function testCommandPromptsForOutput() { $this->artisan('publish:homepage') ->expectsQuestion( @@ -68,7 +68,7 @@ public function test_command_prompts_for_output() $this->assertFileExistsThenDeleteIt(); } - public function test_command_shows_feedback_output_when_supplying_a_homepage_name() + public function testCommandShowsFeedbackOutputWhenSupplyingAHomepageName() { $this->artisan('publish:homepage welcome') ->expectsOutput('Published page [welcome]') @@ -78,7 +78,7 @@ public function test_command_shows_feedback_output_when_supplying_a_homepage_nam $this->assertFileExistsThenDeleteIt(); } - public function test_command_handles_error_code_404() + public function testCommandHandlesErrorCode404() { $this->artisan('publish:homepage invalid-page') ->assertExitCode(404); @@ -86,7 +86,7 @@ public function test_command_handles_error_code_404() $this->assertFileDoesNotExist(Hyde::path('_pages/index.blade.php')); } - public function test_command_does_not_overwrite_modified_files_without_force_flag() + public function testCommandDoesNotOverwriteModifiedFilesWithoutForceFlag() { file_put_contents(Hyde::path('_pages/index.blade.php'), 'foo'); @@ -98,7 +98,7 @@ public function test_command_does_not_overwrite_modified_files_without_force_fla $this->assertFileExistsThenDeleteIt(); } - public function test_command_overwrites_modified_files_if_force_flag_is_set() + public function testCommandOverwritesModifiedFilesIfForceFlagIsSet() { file_put_contents(Hyde::path('_pages/index.blade.php'), 'foo'); @@ -110,7 +110,7 @@ public function test_command_overwrites_modified_files_if_force_flag_is_set() $this->assertFileExistsThenDeleteIt(); } - public function test_command_does_not_return_409_if_the_current_file_is_a_default_file() + public function testCommandDoesNotReturn409IfTheCurrentFileIsADefaultFile() { copy(Hyde::vendorPath('resources/views/layouts/app.blade.php'), Hyde::path('_pages/index.blade.php')); diff --git a/packages/framework/tests/Feature/Commands/PublishViewsCommandTest.php b/packages/framework/tests/Feature/Commands/PublishViewsCommandTest.php index 7a05866ec29..1539183333a 100644 --- a/packages/framework/tests/Feature/Commands/PublishViewsCommandTest.php +++ b/packages/framework/tests/Feature/Commands/PublishViewsCommandTest.php @@ -15,7 +15,7 @@ */ class PublishViewsCommandTest extends TestCase { - public function test_command_publishes_views() + public function testCommandPublishesViews() { $path = str_replace('\\', '/', Hyde::pathToRelative(realpath(Hyde::vendorPath('resources/views/pages/404.blade.php')))); $this->artisan('publish:views') @@ -30,7 +30,7 @@ public function test_command_publishes_views() } } - public function test_can_select_view() + public function testCanSelectView() { $path = str_replace('\\', '/', Hyde::pathToRelative(realpath(Hyde::vendorPath('resources/views/pages/404.blade.php')))); $this->artisan('publish:views page-404') @@ -44,7 +44,7 @@ public function test_can_select_view() } } - public function test_with_invalid_supplied_tag() + public function testWithInvalidSuppliedTag() { $this->artisan('publish:views invalid') ->expectsOutputToContain('No publishable resources for tag [invalid].') diff --git a/packages/framework/tests/Feature/Commands/RebuildPageCommandTest.php b/packages/framework/tests/Feature/Commands/RebuildPageCommandTest.php index bae858b4f80..5a44f08220c 100644 --- a/packages/framework/tests/Feature/Commands/RebuildPageCommandTest.php +++ b/packages/framework/tests/Feature/Commands/RebuildPageCommandTest.php @@ -12,7 +12,7 @@ */ class RebuildPageCommandTest extends TestCase { - public function test_handle_is_successful_with_valid_path() + public function testHandleIsSuccessfulWithValidPath() { $this->file('_pages/test-page.md', 'foo'); @@ -23,7 +23,7 @@ public function test_handle_is_successful_with_valid_path() $this->resetSite(); } - public function test_media_files_can_be_transferred() + public function testMediaFilesCanBeTransferred() { $this->directory(Hyde::path('_site/media')); $this->file('_media/test.jpg'); @@ -33,21 +33,21 @@ public function test_media_files_can_be_transferred() $this->assertFileExists(Hyde::path('_site/media/test.jpg')); } - public function test_validate_catches_bad_source_directory() + public function testValidateCatchesBadSourceDirectory() { $this->artisan('rebuild foo/bar') ->expectsOutput('Path [foo/bar] is not in a valid source directory.') ->assertExitCode(400); } - public function test_validate_catches_missing_file() + public function testValidateCatchesMissingFile() { $this->artisan('rebuild _pages/foo.md') ->expectsOutput('File [_pages/foo.md] not found.') ->assertExitCode(404); } - public function test_rebuild_documentation_page() + public function testRebuildDocumentationPage() { $this->file('_docs/foo.md'); @@ -58,7 +58,7 @@ public function test_rebuild_documentation_page() $this->resetSite(); } - public function test_rebuild_blog_post() + public function testRebuildBlogPost() { $this->file('_posts/foo.md'); diff --git a/packages/framework/tests/Feature/Commands/ServeCommandTest.php b/packages/framework/tests/Feature/Commands/ServeCommandTest.php index 7aa1cd8d41d..aee041919e3 100644 --- a/packages/framework/tests/Feature/Commands/ServeCommandTest.php +++ b/packages/framework/tests/Feature/Commands/ServeCommandTest.php @@ -25,7 +25,7 @@ protected function setUp(): void Process::fake(); } - public function test_hyde_serve_command() + public function testHydeServeCommand() { $this->artisan('serve --no-ansi') ->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop') @@ -34,7 +34,7 @@ public function test_hyde_serve_command() Process::assertRan("php -S localhost:8080 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_port_option() + public function testHydeServeCommandWithPortOption() { $this->artisan('serve --no-ansi --port=8081') ->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop') @@ -43,7 +43,7 @@ public function test_hyde_serve_command_with_port_option() Process::assertRan("php -S localhost:8081 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_host_option() + public function testHydeServeCommandWithHostOption() { $this->artisan('serve --no-ansi --host=foo') ->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop') @@ -52,7 +52,7 @@ public function test_hyde_serve_command_with_host_option() Process::assertRan("php -S foo:8080 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_port_and_host_option() + public function testHydeServeCommandWithPortAndHostOption() { $this->artisan('serve --no-ansi --port=8081 --host=foo') ->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop') @@ -61,7 +61,7 @@ public function test_hyde_serve_command_with_port_and_host_option() Process::assertRan("php -S foo:8081 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_port_defined_in_config() + public function testHydeServeCommandWithPortDefinedInConfig() { config(['hyde.server.port' => 8081]); @@ -72,7 +72,7 @@ public function test_hyde_serve_command_with_port_defined_in_config() Process::assertRan("php -S localhost:8081 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_port_defined_in_config_and_port_option() + public function testHydeServeCommandWithPortDefinedInConfigAndPortOption() { config(['hyde.server.port' => 8081]); @@ -83,7 +83,7 @@ public function test_hyde_serve_command_with_port_defined_in_config_and_port_opt Process::assertRan("php -S localhost:8082 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_port_missing_in_config_and_port_option() + public function testHydeServeCommandWithPortMissingInConfigAndPortOption() { config(['hyde.server.port' => null]); @@ -94,7 +94,7 @@ public function test_hyde_serve_command_with_port_missing_in_config_and_port_opt Process::assertRan("php -S localhost:8081 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_host_defined_in_config() + public function testHydeServeCommandWithHostDefinedInConfig() { config(['hyde.server.host' => 'foo']); @@ -105,7 +105,7 @@ public function test_hyde_serve_command_with_host_defined_in_config() Process::assertRan("php -S foo:8080 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_host_defined_in_config_and_host_option() + public function testHydeServeCommandWithHostDefinedInConfigAndHostOption() { config(['hyde.server.host' => 'foo']); @@ -116,7 +116,7 @@ public function test_hyde_serve_command_with_host_defined_in_config_and_host_opt Process::assertRan("php -S bar:8080 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_host_missing_in_config_and_host_option() + public function testHydeServeCommandWithHostMissingInConfigAndHostOption() { config(['hyde.server.host' => null]); @@ -127,7 +127,7 @@ public function test_hyde_serve_command_with_host_missing_in_config_and_host_opt Process::assertRan("php -S foo:8080 {$this->binaryPath()}"); } - public function test_hyde_serve_command_with_invalid_config_value() + public function testHydeServeCommandWithInvalidConfigValue() { $this->expectException(TypeError::class); config(['hyde.server.port' => 'foo']); @@ -137,7 +137,7 @@ public function test_hyde_serve_command_with_invalid_config_value() ->assertExitCode(0); } - public function test_hyde_serve_command_passes_through_process_output() + public function testHydeServeCommandPassesThroughProcessOutput() { Process::shouldReceive('forever') ->once() diff --git a/packages/framework/tests/Feature/Commands/ValidateCommandTest.php b/packages/framework/tests/Feature/Commands/ValidateCommandTest.php index ac462594ced..523f83a3300 100644 --- a/packages/framework/tests/Feature/Commands/ValidateCommandTest.php +++ b/packages/framework/tests/Feature/Commands/ValidateCommandTest.php @@ -15,7 +15,7 @@ */ class ValidateCommandTest extends TestCase { - public function test_validate_command_can_run() + public function testValidateCommandCanRun() { // Ensure the environment is clean to prevent false positives config(['torchlight.token' => null]); @@ -28,7 +28,7 @@ public function test_validate_command_can_run() ->assertExitCode(0); } - public function test_validate_command_can_run_with_skips() + public function testValidateCommandCanRunWithSkips() { // Trigger skipping of Torchlight and documentation index check config(['hyde.features' => []]); diff --git a/packages/framework/tests/Feature/Commands/VendorPublishCommandTest.php b/packages/framework/tests/Feature/Commands/VendorPublishCommandTest.php index a772c5fec1e..dfeab8cc6f8 100644 --- a/packages/framework/tests/Feature/Commands/VendorPublishCommandTest.php +++ b/packages/framework/tests/Feature/Commands/VendorPublishCommandTest.php @@ -33,7 +33,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_command_prompts_for_provider_or_tag() + public function testCommandPromptsForProviderOrTag() { ServiceProvider::$publishes = [ 'ExampleProvider' => '', @@ -51,7 +51,7 @@ public function test_command_prompts_for_provider_or_tag() ->assertExitCode(0); } - public function test_unhelpful_publishers_are_removed() + public function testUnhelpfulPublishersAreRemoved() { ServiceProvider::$publishes = [ LaravelConsoleSummaryServiceProvider::class => '', @@ -64,7 +64,7 @@ public function test_unhelpful_publishers_are_removed() ])->assertExitCode(0); } - public function test_config_group_is_renamed_to_be_more_helpful() + public function testConfigGroupIsRenamedToBeMoreHelpful() { ServiceProvider::$publishes = []; ServiceProvider::$publishGroups = [ @@ -78,7 +78,7 @@ public function test_config_group_is_renamed_to_be_more_helpful() ])->assertExitCode(0); } - public function test_can_select_default() + public function testCanSelectDefault() { ServiceProvider::$publishes = []; ServiceProvider::$publishGroups = []; @@ -89,7 +89,7 @@ public function test_can_select_default() ])->assertExitCode(0); } - public function test_status_method() + public function testStatusMethod() { $command = new StatusMethodTestClass($this->createMock(Filesystem::class)); diff --git a/packages/framework/tests/Feature/ConfigurableFeaturesTest.php b/packages/framework/tests/Feature/ConfigurableFeaturesTest.php index 6c1cf367151..897236a50da 100644 --- a/packages/framework/tests/Feature/ConfigurableFeaturesTest.php +++ b/packages/framework/tests/Feature/ConfigurableFeaturesTest.php @@ -13,7 +13,7 @@ */ class ConfigurableFeaturesTest extends TestCase { - public function test_has_feature_returns_false_when_feature_is_not_enabled() + public function testHasFeatureReturnsFalseWhenFeatureIsNotEnabled() { Config::set('hyde.features', []); // Foreach method in Features class that begins with "has" @@ -25,7 +25,7 @@ public function test_has_feature_returns_false_when_feature_is_not_enabled() } } - public function test_has_feature_returns_true_when_feature_is_enabled() + public function testHasFeatureReturnsTrueWhenFeatureIsEnabled() { $features = []; foreach (get_class_methods(Features::class) as $method) { @@ -41,26 +41,26 @@ public function test_has_feature_returns_true_when_feature_is_enabled() } } - public function test_can_generate_sitemap_helper_returns_true_if_hyde_has_base_url() + public function testCanGenerateSitemapHelperReturnsTrueIfHydeHasBaseUrl() { config(['hyde.url' => 'foo']); $this->assertTrue(Features::sitemap()); } - public function test_can_generate_sitemap_helper_returns_false_if_hyde_does_not_have_base_url() + public function testCanGenerateSitemapHelperReturnsFalseIfHydeDoesNotHaveBaseUrl() { config(['hyde.url' => '']); $this->assertFalse(Features::sitemap()); } - public function test_can_generate_sitemap_helper_returns_false_if_sitemaps_are_disabled_in_config() + public function testCanGenerateSitemapHelperReturnsFalseIfSitemapsAreDisabledInConfig() { config(['hyde.url' => 'foo']); config(['hyde.generate_sitemap' => false]); $this->assertFalse(Features::sitemap()); } - public function test_to_array_method_returns_method_array() + public function testToArrayMethodReturnsMethodArray() { $array = (new Features)->toArray(); $this->assertIsArray($array); @@ -72,7 +72,7 @@ public function test_to_array_method_returns_method_array() } } - public function test_to_array_method_contains_all_settings() + public function testToArrayMethodContainsAllSettings() { $array = (new Features)->toArray(); @@ -88,7 +88,7 @@ public function test_to_array_method_contains_all_settings() $this->assertCount(8, $array); } - public function test_features_can_be_mocked() + public function testFeaturesCanBeMocked() { Features::mock('darkmode', true); $this->assertTrue(Features::hasDarkmode()); @@ -97,7 +97,7 @@ public function test_features_can_be_mocked() $this->assertFalse(Features::hasDarkmode()); } - public function test_dynamic_features_can_be_mocked() + public function testDynamicFeaturesCanBeMocked() { Features::mock('rss', true); $this->assertTrue(Features::rss()); @@ -106,7 +106,7 @@ public function test_dynamic_features_can_be_mocked() $this->assertFalse(Features::rss()); } - public function test_multiple_features_can_be_mocked() + public function testMultipleFeaturesCanBeMocked() { Features::mock([ 'rss' => true, diff --git a/packages/framework/tests/Feature/ConfigurableSourceRootsFeatureTest.php b/packages/framework/tests/Feature/ConfigurableSourceRootsFeatureTest.php index 0d2a4e62b63..1fa0cd671bd 100644 --- a/packages/framework/tests/Feature/ConfigurableSourceRootsFeatureTest.php +++ b/packages/framework/tests/Feature/ConfigurableSourceRootsFeatureTest.php @@ -26,12 +26,12 @@ */ class ConfigurableSourceRootsFeatureTest extends TestCase { - public function test_default_config_value_is_empty_string() + public function testDefaultConfigValueIsEmptyString() { $this->assertSame('', config('hyde.source_root')); } - public function test_files_in_custom_source_root_can_be_discovered() + public function testFilesInCustomSourceRootCanBeDiscovered() { $this->setupCustomSourceRoot(); @@ -41,7 +41,7 @@ public function test_files_in_custom_source_root_can_be_discovered() File::deleteDirectory(Hyde::path('custom')); } - public function test_files_in_custom_source_root_can_be_compiled() + public function testFilesInCustomSourceRootCanBeCompiled() { $this->setupCustomSourceRoot(); @@ -53,7 +53,7 @@ public function test_files_in_custom_source_root_can_be_compiled() File::deleteDirectory(Hyde::path('_site')); } - public function test_hyde_page_path_method_supports_custom_source_roots() + public function testHydePagePathMethodSupportsCustomSourceRoots() { config(['hyde.source_root' => 'custom']); (new HydeServiceProvider(app()))->register(); diff --git a/packages/framework/tests/Feature/ConvertsArrayToFrontMatterTest.php b/packages/framework/tests/Feature/ConvertsArrayToFrontMatterTest.php index 346b493ef69..77e6810f107 100644 --- a/packages/framework/tests/Feature/ConvertsArrayToFrontMatterTest.php +++ b/packages/framework/tests/Feature/ConvertsArrayToFrontMatterTest.php @@ -12,7 +12,7 @@ */ class ConvertsArrayToFrontMatterTest extends TestCase { - public function test_action_converts_an_array_to_front_matter() + public function testActionConvertsAnArrayToFrontMatter() { $array = [ 'key' => 'value', @@ -39,7 +39,7 @@ public function test_action_converts_an_array_to_front_matter() $this->assertEquals(str_replace("\r", '', $expected), (new ConvertsArrayToFrontMatter)->execute($array)); } - public function test_action_returns_empty_string_if_array_is_empty() + public function testActionReturnsEmptyStringIfArrayIsEmpty() { $this->assertEquals('', (new ConvertsArrayToFrontMatter)->execute([])); } diff --git a/packages/framework/tests/Feature/DarkmodeFeatureTest.php b/packages/framework/tests/Feature/DarkmodeFeatureTest.php index e8a8d5baa16..63a7cd44268 100644 --- a/packages/framework/tests/Feature/DarkmodeFeatureTest.php +++ b/packages/framework/tests/Feature/DarkmodeFeatureTest.php @@ -26,7 +26,7 @@ protected function setUp(): void Hyde::boot(); } - public function test_has_darkmode() + public function testHasDarkmode() { Config::set('hyde.features', []); @@ -39,7 +39,7 @@ public function test_has_darkmode() $this->assertTrue(Features::hasDarkmode()); } - public function test_layout_has_toggle_button_and_script_when_enabled() + public function testLayoutHasToggleButtonAndScriptWhenEnabled() { Config::set('hyde.features', [ Features::markdownPages(), @@ -57,7 +57,7 @@ public function test_layout_has_toggle_button_and_script_when_enabled() $this->assertStringContainsString(''; $service = new MarkdownService($markdown); @@ -91,7 +91,7 @@ public function test_raw_html_tags_are_stripped_by_default() $this->assertEquals("

foo

<style>bar</style><script>hat</script>\n", $html); } - public function test_raw_html_tags_are_not_stripped_when_explicitly_enabled() + public function testRawHtmlTagsAreNotStrippedWhenExplicitlyEnabled() { config(['markdown.allow_html' => true]); $markdown = '

foo

'; @@ -100,21 +100,21 @@ public function test_raw_html_tags_are_not_stripped_when_explicitly_enabled() $this->assertEquals("

foo

\n", $html); } - public function test_has_features_array() + public function testHasFeaturesArray() { $service = $this->makeService(); $this->assertIsArray($service->features); } - public function test_the_features_array_is_empty_by_default() + public function testTheFeaturesArrayIsEmptyByDefault() { $service = $this->makeService(); $this->assertEmpty($service->features); } - public function test_features_can_be_added_to_the_array() + public function testFeaturesCanBeAddedToTheArray() { $service = $this->makeService(); @@ -122,7 +122,7 @@ public function test_features_can_be_added_to_the_array() $this->assertContains('test', $service->features); } - public function test_features_can_be_removed_from_the_array() + public function testFeaturesCanBeRemovedFromTheArray() { $service = $this->makeService(); @@ -131,7 +131,7 @@ public function test_features_can_be_removed_from_the_array() $this->assertNotContains('test', $service->features); } - public function test_method_chaining_can_be_used_to_programmatically_add_features_to_the_array() + public function testMethodChainingCanBeUsedToProgrammaticallyAddFeaturesToTheArray() { $service = $this->makeService(); @@ -140,7 +140,7 @@ public function test_method_chaining_can_be_used_to_programmatically_add_feature $this->assertContains('test2', $service->features); } - public function test_method_chaining_can_be_used_to_programmatically_remove_features_from_the_array() + public function testMethodChainingCanBeUsedToProgrammaticallyRemoveFeaturesFromTheArray() { $service = $this->makeService(); @@ -149,7 +149,7 @@ public function test_method_chaining_can_be_used_to_programmatically_remove_feat $this->assertContains('test2', $service->features); } - public function test_method_with_table_of_contents_method_chain_adds_the_table_of_contents_feature() + public function testMethodWithTableOfContentsMethodChainAddsTheTableOfContentsFeature() { $service = $this->makeService(); @@ -157,7 +157,7 @@ public function test_method_with_table_of_contents_method_chain_adds_the_table_o $this->assertContains('table-of-contents', $service->features); } - public function test_method_with_permalinks_method_chain_adds_the_permalinks_feature() + public function testMethodWithPermalinksMethodChainAddsThePermalinksFeature() { $service = $this->makeService(); @@ -165,7 +165,7 @@ public function test_method_with_permalinks_method_chain_adds_the_permalinks_fea $this->assertContains('permalinks', $service->features); } - public function test_has_feature_returns_true_if_the_feature_is_in_the_array() + public function testHasFeatureReturnsTrueIfTheFeatureIsInTheArray() { $service = $this->makeService(); @@ -173,14 +173,14 @@ public function test_has_feature_returns_true_if_the_feature_is_in_the_array() $this->assertTrue($service->hasFeature('test')); } - public function test_has_feature_returns_false_if_the_feature_is_not_in_the_array() + public function testHasFeatureReturnsFalseIfTheFeatureIsNotInTheArray() { $service = $this->makeService(); $this->assertFalse($service->hasFeature('test')); } - public function test_method_can_enable_permalinks_returns_true_if_the_permalinks_feature_is_in_the_array() + public function testMethodCanEnablePermalinksReturnsTrueIfThePermalinksFeatureIsInTheArray() { $service = $this->makeService(); @@ -188,7 +188,7 @@ public function test_method_can_enable_permalinks_returns_true_if_the_permalinks $this->assertTrue($service->canEnablePermalinks()); } - public function test_method_can_enable_permalinks_is_automatically_for_documentation_pages() + public function testMethodCanEnablePermalinksIsAutomaticallyForDocumentationPages() { $service = new MarkdownServiceTestClass(pageClass: DocumentationPage::class); @@ -197,14 +197,14 @@ public function test_method_can_enable_permalinks_is_automatically_for_documenta $this->assertTrue($service->canEnablePermalinks()); } - public function test_method_can_enable_permalinks_returns_false_if_the_permalinks_feature_is_not_in_the_array() + public function testMethodCanEnablePermalinksReturnsFalseIfThePermalinksFeatureIsNotInTheArray() { $service = $this->makeService(); $this->assertFalse($service->canEnablePermalinks()); } - public function test_method_can_enable_torchlight_returns_true_if_the_torchlight_feature_is_in_the_array() + public function testMethodCanEnableTorchlightReturnsTrueIfTheTorchlightFeatureIsInTheArray() { $service = $this->makeService(); @@ -212,14 +212,14 @@ public function test_method_can_enable_torchlight_returns_true_if_the_torchlight $this->assertTrue($service->canEnableTorchlight()); } - public function test_method_can_enable_torchlight_returns_false_if_the_torchlight_feature_is_not_in_the_array() + public function testMethodCanEnableTorchlightReturnsFalseIfTheTorchlightFeatureIsNotInTheArray() { $service = $this->makeService(); $this->assertFalse($service->canEnableTorchlight()); } - public function test_stripIndentation_method_with_unindented_markdown() + public function testStripIndentationMethodWithUnindentedMarkdown() { $service = $this->makeService(); @@ -227,7 +227,7 @@ public function test_stripIndentation_method_with_unindented_markdown() $this->assertSame($markdown, $service->normalizeIndentationLevel($markdown)); } - public function test_stripIndentation_method_with_indented_markdown() + public function testStripIndentationMethodWithIndentedMarkdown() { $service = $this->makeService(); @@ -241,7 +241,7 @@ public function test_stripIndentation_method_with_indented_markdown() $this->assertSame("foo\nbar\nbaz", $service->normalizeIndentationLevel($markdown)); } - public function test_stripIndentation_method_with_tab_indented_markdown() + public function testStripIndentationMethodWithTabIndentedMarkdown() { $service = $this->makeService(); @@ -249,7 +249,7 @@ public function test_stripIndentation_method_with_tab_indented_markdown() $this->assertSame("foo\nbar\nbaz", $service->normalizeIndentationLevel($markdown)); } - public function test_stripIndentation_method_with_carriage_return_line_feed() + public function testStripIndentationMethodWithCarriageReturnLineFeed() { $service = $this->makeService(); @@ -257,7 +257,7 @@ public function test_stripIndentation_method_with_carriage_return_line_feed() $this->assertSame("foo\nbar\nbaz", $service->normalizeIndentationLevel($markdown)); } - public function test_stripIndentation_method_with_code_indentation() + public function testStripIndentationMethodWithCodeIndentation() { $service = $this->makeService(); @@ -265,7 +265,7 @@ public function test_stripIndentation_method_with_code_indentation() $this->assertSame("foo\nbar\n baz", $service->normalizeIndentationLevel($markdown)); } - public function test_stripIndentation_method_with_empty_newlines() + public function testStripIndentationMethodWithEmptyNewlines() { $service = $this->makeService(); @@ -276,7 +276,7 @@ public function test_stripIndentation_method_with_empty_newlines() $this->assertSame("foo\n \nbar\nbaz", $service->normalizeIndentationLevel($markdown)); } - public function test_stripIndentation_method_with_trailing_newline() + public function testStripIndentationMethodWithTrailingNewline() { $service = $this->makeService(); diff --git a/packages/framework/tests/Feature/MetadataHelperTest.php b/packages/framework/tests/Feature/MetadataHelperTest.php index 462bfad38c0..c7ac9c70fd6 100644 --- a/packages/framework/tests/Feature/MetadataHelperTest.php +++ b/packages/framework/tests/Feature/MetadataHelperTest.php @@ -21,7 +21,7 @@ protected function setUp(): void config(['hyde.url' => null]); } - public function test_name_method_returns_a_valid_html_meta_string() + public function testNameMethodReturnsAValidHtmlMetaString() { $this->assertEquals( '', @@ -29,7 +29,7 @@ public function test_name_method_returns_a_valid_html_meta_string() ); } - public function test_property_method_returns_a_valid_html_meta_string() + public function testPropertyMethodReturnsAValidHtmlMetaString() { $this->assertEquals( '', @@ -37,7 +37,7 @@ public function test_property_method_returns_a_valid_html_meta_string() ); } - public function test_property_method_accepts_property_with_og_prefix() + public function testPropertyMethodAcceptsPropertyWithOgPrefix() { $this->assertEquals( '', @@ -45,7 +45,7 @@ public function test_property_method_accepts_property_with_og_prefix() ); } - public function test_property_method_accepts_property_without_og_prefix() + public function testPropertyMethodAcceptsPropertyWithoutOgPrefix() { $this->assertEquals( '', @@ -53,7 +53,7 @@ public function test_property_method_accepts_property_without_og_prefix() ); } - public function test_link_method_returns_a_valid_html_link_string() + public function testLinkMethodReturnsAValidHtmlLinkString() { $this->assertEquals( '', @@ -61,7 +61,7 @@ public function test_link_method_returns_a_valid_html_link_string() ); } - public function test_link_method_returns_a_valid_html_link_string_with_attributes() + public function testLinkMethodReturnsAValidHtmlLinkStringWithAttributes() { $this->assertEquals( '', @@ -69,7 +69,7 @@ public function test_link_method_returns_a_valid_html_link_string_with_attribute ); } - public function test_link_method_returns_a_valid_html_link_string_with_multiple_attributes() + public function testLinkMethodReturnsAValidHtmlLinkStringWithMultipleAttributes() { $this->assertEquals( '', @@ -77,12 +77,12 @@ public function test_link_method_returns_a_valid_html_link_string_with_multiple_ ); } - public function test_get_method_returns_global_metadata_bag() + public function testGetMethodReturnsGlobalMetadataBag() { $this->assertEquals(Meta::get(), GlobalMetadataBag::make()); } - public function test_render_method_renders_global_metadata_bag() + public function testRenderMethodRendersGlobalMetadataBag() { $this->assertSame(Meta::render(), GlobalMetadataBag::make()->render()); } diff --git a/packages/framework/tests/Feature/MetadataTest.php b/packages/framework/tests/Feature/MetadataTest.php index 1dc4d55771c..c7b3c7ce690 100644 --- a/packages/framework/tests/Feature/MetadataTest.php +++ b/packages/framework/tests/Feature/MetadataTest.php @@ -51,7 +51,7 @@ protected function assertPageDoesNotHaveMetadata(HydePage $page, string $metadat ); } - public function test_metadata_object_is_generated_automatically() + public function testMetadataObjectIsGeneratedAutomatically() { $page = new MarkdownPage(); @@ -60,7 +60,7 @@ public function test_metadata_object_is_generated_automatically() $this->assertEquals([], $page->metadata->get()); } - public function test_link_item_model() + public function testLinkItemModel() { $item = new LinkElement('rel', 'href'); $this->assertEquals('rel', $item->uniqueKey()); @@ -70,14 +70,14 @@ public function test_link_item_model() $this->assertEquals('', (string) $item); } - public function test_metadata_item_model() + public function testMetadataItemModel() { $item = new MetadataElement('name', 'content'); $this->assertEquals('name', $item->uniqueKey()); $this->assertEquals('', (string) $item); } - public function test_open_graph_item_model() + public function testOpenGraphItemModel() { $item = new OpenGraphElement('property', 'content'); $this->assertEquals('property', $item->uniqueKey()); @@ -87,7 +87,7 @@ public function test_open_graph_item_model() $this->assertEquals('', (string) $item); } - public function test_link_item_can_be_added() + public function testLinkItemCanBeAdded() { $page = new MarkdownPage(); $page->metadata->add(Meta::link('foo', 'bar')); @@ -97,7 +97,7 @@ public function test_link_item_can_be_added() ], $page->metadata->get()); } - public function test_metadata_item_can_be_added() + public function testMetadataItemCanBeAdded() { $page = new MarkdownPage(); $page->metadata->add(Meta::name('foo', 'bar')); @@ -107,7 +107,7 @@ public function test_metadata_item_can_be_added() ], $page->metadata->get()); } - public function test_open_graph_item_can_be_added() + public function testOpenGraphItemCanBeAdded() { $page = new MarkdownPage(); $page->metadata->add(Meta::property('foo', 'bar')); @@ -117,7 +117,7 @@ public function test_open_graph_item_can_be_added() ], $page->metadata->get()); } - public function test_generic_item_can_be_added() + public function testGenericItemCanBeAdded() { $page = new MarkdownPage(); $page->metadata->add('foo'); @@ -127,7 +127,7 @@ public function test_generic_item_can_be_added() ], $page->metadata->get()); } - public function test_multiple_items_can_be_accessed_with_get_method() + public function testMultipleItemsCanBeAccessedWithGetMethod() { $page = new MarkdownPage(); $page->metadata->add(Meta::link('foo', 'bar')); @@ -143,7 +143,7 @@ public function test_multiple_items_can_be_accessed_with_get_method() ], $page->metadata->get()); } - public function test_multiple_items_of_same_key_and_type_only_keeps_latest() + public function testMultipleItemsOfSameKeyAndTypeOnlyKeepsLatest() { $page = new MarkdownPage(); $page->metadata->add(Meta::link('foo', 'bar')); @@ -154,7 +154,7 @@ public function test_multiple_items_of_same_key_and_type_only_keeps_latest() ], $page->metadata->get()); } - public function test_render_returns_html_string_of_imploded_metadata_arrays() + public function testRenderReturnsHtmlStringOfImplodedMetadataArrays() { $page = new MarkdownPage(); $page->metadata->add(Meta::link('foo', 'bar')); @@ -171,7 +171,7 @@ public function test_render_returns_html_string_of_imploded_metadata_arrays() $page->metadata->render()); } - public function test_custom_metadata_overrides_config_defined_metadata() + public function testCustomMetadataOverridesConfigDefinedMetadata() { config(['hyde.meta' => [ Meta::name('foo', 'bar'), @@ -183,7 +183,7 @@ public function test_custom_metadata_overrides_config_defined_metadata() ], $page->metadata->get()); } - public function test_dynamic_metadata_overrides_config_defined_metadata() + public function testDynamicMetadataOverridesConfigDefinedMetadata() { config(['hyde.meta' => [ Meta::name('twitter:title', 'bar'), @@ -196,7 +196,7 @@ public function test_dynamic_metadata_overrides_config_defined_metadata() ], $page->metadata->get()); } - public function test_does_not_add_canonical_link_when_base_url_is_not_set() + public function testDoesNotAddCanonicalLinkWhenBaseUrlIsNotSet() { config(['hyde.url' => null]); $page = MarkdownPage::make('bar'); @@ -204,7 +204,7 @@ public function test_does_not_add_canonical_link_when_base_url_is_not_set() $this->assertStringNotContainsString('metadata->render()); } - public function test_does_not_add_canonical_link_when_identifier_is_not_set() + public function testDoesNotAddCanonicalLinkWhenIdentifierIsNotSet() { config(['hyde.url' => 'foo']); $page = MarkdownPage::make(); @@ -212,7 +212,7 @@ public function test_does_not_add_canonical_link_when_identifier_is_not_set() $this->assertStringNotContainsString('metadata->render()); } - public function test_adds_canonical_link_when_base_url_and_identifier_is_set() + public function testAddsCanonicalLinkWhenBaseUrlAndIdentifierIsSet() { config(['hyde.url' => 'foo']); $page = MarkdownPage::make('bar'); @@ -220,7 +220,7 @@ public function test_adds_canonical_link_when_base_url_and_identifier_is_set() $this->assertStringContainsString('', $page->metadata->render()); } - public function test_canonical_link_uses_clean_url_setting() + public function testCanonicalLinkUsesCleanUrlSetting() { config(['hyde.url' => 'foo']); config(['hyde.pretty_urls' => true]); @@ -229,7 +229,7 @@ public function test_canonical_link_uses_clean_url_setting() $this->assertStringContainsString('', $page->metadata->render()); } - public function test_can_override_canonical_link_with_front_matter() + public function testCanOverrideCanonicalLinkWithFrontMatter() { config(['hyde.url' => 'foo']); $page = MarkdownPage::make('bar', [ @@ -238,7 +238,7 @@ public function test_can_override_canonical_link_with_front_matter() $this->assertStringContainsString('', $page->metadata->render()); } - public function test_adds_twitter_and_open_graph_title_when_title_is_set() + public function testAddsTwitterAndOpenGraphTitleWhenTitleIsSet() { $page = MarkdownPage::make(matter: ['title' => 'Foo Bar']); @@ -249,7 +249,7 @@ public function test_adds_twitter_and_open_graph_title_when_title_is_set() ); } - public function test_does_not_add_twitter_and_open_graph_title_when_no_title_is_set() + public function testDoesNotAddTwitterAndOpenGraphTitleWhenNoTitleIsSet() { $page = MarkdownPage::make(matter: ['title' => null]); @@ -258,109 +258,109 @@ public function test_does_not_add_twitter_and_open_graph_title_when_no_title_is_ ); } - public function test_adds_description_when_description_is_set_in_post() + public function testAddsDescriptionWhenDescriptionIsSetInPost() { $page = MarkdownPost::make(matter: ['description' => 'My Description']); $this->assertPageHasMetadata($page, ''); } - public function test_does_not_add_description_when_description_is_not_set_in_post() + public function testDoesNotAddDescriptionWhenDescriptionIsNotSetInPost() { $page = new MarkdownPost(); $this->assertPageDoesNotHaveMetadata($page, ''); } - public function test_adds_author_when_author_is_set_in_post() + public function testAddsAuthorWhenAuthorIsSetInPost() { $page = MarkdownPost::make(matter: ['author' => 'My Author']); $this->assertPageHasMetadata($page, ''); } - public function test_does_not_add_author_when_author_is_not_set_in_post() + public function testDoesNotAddAuthorWhenAuthorIsNotSetInPost() { $page = new MarkdownPost(); $this->assertPageDoesNotHaveMetadata($page, ''); } - public function test_adds_keywords_when_category_is_set_in_post() + public function testAddsKeywordsWhenCategoryIsSetInPost() { $page = MarkdownPost::make(matter: ['category' => 'My Category']); $this->assertPageHasMetadata($page, ''); } - public function test_does_not_add_keywords_when_category_is_not_set_in_post() + public function testDoesNotAddKeywordsWhenCategoryIsNotSetInPost() { $page = new MarkdownPost(); $this->assertPageDoesNotHaveMetadata($page, ''); } - public function test_adds_url_property_when_canonical_url_is_set_in_post() + public function testAddsUrlPropertyWhenCanonicalUrlIsSetInPost() { $page = MarkdownPost::make(matter: ['canonicalUrl' => 'example.html']); $this->assertPageHasMetadata($page, ''); } - public function test_does_not_add_url_property_when_canonical_url_is_not_set_in_post() + public function testDoesNotAddUrlPropertyWhenCanonicalUrlIsNotSetInPost() { $page = new MarkdownPost(); $this->assertPageDoesNotHaveMetadata($page, ''); } - public function test_does_not_add_url_property_when_canonical_url_is_null() + public function testDoesNotAddUrlPropertyWhenCanonicalUrlIsNull() { $page = MarkdownPost::make(matter: ['canonicalUrl' => null]); $this->assertPageDoesNotHaveMetadata($page, ''); } - public function test_adds_title_property_when_title_is_set_in_post() + public function testAddsTitlePropertyWhenTitleIsSetInPost() { $page = MarkdownPost::make(matter: ['title' => 'My Title']); $this->assertPageHasMetadata($page, ''); } - public function test_does_not_add_title_property_when_title_is_not_set_in_post() + public function testDoesNotAddTitlePropertyWhenTitleIsNotSetInPost() { $page = new MarkdownPost(); $this->assertPageDoesNotHaveMetadata($page, ' '2022-01-01']); $this->assertPageHasMetadata($page, ''); } - public function test_does_not_add_published_time_property_when_date_is_not_set_in_post() + public function testDoesNotAddPublishedTimePropertyWhenDateIsNotSetInPost() { $page = new MarkdownPost(); $this->assertPageDoesNotHaveMetadata($page, ''); } - public function test_adds_image_property_when_image_is_set_in_post() + public function testAddsImagePropertyWhenImageIsSetInPost() { $page = MarkdownPost::make(matter: ['image' => 'image.jpg']); $this->assertPageHasMetadata($page, ''); } - public function test_does_not_add_image_property_when_image_is_not_set_in_post() + public function testDoesNotAddImagePropertyWhenImageIsNotSetInPost() { $page = new MarkdownPost(); $this->assertPageDoesNotHaveMetadata($page, ''); } - public function test_adds_type_property_automatically() + public function testAddsTypePropertyAutomatically() { $page = MarkdownPost::make(); $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_returns_base_array_when_initialized_with_empty_front_matter() + public function testDynamicPostMetaPropertiesReturnsBaseArrayWhenInitializedWithEmptyFrontMatter() { $page = MarkdownPost::make(); $this->assertEquals('', $page->metadata->render()); } - public function test_dynamic_post_meta_properties_contains_image_metadata_when_featured_image_set_to_string() + public function testDynamicPostMetaPropertiesContainsImageMetadataWhenFeaturedImageSetToString() { $page = MarkdownPost::make(matter: [ 'image' => 'foo.jpg', @@ -369,7 +369,7 @@ public function test_dynamic_post_meta_properties_contains_image_metadata_when_f $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_contains_image_link_that_is_always_relative() + public function testDynamicPostMetaPropertiesContainsImageLinkThatIsAlwaysRelative() { $page = MarkdownPost::make(matter: [ 'image' => 'foo.jpg', @@ -378,7 +378,7 @@ public function test_dynamic_post_meta_properties_contains_image_link_that_is_al $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_contains_image_link_that_is_always_relative_for_nested_posts() + public function testDynamicPostMetaPropertiesContainsImageLinkThatIsAlwaysRelativeForNestedPosts() { $page = MarkdownPost::make('foo/bar', matter: [ 'image' => 'foo.jpg', @@ -387,7 +387,7 @@ public function test_dynamic_post_meta_properties_contains_image_link_that_is_al $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_contains_image_link_that_is_always_relative_for_nested_output_directories() + public function testDynamicPostMetaPropertiesContainsImageLinkThatIsAlwaysRelativeForNestedOutputDirectories() { MarkdownPost::setOutputDirectory('_posts/foo'); $page = MarkdownPost::make(matter: [ @@ -397,7 +397,7 @@ public function test_dynamic_post_meta_properties_contains_image_link_that_is_al $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_contains_image_link_that_is_always_relative_for_nested_posts_and_nested_output_directories() + public function testDynamicPostMetaPropertiesContainsImageLinkThatIsAlwaysRelativeForNestedPostsAndNestedOutputDirectories() { MarkdownPost::setOutputDirectory('_posts/foo'); $page = MarkdownPost::make('bar/baz', matter: [ @@ -407,7 +407,7 @@ public function test_dynamic_post_meta_properties_contains_image_link_that_is_al $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_contains_image_link_that_uses_the_configured_media_directory() + public function testDynamicPostMetaPropertiesContainsImageLinkThatUsesTheConfiguredMediaDirectory() { Hyde::setMediaDirectory('assets'); $page = MarkdownPost::make(matter: [ @@ -417,7 +417,7 @@ public function test_dynamic_post_meta_properties_contains_image_link_that_uses_ $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_contains_image_metadata_when_featured_image_set_to_array_with_path() + public function testDynamicPostMetaPropertiesContainsImageMetadataWhenFeaturedImageSetToArrayWithPath() { $page = MarkdownPost::make(matter: [ 'image' => [ @@ -428,7 +428,7 @@ public function test_dynamic_post_meta_properties_contains_image_metadata_when_f $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_meta_properties_contains_image_metadata_when_featured_image_set_to_array_with_url() + public function testDynamicPostMetaPropertiesContainsImageMetadataWhenFeaturedImageSetToArrayWithUrl() { $page = MarkdownPost::make(matter: [ 'image' => [ @@ -439,7 +439,7 @@ public function test_dynamic_post_meta_properties_contains_image_metadata_when_f $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_author_returns_author_name_when_author_set_to_array_using_username() + public function testDynamicPostAuthorReturnsAuthorNameWhenAuthorSetToArrayUsingUsername() { $page = MarkdownPost::make(matter: [ 'author' => [ @@ -449,7 +449,7 @@ public function test_dynamic_post_author_returns_author_name_when_author_set_to_ $this->assertPageHasMetadata($page, ''); } - public function test_dynamic_post_author_returns_author_name_when_author_set_to_array_using_name() + public function testDynamicPostAuthorReturnsAuthorNameWhenAuthorSetToArrayUsingName() { $page = MarkdownPost::make(matter: [ 'author' => [ @@ -460,7 +460,7 @@ public function test_dynamic_post_author_returns_author_name_when_author_set_to_ $this->assertPageHasMetadata($page, ''); } - public function test_no_author_is_set_when_author_set_to_array_without_name_or_username() + public function testNoAuthorIsSetWhenAuthorSetToArrayWithoutNameOrUsername() { $page = MarkdownPost::make(matter: [ 'author' => [], diff --git a/packages/framework/tests/Feature/MetadataViewTest.php b/packages/framework/tests/Feature/MetadataViewTest.php index cd6366256c1..40d79186163 100644 --- a/packages/framework/tests/Feature/MetadataViewTest.php +++ b/packages/framework/tests/Feature/MetadataViewTest.php @@ -85,7 +85,7 @@ protected function getDefaultTags(): array ]; } - public function test_metadata_tags_in_empty_blade_page() + public function testMetadataTagsInEmptyBladePage() { $this->file('_pages/test.blade.php', '@extends(\'hyde::layouts.app\')'); $this->build('_pages/test.blade.php'); @@ -101,7 +101,7 @@ public function test_metadata_tags_in_empty_blade_page() $this->assertAllTagsWereCovered('test', $assertions); } - public function test_metadata_tags_in_empty_markdown_page() + public function testMetadataTagsInEmptyMarkdownPage() { $this->markdown('_pages/test.md'); $this->build('_pages/test.md'); @@ -117,7 +117,7 @@ public function test_metadata_tags_in_empty_markdown_page() $this->assertAllTagsWereCovered('test', $assertions); } - public function test_metadata_tags_in_empty_documentation_page() + public function testMetadataTagsInEmptyDocumentationPage() { $this->markdown('_docs/test.md'); $this->build('_docs/test.md'); @@ -133,7 +133,7 @@ public function test_metadata_tags_in_empty_documentation_page() $this->assertAllTagsWereCovered('docs/test', $assertions); } - public function test_metadata_tags_in_empty_markdown_post() + public function testMetadataTagsInEmptyMarkdownPost() { $this->markdown('_posts/test.md'); $this->build('_posts/test.md'); @@ -155,7 +155,7 @@ public function test_metadata_tags_in_empty_markdown_post() $this->assertAllTagsWereCovered('posts/test', $assertions); } - public function test_metadata_tags_in_markdown_post_with_flat_front_matter() + public function testMetadataTagsInMarkdownPostWithFlatFrontMatter() { // Run the test above, but with all front matter properties (without array notation) $this->file('_posts/test.md', <<<'MARKDOWN' diff --git a/packages/framework/tests/Feature/NavigationDataTest.php b/packages/framework/tests/Feature/NavigationDataTest.php index d2c3ccc773f..510040dbc96 100644 --- a/packages/framework/tests/Feature/NavigationDataTest.php +++ b/packages/framework/tests/Feature/NavigationDataTest.php @@ -29,7 +29,7 @@ public function testClassMatchesSchema() ); } - public function test__construct() + public function testConstruct() { $navigationData = new NavigationData('label', 1, true, 'group'); diff --git a/packages/framework/tests/Feature/NavigationMenuTest.php b/packages/framework/tests/Feature/NavigationMenuTest.php index bd2fcebf695..a6c2a18501b 100644 --- a/packages/framework/tests/Feature/NavigationMenuTest.php +++ b/packages/framework/tests/Feature/NavigationMenuTest.php @@ -26,22 +26,22 @@ */ class NavigationMenuTest extends TestCase { - public function test_constructor() + public function testConstructor() { $this->assertInstanceOf(NavigationMenu::class, NavigationMenu::create()); } - public function test_generate_method_creates_collection_of_nav_items() + public function testGenerateMethodCreatesCollectionOfNavItems() { $this->assertInstanceOf(Collection::class, NavigationMenu::create()->items); } - public function test_get_items_returns_items() + public function testGetItemsReturnsItems() { $this->assertEquals(NavigationMenu::create()->items, NavigationMenu::create()->getItems()); } - public function test_items_are_sorted_by_priority() + public function testItemsAreSortedByPriority() { Routes::addRoute(new Route(new MarkdownPage('foo', ['navigation.priority' => 1]))); Routes::addRoute(new Route(new MarkdownPage('bar', ['navigation.priority' => 2]))); @@ -50,7 +50,7 @@ public function test_items_are_sorted_by_priority() $this->assertSame(['Home', 'Foo', 'Bar', 'Baz'], NavigationMenu::create()->items->pluck('label')->toArray()); } - public function test_items_with_hidden_property_set_to_true_are_not_added() + public function testItemsWithHiddenPropertySetToTrueAreNotAdded() { Routes::addRoute(new Route(new MarkdownPage('foo', ['navigation.hidden' => true]))); Routes::addRoute(new Route(new MarkdownPage('bar', ['navigation.hidden' => false]))); @@ -58,7 +58,7 @@ public function test_items_with_hidden_property_set_to_true_are_not_added() $this->assertSame(['Home', 'Bar'], NavigationMenu::create()->items->pluck('label')->toArray()); } - public function test_created_collection_is_sorted_by_navigation_menu_priority() + public function testCreatedCollectionIsSortedByNavigationMenuPriority() { $this->file('_pages/foo.md'); $this->file('_docs/index.md'); @@ -75,7 +75,7 @@ public function test_created_collection_is_sorted_by_navigation_menu_priority() $this->assertEquals($expected, $menu->items); } - public function test_is_sorted_automatically_when_using_navigation_menu_create() + public function testIsSortedAutomaticallyWhenUsingNavigationMenuCreate() { $this->file('_pages/foo.md'); @@ -90,12 +90,12 @@ public function test_is_sorted_automatically_when_using_navigation_menu_create() $this->assertEquals($expected, $menu->items); } - public function test_collection_only_contains_nav_items() + public function testCollectionOnlyContainsNavItems() { $this->assertContainsOnlyInstancesOf(NavItem::class, NavigationMenu::create()->items); } - public function test_external_link_can_be_added_in_config() + public function testExternalLinkCanBeAddedInConfig() { config(['hyde.navigation.custom' => [NavItem::forLink('https://example.com', 'foo')]]); @@ -110,7 +110,7 @@ public function test_external_link_can_be_added_in_config() $this->assertEquals($expected, $menu->items); } - public function test_path_link_can_be_added_in_config() + public function testPathLinkCanBeAddedInConfig() { config(['hyde.navigation.custom' => [NavItem::forLink('foo', 'foo')]]); @@ -125,7 +125,7 @@ public function test_path_link_can_be_added_in_config() $this->assertEquals($expected, $menu->items); } - public function test_duplicates_are_removed_when_adding_in_config() + public function testDuplicatesAreRemovedWhenAddingInConfig() { config(['hyde.navigation.custom' => [ NavItem::forLink('foo', 'foo'), @@ -143,7 +143,7 @@ public function test_duplicates_are_removed_when_adding_in_config() $this->assertEquals($expected, $menu->items); } - public function test_duplicates_are_removed_when_adding_in_config_regardless_of_destination() + public function testDuplicatesAreRemovedWhenAddingInConfigRegardlessOfDestination() { config(['hyde.navigation.custom' => [ NavItem::forLink('foo', 'foo'), @@ -161,7 +161,7 @@ public function test_duplicates_are_removed_when_adding_in_config_regardless_of_ $this->assertEquals($expected, $menu->items); } - public function test_config_items_take_precedence_over_generated_items() + public function testConfigItemsTakePrecedenceOverGeneratedItems() { $this->file('_pages/foo.md'); @@ -178,7 +178,7 @@ public function test_config_items_take_precedence_over_generated_items() $this->assertEquals($expected, $menu->items); } - public function test_documentation_pages_that_are_not_index_are_not_added_to_the_menu() + public function testDocumentationPagesThatAreNotIndexAreNotAddedToTheMenu() { $this->file('_docs/foo.md'); $this->file('_docs/index.md'); @@ -194,7 +194,7 @@ public function test_documentation_pages_that_are_not_index_are_not_added_to_the $this->assertEquals($expected, $menu->items); } - public function test_pages_in_subdirectories_are_not_added_to_the_navigation_menu() + public function testPagesInSubdirectoriesAreNotAddedToTheNavigationMenu() { $this->directory('_pages/foo'); $this->file('_pages/foo/bar.md'); @@ -206,7 +206,7 @@ public function test_pages_in_subdirectories_are_not_added_to_the_navigation_men $this->assertEquals($expected, $menu->items); } - public function test_pages_in_subdirectories_can_be_added_to_the_navigation_menu_with_config_flat_setting() + public function testPagesInSubdirectoriesCanBeAddedToTheNavigationMenuWithConfigFlatSetting() { config(['hyde.navigation.subdirectories' => 'flat']); $this->directory('_pages/foo'); @@ -222,7 +222,7 @@ public function test_pages_in_subdirectories_can_be_added_to_the_navigation_menu $this->assertEquals($expected, $menu->items); } - public function test_pages_in_subdirectories_are_not_added_to_the_navigation_menu_with_config_dropdown_setting() + public function testPagesInSubdirectoriesAreNotAddedToTheNavigationMenuWithConfigDropdownSetting() { config(['hyde.navigation.subdirectories' => 'dropdown']); $this->directory('_pages/foo'); @@ -240,14 +240,14 @@ public function test_pages_in_subdirectories_are_not_added_to_the_navigation_men $this->assertEquals($expected, $menu->items); } - public function test_has_dropdowns_returns_false_when_there_are_no_dropdowns() + public function testHasDropdownsReturnsFalseWhenThereAreNoDropdowns() { config(['hyde.navigation.subdirectories' => 'dropdown']); $menu = NavigationMenu::create(); $this->assertFalse($menu->hasDropdowns()); } - public function test_has_dropdowns_returns_true_when_there_are_dropdowns() + public function testHasDropdownsReturnsTrueWhenThereAreDropdowns() { config(['hyde.navigation.subdirectories' => 'dropdown']); Routes::addRoute((new MarkdownPage('foo/bar'))->getRoute()); @@ -255,13 +255,13 @@ public function test_has_dropdowns_returns_true_when_there_are_dropdowns() $this->assertTrue($menu->hasDropdowns()); } - public function test_has_dropdowns_always_returns_false_when_dropdowns_are_disabled() + public function testHasDropdownsAlwaysReturnsFalseWhenDropdownsAreDisabled() { Routes::addRoute((new MarkdownPage('foo/bar'))->getRoute()); $this->assertFalse(NavigationMenu::create()->hasDropdowns()); } - public function test_get_dropdowns_returns_empty_array_there_are_no_dropdowns() + public function testGetDropdownsReturnsEmptyArrayThereAreNoDropdowns() { config(['hyde.navigation.subdirectories' => 'dropdown']); $menu = NavigationMenu::create(); @@ -269,7 +269,7 @@ public function test_get_dropdowns_returns_empty_array_there_are_no_dropdowns() $this->assertSame([], $menu->getDropdowns()); } - public function test_get_dropdowns_returns_correct_array_when_there_are_dropdowns() + public function testGetDropdownsReturnsCorrectArrayWhenThereAreDropdowns() { config(['hyde.navigation.subdirectories' => 'dropdown']); Routes::addRoute((new MarkdownPage('foo/bar'))->getRoute()); @@ -282,7 +282,7 @@ public function test_get_dropdowns_returns_correct_array_when_there_are_dropdown ]), ], $menu->getDropdowns()); } - public function test_get_dropdowns_with_multiple_items() + public function testGetDropdownsWithMultipleItems() { config(['hyde.navigation.subdirectories' => 'dropdown']); @@ -300,7 +300,7 @@ public function test_get_dropdowns_with_multiple_items() ], $menu->getDropdowns()); } - public function test_get_dropdowns_with_multiple_dropdowns() + public function testGetDropdownsWithMultipleDropdowns() { config(['hyde.navigation.subdirectories' => 'dropdown']); @@ -323,7 +323,7 @@ public function test_get_dropdowns_with_multiple_dropdowns() ], $menu->getDropdowns()); } - public function test_get_dropdowns_throws_exception_when_disabled() + public function testGetDropdownsThrowsExceptionWhenDisabled() { $this->expectException(BadMethodCallException::class); $this->expectExceptionMessage('Dropdowns are not enabled. Enable it by setting `hyde.navigation.subdirectories` to `dropdown`.'); @@ -332,7 +332,7 @@ public function test_get_dropdowns_throws_exception_when_disabled() $menu->getDropdowns(); } - public function test_documentation_pages_do_not_get_added_to_dropdowns() + public function testDocumentationPagesDoNotGetAddedToDropdowns() { config(['hyde.navigation.subdirectories' => 'dropdown']); @@ -344,7 +344,7 @@ public function test_documentation_pages_do_not_get_added_to_dropdowns() $this->assertCount(0, $menu->getDropdowns()); } - public function test_blog_posts_do_not_get_added_to_dropdowns() + public function testBlogPostsDoNotGetAddedToDropdowns() { config(['hyde.navigation.subdirectories' => 'dropdown']); @@ -356,7 +356,7 @@ public function test_blog_posts_do_not_get_added_to_dropdowns() $this->assertCount(0, $menu->getDropdowns()); } - public function test_pages_in_dropdowns_do_not_get_added_to_the_main_navigation() + public function testPagesInDropdownsDoNotGetAddedToTheMainNavigation() { config(['hyde.navigation.subdirectories' => 'dropdown']); @@ -374,7 +374,7 @@ public function test_pages_in_dropdowns_do_not_get_added_to_the_main_navigation( ], $menu->items->all()); } - public function test_dropdown_menu_items_are_sorted_by_priority() + public function testDropdownMenuItemsAreSortedByPriority() { config(['hyde.navigation.subdirectories' => 'dropdown']); diff --git a/packages/framework/tests/Feature/PageCollectionTest.php b/packages/framework/tests/Feature/PageCollectionTest.php index f055ae3bf24..423844ab1c1 100644 --- a/packages/framework/tests/Feature/PageCollectionTest.php +++ b/packages/framework/tests/Feature/PageCollectionTest.php @@ -24,7 +24,7 @@ */ class PageCollectionTest extends TestCase { - public function test_boot_method_creates_new_page_collection_and_discovers_pages_automatically() + public function testBootMethodCreatesNewPageCollectionAndDiscoversPagesAutomatically() { $collection = PageCollection::init(Hyde::getInstance())->boot(); $this->assertInstanceOf(PageCollection::class, $collection); @@ -36,7 +36,7 @@ public function test_boot_method_creates_new_page_collection_and_discovers_pages ], $collection->all()); } - public function test_blade_pages_are_discovered() + public function testBladePagesAreDiscovered() { $this->file('_pages/foo.blade.php'); $collection = PageCollection::init(Hyde::getInstance())->boot(); @@ -45,7 +45,7 @@ public function test_blade_pages_are_discovered() $this->assertEquals(new BladePage('foo'), $collection->get('_pages/foo.blade.php')); } - public function test_markdown_pages_are_discovered() + public function testMarkdownPagesAreDiscovered() { $this->file('_pages/foo.md'); $collection = PageCollection::init(Hyde::getInstance())->boot(); @@ -54,7 +54,7 @@ public function test_markdown_pages_are_discovered() $this->assertEquals(new MarkdownPage('foo'), $collection->get('_pages/foo.md')); } - public function test_markdown_posts_are_discovered() + public function testMarkdownPostsAreDiscovered() { $this->file('_posts/foo.md'); $collection = PageCollection::init(Hyde::getInstance())->boot(); @@ -63,7 +63,7 @@ public function test_markdown_posts_are_discovered() $this->assertEquals(new MarkdownPost('foo'), $collection->get('_posts/foo.md')); } - public function test_documentation_pages_are_discovered() + public function testDocumentationPagesAreDiscovered() { $this->file('_docs/foo.md'); $collection = PageCollection::init(Hyde::getInstance())->boot(); @@ -71,13 +71,13 @@ public function test_documentation_pages_are_discovered() $this->assertEquals(new DocumentationPage('foo'), $collection->get('_docs/foo.md')); } - public function test_get_page_returns_parsed_page_object_for_given_source_path() + public function testGetPageReturnsParsedPageObjectForGivenSourcePath() { $this->file('_pages/foo.blade.php'); $this->assertEquals(new BladePage('foo'), Pages::getPage('_pages/foo.blade.php')); } - public function test_get_pages_returns_collection_of_pages_of_given_class() + public function testGetPagesReturnsCollectionOfPagesOfGivenClass() { $this->withoutDefaultPages(); $this->withoutDocumentationSearch(); @@ -107,7 +107,7 @@ public function test_get_pages_returns_collection_of_pages_of_given_class() $this->restoreDocumentationSearch(); } - public function test_get_pages_returns_all_pages_when_not_supplied_with_class_string() + public function testGetPagesReturnsAllPagesWhenNotSuppliedWithClassString() { $this->withoutDefaultPages(); $this->withoutDocumentationSearch(); @@ -131,7 +131,7 @@ public function test_get_pages_returns_all_pages_when_not_supplied_with_class_st $this->restoreDocumentationSearch(); } - public function test_get_pages_returns_empty_collection_when_no_pages_are_discovered() + public function testGetPagesReturnsEmptyCollectionWhenNoPagesAreDiscovered() { $this->withoutDefaultPages(); $this->withoutDocumentationSearch(); @@ -140,7 +140,7 @@ public function test_get_pages_returns_empty_collection_when_no_pages_are_discov $this->restoreDocumentationSearch(); } - public function test_pages_are_not_discovered_for_disabled_features() + public function testPagesAreNotDiscoveredForDisabledFeatures() { config(['hyde.features' => []]); @@ -159,7 +159,7 @@ public function test_pages_are_not_discovered_for_disabled_features() unlink('_docs/doc.md'); } - public function test_pages_with_custom_source_directories_are_discovered_properly() + public function testPagesWithCustomSourceDirectoriesAreDiscoveredProperly() { $this->withoutDocumentationSearch(); @@ -189,7 +189,7 @@ public function test_pages_with_custom_source_directories_are_discovered_properl $this->restoreDocumentationSearch(); } - public function test_get_file_throws_exception_when_file_is_not_found() + public function testGetFileThrowsExceptionWhenFileIsNotFound() { $this->expectException(FileNotFoundException::class); $this->expectExceptionMessage('File [_pages/foo.blade.php] not found'); diff --git a/packages/framework/tests/Feature/PageModelConstructorsTest.php b/packages/framework/tests/Feature/PageModelConstructorsTest.php index a49f6cac11e..c98d2988dae 100644 --- a/packages/framework/tests/Feature/PageModelConstructorsTest.php +++ b/packages/framework/tests/Feature/PageModelConstructorsTest.php @@ -21,14 +21,14 @@ */ class PageModelConstructorsTest extends TestCase { - public function test_dynamic_data_constructor_can_find_title_from_front_matter() + public function testDynamicDataConstructorCanFindTitleFromFrontMatter() { $this->markdown('_pages/foo.md', '# Foo Bar', ['title' => 'My Title']); $page = MarkdownPage::parse('foo'); $this->assertEquals('My Title', $page->title); } - public function test_dynamic_data_constructor_can_find_title_from_h1_tag() + public function testDynamicDataConstructorCanFindTitleFromH1Tag() { $this->markdown('_pages/foo.md', '# Foo Bar'); $page = MarkdownPage::parse('foo'); @@ -36,7 +36,7 @@ public function test_dynamic_data_constructor_can_find_title_from_h1_tag() $this->assertEquals('Foo Bar', $page->title); } - public function test_dynamic_data_constructor_can_find_title_from_slug() + public function testDynamicDataConstructorCanFindTitleFromSlug() { $this->markdown('_pages/foo-bar.md'); $page = MarkdownPage::parse('foo-bar'); @@ -44,7 +44,7 @@ public function test_dynamic_data_constructor_can_find_title_from_slug() $this->assertEquals('Foo Bar', $page->title); } - public function test_documentation_page_parser_can_get_group_from_front_matter() + public function testDocumentationPageParserCanGetGroupFromFrontMatter() { $this->markdown('_docs/foo.md', '# Foo Bar', ['navigation.group' => 'foo']); @@ -52,7 +52,7 @@ public function test_documentation_page_parser_can_get_group_from_front_matter() $this->assertEquals('foo', $page->navigationMenuGroup()); } - public function test_documentation_page_parser_can_get_group_automatically_from_nested_page() + public function testDocumentationPageParserCanGetGroupAutomaticallyFromNestedPage() { mkdir(Hyde::path('_docs/foo')); touch(Hyde::path('_docs/foo/bar.md')); diff --git a/packages/framework/tests/Feature/PaginatorTest.php b/packages/framework/tests/Feature/PaginatorTest.php index ddb04fee015..cf4c10073bb 100644 --- a/packages/framework/tests/Feature/PaginatorTest.php +++ b/packages/framework/tests/Feature/PaginatorTest.php @@ -15,7 +15,7 @@ */ class PaginatorTest extends TestCase { - public function test_it_can_be_instantiated(): void + public function testItCanBeInstantiated(): void { $this->assertInstanceOf(Paginator::class, new Paginator()); } diff --git a/packages/framework/tests/Feature/PharSupportTest.php b/packages/framework/tests/Feature/PharSupportTest.php index f6e46f32241..8047239f88a 100644 --- a/packages/framework/tests/Feature/PharSupportTest.php +++ b/packages/framework/tests/Feature/PharSupportTest.php @@ -48,7 +48,7 @@ public function testMockHasVendorDirectory() $this->assertFalse(PharSupport::hasVendorDirectory()); } - public function test_vendor_path_can_run_in_phar() + public function testVendorPathCanRunInPhar() { PharSupport::mock('running', true); PharSupport::mock('hasVendorDirectory', false); @@ -56,7 +56,7 @@ public function test_vendor_path_can_run_in_phar() $this->assertEquals($this->replaceSlashes(Hyde::path("{$this->getBaseVendorPath()}/framework")), Hyde::vendorPath()); } - public function test_vendor_path_can_run_in_phar_with_path_argument() + public function testVendorPathCanRunInPharWithPathArgument() { PharSupport::mock('running', true); PharSupport::mock('hasVendorDirectory', false); diff --git a/packages/framework/tests/Feature/ReadingTimeTest.php b/packages/framework/tests/Feature/ReadingTimeTest.php index 58a9075a531..93dbe654526 100644 --- a/packages/framework/tests/Feature/ReadingTimeTest.php +++ b/packages/framework/tests/Feature/ReadingTimeTest.php @@ -20,17 +20,17 @@ public static function setUpBeforeClass(): void self::setupKernel(); } - public function test___construct() + public function testConstruct() { $this->assertInstanceOf(ReadingTime::class, new ReadingTime('Hello world')); } - public function test__toString() + public function testToString() { $this->assertSame('1min, 0sec', (string) new ReadingTime('Hello world')); } - public function test_getWordCount() + public function testGetWordCount() { $this->assertSame(0, (new ReadingTime($this->words(0)))->getWordCount()); $this->assertSame(120, (new ReadingTime($this->words(120)))->getWordCount()); @@ -38,7 +38,7 @@ public function test_getWordCount() $this->assertSame(360, (new ReadingTime($this->words(360)))->getWordCount()); } - public function test_getMinutes() + public function testGetMinutes() { $this->assertSame(0, (new ReadingTime($this->words(0)))->getMinutes()); $this->assertSame(0, (new ReadingTime($this->words(120)))->getMinutes()); @@ -46,7 +46,7 @@ public function test_getMinutes() $this->assertSame(1, (new ReadingTime($this->words(360)))->getMinutes()); } - public function test_getSeconds() + public function testGetSeconds() { $this->assertSame(0, (new ReadingTime($this->words(0)))->getSeconds()); $this->assertSame(30, (new ReadingTime($this->words(120)))->getSeconds()); @@ -54,7 +54,7 @@ public function test_getSeconds() $this->assertSame(90, (new ReadingTime($this->words(360)))->getSeconds()); } - public function test_getSecondsOver() + public function testGetSecondsOver() { $this->assertSame(0, (new ReadingTime($this->words(0)))->getSecondsOver()); $this->assertSame(30, (new ReadingTime($this->words(120)))->getSecondsOver()); @@ -62,7 +62,7 @@ public function test_getSecondsOver() $this->assertSame(30, (new ReadingTime($this->words(360)))->getSecondsOver()); } - public function test_getFormatted() + public function testGetFormatted() { $this->assertSame('1min, 0sec', (new ReadingTime($this->words(0)))->getFormatted()); $this->assertSame('1min, 0sec', (new ReadingTime($this->words(120)))->getFormatted()); @@ -70,7 +70,7 @@ public function test_getFormatted() $this->assertSame('1min, 30sec', (new ReadingTime($this->words(360)))->getFormatted()); } - public function test_getFormattedWithCustomFormatting() + public function testGetFormattedWithCustomFormatting() { $this->assertSame('1:00', (new ReadingTime($this->words(0)))->getFormatted('%d:%02d')); $this->assertSame('1:00', (new ReadingTime($this->words(120)))->getFormatted('%d:%02d')); @@ -78,7 +78,7 @@ public function test_getFormattedWithCustomFormatting() $this->assertSame('1:30', (new ReadingTime($this->words(360)))->getFormatted('%d:%02d')); } - public function test_getFormattedFormatsUpToOneMinuteWhenRoundUpIsSet() + public function testGetFormattedFormatsUpToOneMinuteWhenRoundUpIsSet() { $this->assertSame('1min, 0sec', (new ReadingTime($this->words(0)))->getFormatted()); $this->assertSame('1min, 0sec', (new ReadingTime($this->words(120)))->getFormatted()); @@ -86,7 +86,7 @@ public function test_getFormattedFormatsUpToOneMinuteWhenRoundUpIsSet() $this->assertSame('1min, 30sec', (new ReadingTime($this->words(360)))->getFormatted()); } - public function test_formatUsingClosure() + public function testFormatUsingClosure() { /** * @param int $minutes @@ -103,13 +103,13 @@ public function test_formatUsingClosure() $this->assertSame('1 minutes, 30 seconds', (new ReadingTime($this->words(360)))->formatUsingClosure($closure)); } - public function test_fromString() + public function testFromString() { $this->assertInstanceOf(ReadingTime::class, ReadingTime::fromString('Hello world')); $this->assertEquals(new ReadingTime('Hello world'), ReadingTime::fromString('Hello world')); } - public function test_fromFile() + public function testFromFile() { app()->instance(Filesystem::class, Mockery::mock(Filesystem::class)->shouldReceive('get')->with(Hyde::path('foo.md'), false)->andReturn('Hello world')->getMock()); diff --git a/packages/framework/tests/Feature/RedirectTest.php b/packages/framework/tests/Feature/RedirectTest.php index 212381568ef..e1ef86337c3 100644 --- a/packages/framework/tests/Feature/RedirectTest.php +++ b/packages/framework/tests/Feature/RedirectTest.php @@ -15,7 +15,7 @@ */ class RedirectTest extends TestCase { - public function test_can_create_a_redirect() + public function testCanCreateARedirect() { $redirect = Redirect::create('foo', 'bar'); @@ -48,7 +48,7 @@ public function test_can_create_a_redirect() Filesystem::unlink('_site/foo.html'); } - public function test_path_parameter_is_normalized() + public function testPathParameterIsNormalized() { $redirect = Redirect::create('foo.html', 'bar'); @@ -57,7 +57,7 @@ public function test_path_parameter_is_normalized() Filesystem::unlink('_site/foo.html'); } - public function test_text_can_be_disabled() + public function testTextCanBeDisabled() { $redirect = Redirect::create('foo', 'bar'); $this->assertStringContainsString('Redirecting to boot(); @@ -37,7 +37,7 @@ public function test_boot_method_discovers_all_pages() ], $collection->all()); } - public function test_boot_method_discovers_all_page_types() + public function testBootMethodDiscoversAllPageTypes() { $this->withoutDefaultPages(); $this->withoutDocumentationSearch(); @@ -65,7 +65,7 @@ public function test_boot_method_discovers_all_page_types() $this->restoreDocumentationSearch(); } - public function test_get_routes_returns_all_routes() + public function testGetRoutesReturnsAllRoutes() { $this->file('_pages/blade.blade.php'); $this->file('_pages/markdown.md'); @@ -76,7 +76,7 @@ public function test_get_routes_returns_all_routes() $this->assertSame(Hyde::routes(), Routes::getRoutes()); } - public function test_get_routes_for_model_returns_collection_of_routes_of_given_class() + public function testGetRoutesForModelReturnsCollectionOfRoutesOfGivenClass() { $this->withoutDefaultPages(); $this->withoutDocumentationSearch(); @@ -100,7 +100,7 @@ public function test_get_routes_for_model_returns_collection_of_routes_of_given_ $this->restoreDocumentationSearch(); } - public function test_add_route_adds_new_route() + public function testAddRouteAddsNewRoute() { $collection = Hyde::routes(); $this->assertCount(2, $collection); @@ -109,12 +109,12 @@ public function test_add_route_adds_new_route() $this->assertEquals(new Route(new BladePage('new')), $collection->last()); } - public function test_get_route() + public function testGetRoute() { $this->assertEquals(new Route(new BladePage('index')), Routes::getRoute('index')); } - public function test_get_route_with_non_existing_route() + public function testGetRouteWithNonExistingRoute() { $this->expectException(RouteNotFoundException::class); $this->expectExceptionMessage('Route [non-existing] not found'); diff --git a/packages/framework/tests/Feature/Services/BladeDownProcessorTest.php b/packages/framework/tests/Feature/Services/BladeDownProcessorTest.php index f7d26d277b5..797e22d2972 100644 --- a/packages/framework/tests/Feature/Services/BladeDownProcessorTest.php +++ b/packages/framework/tests/Feature/Services/BladeDownProcessorTest.php @@ -14,12 +14,12 @@ */ class BladeDownProcessorTest extends TestCase { - public function test_it_renders_blade_echo_syntax() + public function testItRendersBladeEchoSyntax() { $this->assertEquals('Hello World!', BladeDownProcessor::render('[Blade]: {{ "Hello World!" }}')); } - public function test_it_renders_blade_within_multiline_markdown() + public function testItRendersBladeWithinMultilineMarkdown() { $this->assertEquals( "Foo\nHello World!\nBar", @@ -28,7 +28,7 @@ public function test_it_renders_blade_within_multiline_markdown() ); } - public function test_it_renders_blade_views() + public function testItRendersBladeViews() { if (! file_exists(resource_path('views'))) { mkdir(resource_path('views')); @@ -43,23 +43,23 @@ public function test_it_renders_blade_views() unlink(resource_path('views/hello.blade.php')); } - public function test_directive_is_case_insensitive() + public function testDirectiveIsCaseInsensitive() { $this->assertEquals('Hello World!', BladeDownProcessor::render('[blade]: {{ "Hello World!" }}')); } - public function test_directive_is_ignored_if_it_is_not_at_the_start_of_a_line() + public function testDirectiveIsIgnoredIfItIsNotAtTheStartOfALine() { $this->assertEquals('Example: [Blade]: {{ "Hello World!" }}', BladeDownProcessor::render('Example: [Blade]: {{ "Hello World!" }}')); } - public function test_it_renders_blade_echo_syntax_with_variables() + public function testItRendersBladeEchoSyntaxWithVariables() { $this->assertEquals('Hello World!', BladeDownProcessor::render('[Blade]: {{ $foo }}', ['foo' => 'Hello World!'])); } - public function test_it_renders_blade_views_with_variables() + public function testItRendersBladeViewsWithVariables() { file_put_contents(resource_path( 'views/hello.blade.php' @@ -70,12 +70,12 @@ public function test_it_renders_blade_views_with_variables() unlink(resource_path('views/hello.blade.php')); } - public function test_preprocess_method_expands_shortcode() + public function testPreprocessMethodExpandsShortcode() { $this->assertEquals('', BladeDownProcessor::preprocess('[Blade]: {{ $foo }}')); } - public function test_process_method_renders_shortcode() + public function testProcessMethodRendersShortcode() { $this->assertEquals('Hello World!', BladeDownProcessor::postprocess('', ['foo' => 'Hello World!'])); } diff --git a/packages/framework/tests/Feature/Services/BuildTaskServiceTest.php b/packages/framework/tests/Feature/Services/BuildTaskServiceTest.php index 347f83530ca..3fd96931ea8 100644 --- a/packages/framework/tests/Feature/Services/BuildTaskServiceTest.php +++ b/packages/framework/tests/Feature/Services/BuildTaskServiceTest.php @@ -27,7 +27,7 @@ class BuildTaskServiceTest extends TestCase /** * @covers \Hyde\Console\Commands\BuildSiteCommand::runPostBuildActions */ - public function test_build_command_can_run_build_tasks() + public function testBuildCommandCanRunBuildTasks() { $this->artisan('build') ->expectsOutputToContain('Removing all files from build directory') @@ -38,7 +38,7 @@ public function test_build_command_can_run_build_tasks() File::cleanDirectory(Hyde::path('_site')); } - public function test_run_post_build_tasks_runs_configured_tasks_does_nothing_if_no_tasks_are_configured() + public function testRunPostBuildTasksRunsConfiguredTasksDoesNothingIfNoTasksAreConfigured() { $service = $this->makeService(); $service->runPostBuildTasks(); @@ -46,7 +46,7 @@ public function test_run_post_build_tasks_runs_configured_tasks_does_nothing_if_ $this->expectOutputString(''); } - public function test_get_post_build_tasks_returns_array_merged_with_config() + public function testGetPostBuildTasksReturnsArrayMergedWithConfig() { config(['hyde.build_tasks' => [SecondBuildTask::class]]); @@ -56,7 +56,7 @@ public function test_get_post_build_tasks_returns_array_merged_with_config() $this->assertEquals(1, count(array_keys($tasks, SecondBuildTask::class))); } - public function test_get_post_build_tasks_merges_duplicate_keys() + public function testGetPostBuildTasksMergesDuplicateKeys() { app(BuildTaskService::class)->registerTask(TestBuildTask::class); config(['hyde.build_tasks' => [TestBuildTask::class]]); @@ -67,7 +67,7 @@ public function test_get_post_build_tasks_merges_duplicate_keys() $this->assertEquals(1, count(array_keys($tasks, TestBuildTask::class))); } - public function test_run_post_build_tasks_runs_configured_tasks() + public function testRunPostBuildTasksRunsConfiguredTasks() { $task = $this->makeTask(); @@ -79,7 +79,7 @@ public function test_run_post_build_tasks_runs_configured_tasks() $this->expectOutputString('BuildTask'); } - public function test_exception_handler_shows_error_message_and_exits_with_code_1_without_throwing_exception() + public function testExceptionHandlerShowsErrorMessageAndExitsWithCode1WithoutThrowingException() { $return = (new class extends BuildTask { @@ -92,7 +92,7 @@ public function handle(): void $this->assertEquals(1, $return); } - public function test_find_tasks_in_app_directory_method_discovers_tasks_in_app_directory() + public function testFindTasksInAppDirectoryMethodDiscoversTasksInAppDirectory() { $this->directory('app/Actions'); $this->file('app/Actions/FooBuildTask.php', $this->classFileStub()); @@ -100,7 +100,7 @@ public function test_find_tasks_in_app_directory_method_discovers_tasks_in_app_d $this->assertContains('App\Actions\FooBuildTask', (new BuildTaskService())->getRegisteredTasks()); } - public function test_automatically_discovered_tasks_can_be_executed() + public function testAutomaticallyDiscoveredTasksCanBeExecuted() { $this->directory('app/Actions'); $this->file('app/Actions/FooBuildTask.php', $this->classFileStub()); diff --git a/packages/framework/tests/Feature/Services/DocumentationSearchServiceTest.php b/packages/framework/tests/Feature/Services/DocumentationSearchServiceTest.php index f43165cdafa..2ad1edc16a1 100644 --- a/packages/framework/tests/Feature/Services/DocumentationSearchServiceTest.php +++ b/packages/framework/tests/Feature/Services/DocumentationSearchServiceTest.php @@ -27,7 +27,7 @@ protected function tearDown(): void $this->cleanUpFilesystem(); } - public function test_it_generates_a_json_file_with_a_search_index() + public function testItGeneratesAJsonFileWithASearchIndex() { $this->file('_docs/foo.md'); @@ -39,7 +39,7 @@ public function test_it_generates_a_json_file_with_a_search_index() ]]), GeneratesDocumentationSearchIndex::handle()); } - public function test_it_adds_all_files_to_search_index() + public function testItAddsAllFilesToSearchIndex() { $this->file('_docs/foo.md'); $this->file('_docs/bar.md'); @@ -48,12 +48,12 @@ public function test_it_adds_all_files_to_search_index() $this->assertCount(3, $this->getArray()); } - public function test_it_handles_generation_even_when_there_are_no_pages() + public function testItHandlesGenerationEvenWhenThereAreNoPages() { $this->assertSame('[]', GeneratesDocumentationSearchIndex::handle()); } - public function test_it_generates_a_valid_JSON() + public function testItGeneratesAValidJson() { $this->file('_docs/foo.md', "# Bar\nHello World"); $this->file('_docs/bar.md', "# Foo\n\nHello World"); @@ -66,7 +66,7 @@ public function test_it_generates_a_valid_JSON() ); } - public function test_it_strips_markdown() + public function testItStripsMarkdown() { $this->file('_docs/foo.md', "# Foo Bar\n**Hello** _World_"); @@ -76,7 +76,7 @@ public function test_it_strips_markdown() ); } - public function test_get_destination_for_slug_returns_empty_string_for_index_when_pretty_url_is_enabled() + public function testGetDestinationForSlugReturnsEmptyStringForIndexWhenPrettyUrlIsEnabled() { self::mockConfig(['hyde.pretty_urls' => true]); $this->file('_docs/index.md'); @@ -86,7 +86,7 @@ public function test_get_destination_for_slug_returns_empty_string_for_index_whe ); } - public function test_get_destination_for_slug_returns_pretty_url_when_enabled() + public function testGetDestinationForSlugReturnsPrettyUrlWhenEnabled() { self::mockConfig(['hyde.pretty_urls' => true]); $this->file('_docs/foo.md'); @@ -96,7 +96,7 @@ public function test_get_destination_for_slug_returns_pretty_url_when_enabled() ); } - public function test_excluded_pages_are_not_present_in_the_search_index() + public function testExcludedPagesAreNotPresentInTheSearchIndex() { $this->file('_docs/excluded.md'); self::mockConfig(['docs.exclude_from_search' => ['excluded']]); @@ -106,7 +106,7 @@ public function test_excluded_pages_are_not_present_in_the_search_index() ); } - public function test_nested_source_files_do_not_retain_directory_name_in_search_index() + public function testNestedSourceFilesDoNotRetainDirectoryNameInSearchIndex() { $this->directory(Hyde::path('_docs/foo')); $this->file('_docs/foo/bar.md'); diff --git a/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php b/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php index 5562c1ece44..54290a8e34d 100644 --- a/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php +++ b/packages/framework/tests/Feature/Services/DocumentationSidebarTest.php @@ -38,14 +38,14 @@ protected function tearDown(): void parent::tearDown(); } - public function test_sidebar_can_be_created() + public function testSidebarCanBeCreated() { $sidebar = DocumentationSidebar::create(); $this->assertInstanceOf(DocumentationSidebar::class, $sidebar); } - public function test_sidebar_items_are_added_automatically() + public function testSidebarItemsAreAddedAutomatically() { $this->createTestFiles(); @@ -54,7 +54,7 @@ public function test_sidebar_items_are_added_automatically() $this->assertCount(5, $sidebar->items); } - public function test_index_page_is_removed_from_sidebar() + public function testIndexPageIsRemovedFromSidebar() { $this->createTestFiles(); Filesystem::touch('_docs/index.md'); @@ -63,7 +63,7 @@ public function test_index_page_is_removed_from_sidebar() $this->assertCount(5, $sidebar->items); } - public function test_files_with_front_matter_hidden_set_to_true_are_removed_from_sidebar() + public function testFilesWithFrontMatterHiddenSetToTrueAreRemovedFromSidebar() { $this->createTestFiles(); File::put(Hyde::path('_docs/test.md'), "---\nnavigation:\n hidden: true\n---\n\n# Foo"); @@ -72,7 +72,7 @@ public function test_files_with_front_matter_hidden_set_to_true_are_removed_from $this->assertCount(5, $sidebar->items); } - public function test_sidebar_is_ordered_alphabetically_when_no_order_is_set_in_config() + public function testSidebarIsOrderedAlphabeticallyWhenNoOrderIsSetInConfig() { Config::set('docs.sidebar_order', []); Filesystem::touch('_docs/a.md'); @@ -89,7 +89,7 @@ public function test_sidebar_is_ordered_alphabetically_when_no_order_is_set_in_c ); } - public function test_sidebar_is_ordered_by_priority_when_priority_is_set_in_config() + public function testSidebarIsOrderedByPriorityWhenPriorityIsSetInConfig() { Config::set('docs.sidebar_order', [ 'c', @@ -110,14 +110,14 @@ public function test_sidebar_is_ordered_by_priority_when_priority_is_set_in_conf ); } - public function test_sidebar_item_priority_can_be_set_in_front_matter() + public function testSidebarItemPriorityCanBeSetInFrontMatter() { $this->makePage('foo', ['navigation.priority' => 25]); $this->assertEquals(25, DocumentationSidebar::create()->items->first()->priority); } - public function test_sidebar_item_priority_set_in_config_overrides_front_matter() + public function testSidebarItemPrioritySetInConfigOverridesFrontMatter() { $this->makePage('foo', ['navigation.priority' => 25]); @@ -126,7 +126,7 @@ public function test_sidebar_item_priority_set_in_config_overrides_front_matter( $this->assertEquals(25, DocumentationSidebar::create()->items->first()->priority); } - public function test_sidebar_priorities_can_be_set_in_both_front_matter_and_config() + public function testSidebarPrioritiesCanBeSetInBothFrontMatterAndConfig() { Config::set('docs.sidebar_order', [ 'first', @@ -149,26 +149,26 @@ public function test_sidebar_priorities_can_be_set_in_both_front_matter_and_conf ); } - public function test_group_can_be_set_in_front_matter() + public function testGroupCanBeSetInFrontMatter() { $this->makePage('foo', ['navigation.group' => 'bar']); $this->assertEquals('bar', DocumentationSidebar::create()->items->first()->getGroup()); } - public function test_has_groups_returns_false_when_there_are_no_groups() + public function testHasGroupsReturnsFalseWhenThereAreNoGroups() { $this->assertFalse(DocumentationSidebar::create()->hasGroups()); } - public function test_has_groups_returns_true_when_there_are_groups() + public function testHasGroupsReturnsTrueWhenThereAreGroups() { $this->makePage('foo', ['navigation.group' => 'bar']); $this->assertTrue(DocumentationSidebar::create()->hasGroups()); } - public function test_has_groups_returns_true_when_there_are_multiple_groups() + public function testHasGroupsReturnsTrueWhenThereAreMultipleGroups() { $this->makePage('foo', ['navigation.group' => 'bar']); $this->makePage('bar', ['navigation.group' => 'baz']); @@ -176,7 +176,7 @@ public function test_has_groups_returns_true_when_there_are_multiple_groups() $this->assertTrue(DocumentationSidebar::create()->hasGroups()); } - public function test_has_groups_returns_true_when_there_are_multiple_groups_mixed_with_defaults() + public function testHasGroupsReturnsTrueWhenThereAreMultipleGroupsMixedWithDefaults() { $this->makePage('foo', ['navigation.group' => 'bar']); $this->makePage('bar', ['navigation.group' => 'baz']); @@ -185,19 +185,19 @@ public function test_has_groups_returns_true_when_there_are_multiple_groups_mixe $this->assertTrue(DocumentationSidebar::create()->hasGroups()); } - public function test_get_groups_returns_empty_array_when_there_are_no_groups() + public function testGetGroupsReturnsEmptyArrayWhenThereAreNoGroups() { $this->assertEquals([], DocumentationSidebar::create()->getGroups()); } - public function test_get_groups_returns_array_of_groups_when_there_are_groups() + public function testGetGroupsReturnsArrayOfGroupsWhenThereAreGroups() { $this->makePage('foo', ['navigation.group' => 'bar']); $this->assertEquals(['bar'], DocumentationSidebar::create()->getGroups()); } - public function test_get_groups_returns_array_with_no_duplicates() + public function testGetGroupsReturnsArrayWithNoDuplicates() { $this->makePage('foo', ['navigation.group' => 'bar']); $this->makePage('bar', ['navigation.group' => 'bar']); @@ -206,7 +206,7 @@ public function test_get_groups_returns_array_with_no_duplicates() $this->assertEquals(['bar', 'baz'], DocumentationSidebar::create()->getGroups()); } - public function test_groups_are_sorted_by_lowest_found_priority_in_each_group() + public function testGroupsAreSortedByLowestFoundPriorityInEachGroup() { $this->makePage('foo', ['navigation.group' => 'bar', 'navigation.priority' => 100]); $this->makePage('bar', ['navigation.group' => 'bar', 'navigation.priority' => 200]); @@ -215,12 +215,12 @@ public function test_groups_are_sorted_by_lowest_found_priority_in_each_group() $this->assertEquals(['baz', 'bar'], DocumentationSidebar::create()->getGroups()); } - public function test_get_items_in_group_returns_empty_collection_when_there_are_no_items() + public function testGetItemsInGroupReturnsEmptyCollectionWhenThereAreNoItems() { $this->assertEquals(collect(), DocumentationSidebar::create()->getItemsInGroup('foo')); } - public function test_get_items_in_group_returns_collection_of_items_in_group() + public function testGetItemsInGroupReturnsCollectionOfItemsInGroup() { $this->makePage('foo', ['navigation.group' => 'bar']); $this->makePage('bar', ['navigation.group' => 'bar']); @@ -242,7 +242,7 @@ public function test_get_items_in_group_returns_collection_of_items_in_group() ); } - public function test_get_items_in_group_normalizes_group_name_to_slug_format() + public function testGetItemsInGroupNormalizesGroupNameToSlugFormat() { $this->makePage('a', ['navigation.group' => 'foo bar']); $this->makePage('b', ['navigation.group' => 'Foo Bar']); @@ -258,7 +258,7 @@ public function test_get_items_in_group_normalizes_group_name_to_slug_format() ); } - public function test_get_items_in_group_does_not_include_items_with_hidden_front_matter() + public function testGetItemsInGroupDoesNotIncludeItemsWithHiddenFrontMatter() { $this->makePage('a', ['navigation.hidden' => true, 'navigation.group' => 'foo']); $this->makePage('b', ['navigation.group' => 'foo']); @@ -269,7 +269,7 @@ public function test_get_items_in_group_does_not_include_items_with_hidden_front ); } - public function test_get_items_in_group_does_not_include_docs_index() + public function testGetItemsInGroupDoesNotIncludeDocsIndex() { Filesystem::touch('_docs/foo.md'); Filesystem::touch('_docs/index.md'); @@ -280,25 +280,25 @@ public function test_get_items_in_group_does_not_include_docs_index() ); } - public function test_is_group_active_returns_false_when_supplied_group_is_not_active() + public function testIsGroupActiveReturnsFalseWhenSuppliedGroupIsNotActive() { Render::setPage(new DocumentationPage(matter: ['navigation.group' => 'foo'])); $this->assertFalse(DocumentationSidebar::create()->isGroupActive('bar')); } - public function test_is_group_active_returns_true_when_supplied_group_is_active() + public function testIsGroupActiveReturnsTrueWhenSuppliedGroupIsActive() { Render::setPage(new DocumentationPage(matter: ['navigation.group' => 'foo'])); $this->assertTrue(DocumentationSidebar::create()->isGroupActive('foo')); } - public function test_is_group_active_returns_true_for_differing_casing() + public function testIsGroupActiveReturnsTrueForDifferingCasing() { Render::setPage(new DocumentationPage(matter: ['navigation.group' => 'Foo Bar'])); $this->assertTrue(DocumentationSidebar::create()->isGroupActive('foo-bar')); } - public function test_is_group_active_returns_true_first_group_of_index_page() + public function testIsGroupActiveReturnsTrueFirstGroupOfIndexPage() { $this->makePage('index'); $this->makePage('foo', ['navigation.group' => 'foo']); @@ -311,7 +311,7 @@ public function test_is_group_active_returns_true_first_group_of_index_page() $this->assertFalse(DocumentationSidebar::create()->isGroupActive('baz')); } - public function test_is_group_active_returns_true_first_sorted_group_of_index_page() + public function testIsGroupActiveReturnsTrueFirstSortedGroupOfIndexPage() { $this->makePage('index'); $this->makePage('foo', ['navigation.group' => 'foo', 'navigation.priority' => 1]); @@ -324,7 +324,7 @@ public function test_is_group_active_returns_true_first_sorted_group_of_index_pa $this->assertFalse(DocumentationSidebar::create()->isGroupActive('baz')); } - public function test_automatic_index_page_group_expansion_respects_custom_navigation_menu_settings() + public function testAutomaticIndexPageGroupExpansionRespectsCustomNavigationMenuSettings() { $this->makePage('index', ['navigation.group' => 'baz']); $this->makePage('foo', ['navigation.group' => 'foo', 'navigation.priority' => 1]); @@ -337,7 +337,7 @@ public function test_automatic_index_page_group_expansion_respects_custom_naviga $this->assertTrue(DocumentationSidebar::create()->isGroupActive('baz')); } - public function test_make_group_title_turns_group_key_into_title() + public function testMakeGroupTitleTurnsGroupKeyIntoTitle() { $this->assertSame('Hello World', DocumentationSidebar::create()->makeGroupTitle('hello world')); $this->assertSame('Hello World', DocumentationSidebar::create()->makeGroupTitle('hello-world')); @@ -345,7 +345,7 @@ public function test_make_group_title_turns_group_key_into_title() $this->assertSame('Hello World', DocumentationSidebar::create()->makeGroupTitle('helloWorld')); } - public function test_make_group_title_uses_configured_sidebar_group_labels_when_available() + public function testMakeGroupTitleUsesConfiguredSidebarGroupLabelsWhenAvailable() { Config::set('docs.sidebar_group_labels', [ 'example' => 'Hello world!', @@ -355,7 +355,7 @@ public function test_make_group_title_uses_configured_sidebar_group_labels_when_ $this->assertSame('Default', DocumentationSidebar::create()->makeGroupTitle('default')); } - public function test_can_have_multiple_grouped_pages_with_the_same_name_labels() + public function testCanHaveMultipleGroupedPagesWithTheSameNameLabels() { $this->makePage('foo', ['navigation.group' => 'foo', 'navigation.label' => 'Foo']); $this->makePage('bar', ['navigation.group' => 'bar', 'navigation.label' => 'Foo']); @@ -372,7 +372,7 @@ public function test_can_have_multiple_grouped_pages_with_the_same_name_labels() ); } - public function test_duplicate_labels_within_the_same_group_is_removed() + public function testDuplicateLabelsWithinTheSameGroupIsRemoved() { $this->makePage('foo', ['navigation.group' => 'foo', 'navigation.label' => 'Foo']); $this->makePage('bar', ['navigation.group' => 'foo', 'navigation.label' => 'Foo']); @@ -386,7 +386,7 @@ public function test_duplicate_labels_within_the_same_group_is_removed() ); } - public function test_is_group_active_for_index_page_with_no_groups() + public function testIsGroupActiveForIndexPageWithNoGroups() { $this->makePage('index'); @@ -394,7 +394,7 @@ public function test_is_group_active_for_index_page_with_no_groups() $this->assertFalse(DocumentationSidebar::create()->isGroupActive('foo')); } - public function test_index_page_added_to_sidebar_when_it_is_the_only_page() + public function testIndexPageAddedToSidebarWhenItIsTheOnlyPage() { Filesystem::touch('_docs/index.md'); $sidebar = DocumentationSidebar::create(); @@ -406,7 +406,7 @@ public function test_index_page_added_to_sidebar_when_it_is_the_only_page() ); } - public function test_index_page_not_added_to_sidebar_when_other_pages_exist() + public function testIndexPageNotAddedToSidebarWhenOtherPagesExist() { $this->createTestFiles(1); Filesystem::touch('_docs/index.md'); diff --git a/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php b/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php index 1404841fbdb..a44ffcd9df2 100644 --- a/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php +++ b/packages/framework/tests/Feature/Services/HydeSmartDocsTest.php @@ -20,7 +20,7 @@ */ class HydeSmartDocsTest extends TestCase { - public function test_class_tokenizes_document() + public function testClassTokenizesDocument() { $article = $this->makeArticle("# Header Content \n\n Body Content"); @@ -28,7 +28,7 @@ public function test_class_tokenizes_document() $this->assertEquals('

Body Content

', $article->renderBody()); } - public function test_class_can_handle_document_with_no_header() + public function testClassCanHandleDocumentWithNoHeader() { $article = $this->makeArticle('Body Content'); @@ -36,7 +36,7 @@ public function test_class_can_handle_document_with_no_header() $this->assertEquals('

Body Content

', $article->renderBody()); } - public function test_class_can_handle_document_with_only_header() + public function testClassCanHandleDocumentWithOnlyHeader() { $article = $this->makeArticle('# Header Content'); @@ -44,7 +44,7 @@ public function test_class_can_handle_document_with_only_header() $this->assertEquals('', $article->renderBody()); } - public function test_class_can_handle_empty_document() + public function testClassCanHandleEmptyDocument() { $article = $this->makeArticle(''); @@ -52,7 +52,7 @@ public function test_class_can_handle_empty_document() $this->assertEquals('', $article->renderBody()); } - public function test_create_helper_creates_new_instance_and_processes_it() + public function testCreateHelperCreatesNewInstanceAndProcessesIt() { $article = $this->makeArticle(); @@ -64,7 +64,7 @@ public function test_create_helper_creates_new_instance_and_processes_it() ); } - public function test_render_header_returns_the_extracted_header() + public function testRenderHeaderReturnsTheExtractedHeader() { $this->assertSame( '

Foo

', @@ -72,7 +72,7 @@ public function test_render_header_returns_the_extracted_header() ); } - public function test_render_header_returns_the_extracted_header_with_varying_newlines() + public function testRenderHeaderReturnsTheExtractedHeaderWithVaryingNewlines() { $tests = [ "# Foo\n\nHello world.", @@ -88,7 +88,7 @@ public function test_render_header_returns_the_extracted_header_with_varying_new } } - public function test_render_body_returns_the_extracted_body() + public function testRenderBodyReturnsTheExtractedBody() { $this->assertSame( '

Hello world.

', @@ -96,7 +96,7 @@ public function test_render_body_returns_the_extracted_body() ); } - public function test_render_body_returns_the_extracted_body_with_varying_newlines() + public function testRenderBodyReturnsTheExtractedBodyWithVaryingNewlines() { $tests = [ "# Foo\n\nHello world.", @@ -112,7 +112,7 @@ public function test_render_body_returns_the_extracted_body_with_varying_newline } } - public function test_render_footer_is_empty_by_default() + public function testRenderFooterIsEmptyByDefault() { $this->assertSame( '', @@ -120,7 +120,7 @@ public function test_render_footer_is_empty_by_default() ); } - public function test_add_dynamic_header_content_adds_source_link_when_conditions_are_met() + public function testAddDynamicHeaderContentAddsSourceLinkWhenConditionsAreMet() { config(['docs.source_file_location_base' => 'https://example.com/']); config(['docs.edit_source_link_position' => 'header']); @@ -130,7 +130,7 @@ public function test_add_dynamic_header_content_adds_source_link_when_conditions HTML, $this->makeArticle()->renderHeader()); } - public function test_edit_source_link_is_added_to_footer_when_conditions_are_met() + public function testEditSourceLinkIsAddedToFooterWhenConditionsAreMet() { config(['docs.source_file_location_base' => 'https://example.com/']); config(['docs.edit_source_link_position' => 'footer']); @@ -140,7 +140,7 @@ public function test_edit_source_link_is_added_to_footer_when_conditions_are_met HTML, $this->makeArticle()->renderFooter()); } - public function test_edit_source_link_can_be_added_to_both_header_and_footer() + public function testEditSourceLinkCanBeAddedToBothHeaderAndFooter() { config(['docs.source_file_location_base' => 'https://example.com/']); config(['docs.edit_source_link_position' => 'both']); @@ -156,7 +156,7 @@ public function test_edit_source_link_can_be_added_to_both_header_and_footer() HTML, $article->renderFooter()); } - public function test_edit_source_link_text_can_be_customized_in_header() + public function testEditSourceLinkTextCanBeCustomizedInHeader() { config(['docs.source_file_location_base' => 'https://example.com/']); config(['docs.edit_source_link_position' => 'both']); @@ -167,7 +167,7 @@ public function test_edit_source_link_text_can_be_customized_in_header() HTML, $this->makeArticle()->renderHeader()); } - public function test_edit_source_link_text_can_be_customized_in_footer() + public function testEditSourceLinkTextCanBeCustomizedInFooter() { config(['docs.source_file_location_base' => 'https://example.com/']); config(['docs.edit_source_link_position' => 'both']); @@ -178,7 +178,7 @@ public function test_edit_source_link_text_can_be_customized_in_footer() HTML, $this->makeArticle()->renderFooter()); } - public function test_add_dynamic_footer_content_adds_torchlight_attribution_when_conditions_are_met() + public function testAddDynamicFooterContentAddsTorchlightAttributionWhenConditionsAreMet() { app()->bind('env', fn () => 'production'); config(['torchlight.token' => '12345']); @@ -188,7 +188,7 @@ public function test_add_dynamic_footer_content_adds_torchlight_attribution_when ); } - public function test_the_documentation_article_view() + public function testTheDocumentationArticleView() { $rendered = view('hyde::components.docs.documentation-article', [ 'page' => $this->makePage(), @@ -198,7 +198,7 @@ public function test_the_documentation_article_view() $this->assertStringContainsString('

Hello world.

', $rendered); } - public function test_the_documentation_article_view_with_existing_variable() + public function testTheDocumentationArticleViewWithExistingVariable() { $rendered = view('hyde::components.docs.documentation-article', [ 'page' => $page = $this->makePage(), diff --git a/packages/framework/tests/Feature/Services/Markdown/CodeblockFilepathProcessorTest.php b/packages/framework/tests/Feature/Services/Markdown/CodeblockFilepathProcessorTest.php index ca678357553..1d92f722291 100644 --- a/packages/framework/tests/Feature/Services/Markdown/CodeblockFilepathProcessorTest.php +++ b/packages/framework/tests/Feature/Services/Markdown/CodeblockFilepathProcessorTest.php @@ -12,7 +12,7 @@ */ class CodeblockFilepathProcessorTest extends TestCase { - public function test_preprocess_expands_filepath() + public function testPreprocessExpandsFilepath() { $markdown = "\n```php\n// filepath: foo.php\necho 'Hello World';\n```"; $expected = "\n\n```php\necho 'Hello World';\n```"; @@ -20,7 +20,7 @@ public function test_preprocess_expands_filepath() $this->assertEquals($expected, CodeblockFilepathProcessor::preprocess($markdown)); } - public function test_preprocess_accepts_multiple_filepath_formats() + public function testPreprocessAcceptsMultipleFilepathFormats() { $patterns = [ '// filepath: ', @@ -41,7 +41,7 @@ public function test_preprocess_accepts_multiple_filepath_formats() } } - public function test_filepath_pattern_is_case_insensitive() + public function testFilepathPatternIsCaseInsensitive() { $patterns = [ '// filepath: ', @@ -58,7 +58,7 @@ public function test_filepath_pattern_is_case_insensitive() } } - public function test_preprocess_accepts_multiple_languages() + public function testPreprocessAcceptsMultipleLanguages() { $languages = [ 'php', @@ -78,7 +78,7 @@ public function test_preprocess_accepts_multiple_languages() $this->assertEquals($expected, CodeblockFilepathProcessor::preprocess($markdown)); } - public function test_preprocess_accepts_multiple_input_blocks() + public function testPreprocessAcceptsMultipleInputBlocks() { $markdown = <<<'MD' @@ -109,7 +109,7 @@ public function test_preprocess_accepts_multiple_input_blocks() $this->assertSame($expected, CodeblockFilepathProcessor::preprocess($markdown)); } - public function test_preprocess_accepts_multi_line_codeblocks() + public function testPreprocessAcceptsMultiLineCodeblocks() { $markdown = <<<'MD' @@ -134,7 +134,7 @@ public function test_preprocess_accepts_multi_line_codeblocks() $this->assertSame($expected, CodeblockFilepathProcessor::preprocess($markdown)); } - public function test_space_after_filepath_is_optional() + public function testSpaceAfterFilepathIsOptional() { $markdown = <<<'MD' @@ -157,7 +157,7 @@ public function test_space_after_filepath_is_optional() CodeblockFilepathProcessor::preprocess($markdown)); } - public function test_processor_expands_filepath_directive_in_standard_codeblock() + public function testProcessorExpandsFilepathDirectiveInStandardCodeblock() { $html = <<<'HTML' @@ -171,7 +171,7 @@ public function test_processor_expands_filepath_directive_in_standard_codeblock( $this->assertSame($expected, CodeblockFilepathProcessor::postprocess($html)); } - public function test_processor_expands_filepath_directive_in_torchlight_codeblock() + public function testProcessorExpandsFilepathDirectiveInTorchlightCodeblock() { $html = <<<'HTML' @@ -185,7 +185,7 @@ public function test_processor_expands_filepath_directive_in_torchlight_codebloc $this->assertSame($expected, CodeblockFilepathProcessor::postprocess($html)); } - public function test_processor_escapes_html_by_default() + public function testProcessorEscapesHtmlByDefault() { $html = <<<'HTML' @@ -200,7 +200,7 @@ public function test_processor_escapes_html_by_default() $this->assertSame($expected, CodeblockFilepathProcessor::postprocess($html)); } - public function test_processor_does_not_escape_html_if_configured() + public function testProcessorDoesNotEscapeHtmlIfConfigured() { config(['markdown.allow_html' => true]); diff --git a/packages/framework/tests/Feature/Services/Markdown/ShortcodeProcessorTest.php b/packages/framework/tests/Feature/Services/Markdown/ShortcodeProcessorTest.php index 559c1c849a2..195da02b12a 100644 --- a/packages/framework/tests/Feature/Services/Markdown/ShortcodeProcessorTest.php +++ b/packages/framework/tests/Feature/Services/Markdown/ShortcodeProcessorTest.php @@ -13,7 +13,7 @@ */ class ShortcodeProcessorTest extends UnitTestCase { - public function test_constructor_discovers_default_shortcodes() + public function testConstructorDiscoversDefaultShortcodes() { $shortcodes = (new ShortcodeProcessor('foo'))->getShortcodes(); @@ -21,7 +21,7 @@ public function test_constructor_discovers_default_shortcodes() $this->assertContainsOnlyInstancesOf(MarkdownShortcodeContract::class, $shortcodes); } - public function test_discovered_shortcodes_are_used_to_process_input() + public function testDiscoveredShortcodesAreUsedToProcessInput() { $processor = new ShortcodeProcessor('>info foo'); @@ -29,20 +29,20 @@ public function test_discovered_shortcodes_are_used_to_process_input() $processor->run()); } - public function test_string_without_shortcode_is_not_modified() + public function testStringWithoutShortcodeIsNotModified() { $processor = new ShortcodeProcessor('foo'); $this->assertEquals('foo', $processor->run()); } - public function test_process_static_shorthand() + public function testProcessStaticShorthand() { $this->assertEquals('

foo

', ShortcodeProcessor::preprocess('>info foo')); } - public function test_shortcodes_can_be_added_to_processor() + public function testShortcodesCanBeAddedToProcessor() { $processor = new ShortcodeProcessor('foo'); @@ -63,7 +63,7 @@ public static function resolve(string $input): string $this->assertEquals('bar', $processor->run()); } - public function test_shortcodes_can_be_added_to_processor_using_array() + public function testShortcodesCanBeAddedToProcessorUsingArray() { $processor = new ShortcodeProcessor('foo'); diff --git a/packages/framework/tests/Feature/Services/RssFeedServiceTest.php b/packages/framework/tests/Feature/Services/RssFeedServiceTest.php index da8fa05b2cd..475fb7705d9 100644 --- a/packages/framework/tests/Feature/Services/RssFeedServiceTest.php +++ b/packages/framework/tests/Feature/Services/RssFeedServiceTest.php @@ -16,26 +16,26 @@ */ class RssFeedServiceTest extends TestCase { - public function test_service_instantiates_xml_element() + public function testServiceInstantiatesXmlElement() { $service = new RssFeedGenerator(); $this->assertInstanceOf('SimpleXMLElement', $service->getXmlElement()); } - public function test_xml_root_element_is_set_to_rss_2_0() + public function testXmlRootElementIsSetToRss20() { $service = new RssFeedGenerator(); $this->assertEquals('rss', $service->getXmlElement()->getName()); $this->assertEquals('2.0', $service->getXmlElement()->attributes()->version); } - public function test_xml_element_has_channel_element() + public function testXmlElementHasChannelElement() { $service = new RssFeedGenerator(); $this->assertTrue(property_exists($service->getXmlElement(), 'channel')); } - public function test_xml_channel_element_has_required_elements() + public function testXmlChannelElementHasRequiredElements() { config(['hyde.name' => 'Test Blog']); config(['hyde.url' => 'https://example.com']); @@ -51,7 +51,7 @@ public function test_xml_channel_element_has_required_elements() $this->assertEquals('Test Blog RSS Feed', $service->getXmlElement()->channel->description); } - public function test_xml_channel_element_has_additional_elements() + public function testXmlChannelElementHasAdditionalElements() { config(['hyde.url' => 'https://example.com']); @@ -66,7 +66,7 @@ public function test_xml_channel_element_has_additional_elements() $this->assertTrue(property_exists($service->getXmlElement()->channel, 'lastBuildDate')); } - public function test_xml_channel_data_can_be_customized() + public function testXmlChannelDataCanBeCustomized() { config(['hyde.name' => 'Foo']); config(['hyde.url' => 'https://blog.foo.com/bar']); @@ -78,7 +78,7 @@ public function test_xml_channel_data_can_be_customized() $this->assertEquals('Foo is a web log about stuff', $service->getXmlElement()->channel->description); } - public function test_markdown_blog_posts_are_added_to_rss_feed_through_autodiscovery() + public function testMarkdownBlogPostsAreAddedToRssFeedThroughAutodiscovery() { file_put_contents(Hyde::path('_posts/rss.md'), <<<'MD' --- @@ -121,32 +121,32 @@ public function test_markdown_blog_posts_are_added_to_rss_feed_through_autodisco Filesystem::unlink('_media/rss-test.jpg'); } - public function test_get_xml_method_returns_xml_string() + public function testGetXmlMethodReturnsXmlString() { $service = new RssFeedGenerator(); $this->assertStringStartsWith('', $service->getXml()); } - public function test_generate_feed_helper_returns_xml_string() + public function testGenerateFeedHelperReturnsXmlString() { $this->assertStringStartsWith('', RssFeedGenerator::make()); } - public function test_can_generate_feed_helper_returns_true_if_hyde_has_base_url() + public function testCanGenerateFeedHelperReturnsTrueIfHydeHasBaseUrl() { config(['hyde.url' => 'foo']); $this->file('_posts/foo.md'); $this->assertTrue(Features::rss()); } - public function test_can_generate_feed_helper_returns_false_if_hyde_does_not_have_base_url() + public function testCanGenerateFeedHelperReturnsFalseIfHydeDoesNotHaveBaseUrl() { config(['hyde.url' => '']); $this->file('_posts/foo.md'); $this->assertFalse(Features::rss()); } - public function test_can_generate_feed_helper_returns_false_if_feeds_are_disabled_in_config() + public function testCanGenerateFeedHelperReturnsFalseIfFeedsAreDisabledInConfig() { config(['hyde.url' => 'foo']); config(['hyde.rss.enabled' => false]); diff --git a/packages/framework/tests/Feature/Services/SitemapServiceTest.php b/packages/framework/tests/Feature/Services/SitemapServiceTest.php index 0c735f08819..d33a3830a68 100644 --- a/packages/framework/tests/Feature/Services/SitemapServiceTest.php +++ b/packages/framework/tests/Feature/Services/SitemapServiceTest.php @@ -26,13 +26,13 @@ protected function setUp(): void copy(Hyde::vendorPath('resources/views/pages/404.blade.php'), Hyde::path('_pages/404.blade.php')); } - public function test_service_instantiates_xml_element() + public function testServiceInstantiatesXmlElement() { $service = new SitemapGenerator(); $this->assertInstanceOf('SimpleXMLElement', $service->getXmlElement()); } - public function test_generate_adds_default_pages_to_xml() + public function testGenerateAddsDefaultPagesToXml() { $service = new SitemapGenerator(); $service->generate(); @@ -41,7 +41,7 @@ public function test_generate_adds_default_pages_to_xml() $this->assertCount(2, $service->getXmlElement()->url); } - public function test_generate_adds_markdown_pages_to_xml() + public function testGenerateAddsMarkdownPagesToXml() { Filesystem::touch('_pages/foo.md'); @@ -53,7 +53,7 @@ public function test_generate_adds_markdown_pages_to_xml() Filesystem::unlink('_pages/foo.md'); } - public function test_generate_adds_markdown_posts_to_xml() + public function testGenerateAddsMarkdownPostsToXml() { Filesystem::touch('_posts/foo.md'); @@ -65,7 +65,7 @@ public function test_generate_adds_markdown_posts_to_xml() Filesystem::unlink('_posts/foo.md'); } - public function test_generate_adds_documentation_pages_to_xml() + public function testGenerateAddsDocumentationPagesToXml() { $this->withoutDocumentationSearch(); Filesystem::touch('_docs/foo.md'); @@ -91,7 +91,7 @@ public function test_generate_adds_documentation_search_pages_to_xml() Filesystem::unlink('_docs/foo.md'); } - public function test_get_xml_returns_xml_string() + public function testGetXmlReturnsXmlString() { $service = new SitemapGenerator(); $service->generate(); @@ -101,7 +101,7 @@ public function test_get_xml_returns_xml_string() $this->assertStringStartsWith('', $xml); } - public function test_generate_sitemap_shorthand_method_returns_xml_string() + public function testGenerateSitemapShorthandMethodReturnsXmlString() { $xml = SitemapGenerator::make(); @@ -109,7 +109,7 @@ public function test_generate_sitemap_shorthand_method_returns_xml_string() $this->assertStringStartsWith('', $xml); } - public function test_url_item_is_generated_correctly() + public function testUrlItemIsGeneratedCorrectly() { config(['hyde.pretty_urls' => false]); config(['hyde.url' => 'https://example.com']); @@ -126,7 +126,7 @@ public function test_url_item_is_generated_correctly() Filesystem::unlink('_pages/0-test.blade.php'); } - public function test_url_item_is_generated_with_pretty_urls_if_enabled() + public function testUrlItemIsGeneratedWithPrettyUrlsIfEnabled() { config(['hyde.pretty_urls' => true]); config(['hyde.url' => 'https://example.com']); @@ -141,7 +141,7 @@ public function test_url_item_is_generated_with_pretty_urls_if_enabled() Filesystem::unlink('_pages/0-test.blade.php'); } - public function test_all_route_types_are_discovered() + public function testAllRouteTypesAreDiscovered() { config(['hyde.url' => 'foo']); Filesystem::unlink(['_pages/index.blade.php', '_pages/404.blade.php']); diff --git a/packages/framework/tests/Feature/Services/ValidationServiceTest.php b/packages/framework/tests/Feature/Services/ValidationServiceTest.php index 4efea55c1a1..e6fbe88846e 100644 --- a/packages/framework/tests/Feature/Services/ValidationServiceTest.php +++ b/packages/framework/tests/Feature/Services/ValidationServiceTest.php @@ -37,7 +37,7 @@ protected function test(string $method, int $expectedStatusCode) $this->assertEquals($expectedStatusCode, $result->statusCode()); } - public function test_checks_returns_an_array_of_validation_check_methods() + public function testChecksReturnsAnArrayOfValidationCheckMethods() { $checks = ValidationService::checks(); $this->assertIsArray($checks); @@ -49,31 +49,31 @@ public function test_checks_returns_an_array_of_validation_check_methods() } } - public function test_check_validators_can_run() + public function testCheckValidatorsCanRun() { $this->test('check_validators_can_run', 0); } - public function test_check_site_has_a_404_page_can_pass() + public function testCheckSiteHasA404PageCanPass() { $this->test('check_site_has_a_404_page', 0); } - public function test_check_site_has_a_404_page_can_fail() + public function testCheckSiteHasA404PageCanFail() { rename(Hyde::path('_pages/404.blade.php'), Hyde::path('_pages/404.blade.php.bak')); $this->test('check_site_has_a_404_page', 2); rename(Hyde::path('_pages/404.blade.php.bak'), Hyde::path('_pages/404.blade.php')); } - public function test_check_documentation_site_has_an_index_page_can_pass() + public function testCheckDocumentationSiteHasAnIndexPageCanPass() { touch('_docs/index.md'); $this->test('check_documentation_site_has_an_index_page', 0); unlink('_docs/index.md'); } - public function test_check_documentation_site_has_an_index_page_can_pass_with_warning_when_only_finding_readme() + public function testCheckDocumentationSiteHasAnIndexPageCanPassWithWarningWhenOnlyFindingReadme() { touch('_docs/README.md'); $this->test('check_documentation_site_has_an_index_page', 2); @@ -82,78 +82,78 @@ public function test_check_documentation_site_has_an_index_page_can_pass_with_wa unlink('_docs/README.md'); } - public function test_check_documentation_site_has_an_index_page_can_fail() + public function testCheckDocumentationSiteHasAnIndexPageCanFail() { touch('_docs/foo.md'); $this->test('check_documentation_site_has_an_index_page', 2); unlink('_docs/foo.md'); } - public function test_check_documentation_site_has_an_index_page_be_skipped() + public function testCheckDocumentationSiteHasAnIndexPageBeSkipped() { $this->test('check_documentation_site_has_an_index_page', 1); } - public function test_check_site_has_an_index_page_can_pass() + public function testCheckSiteHasAnIndexPageCanPass() { $this->test('check_site_has_an_index_page', 0); } - public function test_check_site_has_an_index_page_can_fail() + public function testCheckSiteHasAnIndexPageCanFail() { rename(Hyde::path('_pages/index.blade.php'), Hyde::path('_pages/index.blade.php.bak')); $this->test('check_site_has_an_index_page', 2); rename(Hyde::path('_pages/index.blade.php.bak'), Hyde::path('_pages/index.blade.php')); } - public function test_check_site_has_an_app_css_stylesheet_can_pass() + public function testCheckSiteHasAnAppCssStylesheetCanPass() { $this->test('check_site_has_an_app_css_stylesheet', 0); } - public function test_check_site_has_an_app_css_stylesheet_can_fail() + public function testCheckSiteHasAnAppCssStylesheetCanFail() { rename(Hyde::path('_media/app.css'), Hyde::path('_media/app.css.bak')); $this->test('check_site_has_an_app_css_stylesheet', 2); rename(Hyde::path('_media/app.css.bak'), Hyde::path('_media/app.css')); } - public function test_check_site_has_a_base_url_set_can_pass() + public function testCheckSiteHasABaseUrlSetCanPass() { config(['hyde.url' => 'https://example.com']); $this->test('check_site_has_a_base_url_set', 0); } - public function test_check_site_has_a_base_url_set_can_fail() + public function testCheckSiteHasABaseUrlSetCanFail() { config(['hyde.url' => null]); $this->test('check_site_has_a_base_url_set', 2); } - public function test_check_a_torchlight_api_token_is_set_can_skip() + public function testCheckATorchlightApiTokenIsSetCanSkip() { config(['hyde.features' => []]); $this->test('check_a_torchlight_api_token_is_set', 1); } - public function test_check_a_torchlight_api_token_is_set_can_pass() + public function testCheckATorchlightApiTokenIsSetCanPass() { config(['torchlight.token' => '12345']); $this->test('check_a_torchlight_api_token_is_set', 0); } - public function test_check_a_torchlight_api_token_is_set_can_fail() + public function testCheckATorchlightApiTokenIsSetCanFail() { config(['torchlight.token' => null]); $this->test('check_a_torchlight_api_token_is_set', 2); } - public function test_check_for_conflicts_between_blade_and_markdown_pages_can_pass() + public function testCheckForConflictsBetweenBladeAndMarkdownPagesCanPass() { $this->test('check_for_conflicts_between_blade_and_markdown_pages', 0); } - public function test_check_for_conflicts_between_blade_and_markdown_pages_can_fail() + public function testCheckForConflictsBetweenBladeAndMarkdownPagesCanFail() { Filesystem::touch('_pages/index.md'); $this->test('check_for_conflicts_between_blade_and_markdown_pages', 2); @@ -162,13 +162,13 @@ public function test_check_for_conflicts_between_blade_and_markdown_pages_can_fa // Some unit tests - public function test_validation_result_message_returns_message() + public function testValidationResultMessageReturnsMessage() { $result = new ValidationResult(); $this->assertEquals('Generic check', $result->message()); } - public function test_validation_result_passed_returns_true_when_passed_is_true() + public function testValidationResultPassedReturnsTrueWhenPassedIsTrue() { $result = new ValidationResult(); $result->pass(); @@ -177,7 +177,7 @@ public function test_validation_result_passed_returns_true_when_passed_is_true() $this->assertFalse($result->passed()); } - public function test_validation_result_failed_returns_true_when_passed_is_false() + public function testValidationResultFailedReturnsTrueWhenPassedIsFalse() { $result = new ValidationResult(); $result->pass(); @@ -186,7 +186,7 @@ public function test_validation_result_failed_returns_true_when_passed_is_false( $this->assertTrue($result->failed()); } - public function test_validation_result_skipped_returns_true_when_skipped_is_true() + public function testValidationResultSkippedReturnsTrueWhenSkippedIsTrue() { $result = new ValidationResult(); $this->assertFalse($result->skipped()); @@ -194,7 +194,7 @@ public function test_validation_result_skipped_returns_true_when_skipped_is_true $this->assertTrue($result->skipped()); } - public function test_validation_result_tip_returns_message_when_set() + public function testValidationResultTipReturnsMessageWhenSet() { $result = new ValidationResult(); $this->assertFalse($result->tip()); diff --git a/packages/framework/tests/Feature/Services/ViewDiffServiceTest.php b/packages/framework/tests/Feature/Services/ViewDiffServiceTest.php index 58b8e8bdc76..ae16dd1f3f6 100644 --- a/packages/framework/tests/Feature/Services/ViewDiffServiceTest.php +++ b/packages/framework/tests/Feature/Services/ViewDiffServiceTest.php @@ -16,7 +16,7 @@ */ class ViewDiffServiceTest extends TestCase { - public function test_get_filecache() + public function testGetFilecache() { $fileCacheService = new ViewDiffService(); $fileCache = $fileCacheService->getViewFileHashIndex(); @@ -27,7 +27,7 @@ public function test_get_filecache() $this->assertEquals(32, strlen($fileCache['resources/views/layouts/app.blade.php']['unixsum'])); } - public function test_get_checksums() + public function testGetChecksums() { $fileCacheService = new ViewDiffService(); $checksums = $fileCacheService->getChecksums(); @@ -36,7 +36,7 @@ public function test_get_checksums() $this->assertEquals(32, strlen($checksums[0])); } - public function test_checksum_matches_any() + public function testChecksumMatchesAny() { $fileCacheService = new ViewDiffService(); @@ -45,7 +45,7 @@ public function test_checksum_matches_any() )); } - public function test_checksum_matches_any_false() + public function testChecksumMatchesAnyFalse() { $fileCacheService = new ViewDiffService(); diff --git a/packages/framework/tests/Feature/SourceDirectoriesCanBeChangedTest.php b/packages/framework/tests/Feature/SourceDirectoriesCanBeChangedTest.php index 6f725512f59..51bd2016184 100644 --- a/packages/framework/tests/Feature/SourceDirectoriesCanBeChangedTest.php +++ b/packages/framework/tests/Feature/SourceDirectoriesCanBeChangedTest.php @@ -17,7 +17,7 @@ */ class SourceDirectoriesCanBeChangedTest extends TestCase { - public function test_baselines() + public function testBaselines() { $this->assertEquals('_pages', HtmlPage::sourceDirectory()); $this->assertEquals('_pages', BladePage::sourceDirectory()); @@ -26,7 +26,7 @@ public function test_baselines() $this->assertEquals('_docs', DocumentationPage::sourceDirectory()); } - public function test_source_directories_can_be_changed_programmatically() + public function testSourceDirectoriesCanBeChangedProgrammatically() { HtmlPage::setSourceDirectory('.source/pages'); BladePage::setSourceDirectory('.source/pages'); @@ -41,7 +41,7 @@ public function test_source_directories_can_be_changed_programmatically() $this->assertEquals('.source/docs', DocumentationPage::sourceDirectory()); } - public function test_source_directories_can_be_changed_in_config() + public function testSourceDirectoriesCanBeChangedInConfig() { config(['hyde.source_directories' => [ HtmlPage::class => '.source/pages', @@ -60,7 +60,7 @@ public function test_source_directories_can_be_changed_in_config() $this->assertEquals('.source/docs', DocumentationPage::sourceDirectory()); } - public function test_build_service_recognizes_changed_directory() + public function testBuildServiceRecognizesChangedDirectory() { MarkdownPost::setSourceDirectory('_source/posts'); @@ -70,7 +70,7 @@ public function test_build_service_recognizes_changed_directory() ); } - public function test_autodiscovery_discovers_posts_in_custom_directory() + public function testAutodiscoveryDiscoversPostsInCustomDirectory() { $this->directory('_source'); $this->file('_source/test.md'); @@ -83,7 +83,7 @@ public function test_autodiscovery_discovers_posts_in_custom_directory() ); } - public function test_autodiscovery_discovers_posts_in_custom_subdirectory() + public function testAutodiscoveryDiscoversPostsInCustomSubdirectory() { $this->directory('_source/posts'); $this->file('_source/posts/test.md'); diff --git a/packages/framework/tests/Feature/SourceFileParserTest.php b/packages/framework/tests/Feature/SourceFileParserTest.php index d58408b757d..cf099e08d59 100644 --- a/packages/framework/tests/Feature/SourceFileParserTest.php +++ b/packages/framework/tests/Feature/SourceFileParserTest.php @@ -17,7 +17,7 @@ */ class SourceFileParserTest extends TestCase { - public function test_blade_page_parser() + public function testBladePageParser() { $this->file('_pages/foo.blade.php'); @@ -27,7 +27,7 @@ public function test_blade_page_parser() $this->assertEquals('foo', $page->identifier); } - public function test_markdown_page_parser() + public function testMarkdownPageParser() { $this->markdown('_pages/foo.md', '# Foo Bar', ['title' => 'Foo Bar Baz']); @@ -39,7 +39,7 @@ public function test_markdown_page_parser() $this->assertEquals('Foo Bar Baz', $page->title); } - public function test_markdown_post_parser() + public function testMarkdownPostParser() { $this->markdown('_posts/foo.md', '# Foo Bar', ['title' => 'Foo Bar Baz']); @@ -51,7 +51,7 @@ public function test_markdown_post_parser() $this->assertEquals('Foo Bar Baz', $page->title); } - public function test_documentation_page_parser() + public function testDocumentationPageParser() { $this->markdown('_docs/foo.md', '# Foo Bar', ['title' => 'Foo Bar Baz']); @@ -63,7 +63,7 @@ public function test_documentation_page_parser() $this->assertEquals('Foo Bar Baz', $page->title); } - public function test_html_page_parser() + public function testHtmlPageParser() { $this->file('_pages/foo.html', '

Foo Bar

'); @@ -74,21 +74,21 @@ public function test_html_page_parser() $this->assertEquals('

Foo Bar

', $page->contents()); } - public function test_parsed_page_is_run_through_dynamic_constructor() + public function testParsedPageIsRunThroughDynamicConstructor() { $this->markdown('_pages/foo.md', '# Foo Bar', ['title' => 'Foo Bar Baz']); $page = MarkdownPage::parse('foo'); $this->assertEquals('Foo Bar Baz', $page->title); } - public function test_blade_page_data_is_parsed_to_front_matter() + public function testBladePageDataIsParsedToFrontMatter() { $this->file('_pages/foo.blade.php', "@php(\$foo = 'bar')\n"); $page = BladePage::parse('foo'); $this->assertEquals('bar', $page->data('foo')); } - public function test_blade_page_matter_is_used_for_the_page_title() + public function testBladePageMatterIsUsedForThePageTitle() { $this->file('_pages/foo.blade.php', "@php(\$title = 'Foo Bar')\n"); $page = BladePage::parse('foo'); diff --git a/packages/framework/tests/Feature/StaticPageBuilderTest.php b/packages/framework/tests/Feature/StaticPageBuilderTest.php index d724259c9e6..65cad39ff83 100644 --- a/packages/framework/tests/Feature/StaticPageBuilderTest.php +++ b/packages/framework/tests/Feature/StaticPageBuilderTest.php @@ -52,7 +52,7 @@ protected function validateBasicHtml(string $html) $this->assertStringContainsString('', $html); } - public function test_can_build_blade_page() + public function testCanBuildBladePage() { file_put_contents(BladePage::sourceDirectory().'/foo.blade.php', 'bar'); @@ -67,7 +67,7 @@ public function test_can_build_blade_page() Filesystem::unlink('_site/foo.html'); } - public function test_can_build_markdown_post() + public function testCanBuildMarkdownPost() { $page = MarkdownPost::make('foo', [ 'title' => 'foo', @@ -80,7 +80,7 @@ public function test_can_build_markdown_post() $this->validateBasicHtml(file_get_contents(Hyde::path('_site/posts/foo.html'))); } - public function test_can_build_markdown_page() + public function testCanBuildMarkdownPage() { $page = MarkdownPage::make('foo', [], '# Body'); @@ -91,7 +91,7 @@ public function test_can_build_markdown_page() Filesystem::unlink('_site/foo.html'); } - public function test_can_build_documentation_page() + public function testCanBuildDocumentationPage() { $page = DocumentationPage::make('foo', [], '# Body'); @@ -101,7 +101,7 @@ public function test_can_build_documentation_page() $this->validateBasicHtml(file_get_contents(Hyde::path('_site/'.'docs/foo.html'))); } - public function test_can_build_html_page() + public function testCanBuildHtmlPage() { $this->file('_pages/foo.html', 'bar'); $page = new HtmlPage('foo'); @@ -113,7 +113,7 @@ public function test_can_build_html_page() Filesystem::unlink('_site/foo.html'); } - public function test_can_build_nested_html_page() + public function testCanBuildNestedHtmlPage() { mkdir(Hyde::path('_pages/foo')); file_put_contents(Hyde::path('_pages/foo/bar.html'), 'baz'); @@ -129,7 +129,7 @@ public function test_can_build_nested_html_page() rmdir(Hyde::path('_pages/foo')); } - public function test_creates_custom_documentation_directory() + public function testCreatesCustomDocumentationDirectory() { $page = DocumentationPage::make('foo'); @@ -143,7 +143,7 @@ public function test_creates_custom_documentation_directory() Filesystem::unlink('_site/docs/foo/foo.html'); } - public function test_site_directory_can_be_customized() + public function testSiteDirectoryCanBeCustomized() { Hyde::setOutputDirectory('foo'); @@ -155,7 +155,7 @@ public function test_site_directory_can_be_customized() File::deleteDirectory(Hyde::path('foo')); } - public function test_site_directory_can_be_customized_with_nested_pages() + public function testSiteDirectoryCanBeCustomizedWithNestedPages() { Hyde::setOutputDirectory('foo'); @@ -167,7 +167,7 @@ public function test_site_directory_can_be_customized_with_nested_pages() File::deleteDirectory(Hyde::path('foo')); } - public function test_can_rebuild_blade_page() + public function testCanRebuildBladePage() { $this->file('_pages/foo.blade.php'); StaticPageBuilder::handle(Pages::getPage('_pages/foo.blade.php')); @@ -176,7 +176,7 @@ public function test_can_rebuild_blade_page() unlink(Hyde::path('_site/foo.html')); } - public function test_can_rebuild_markdown_page() + public function testCanRebuildMarkdownPage() { $this->file('_pages/foo.md'); StaticPageBuilder::handle(Pages::getPage('_pages/foo.md')); @@ -185,7 +185,7 @@ public function test_can_rebuild_markdown_page() unlink(Hyde::path('_site/foo.html')); } - public function test_can_rebuild_markdown_post() + public function testCanRebuildMarkdownPost() { $this->file('_posts/foo.md'); StaticPageBuilder::handle(Pages::getPage('_posts/foo.md')); @@ -194,7 +194,7 @@ public function test_can_rebuild_markdown_post() unlink(Hyde::path('_site/posts/foo.html')); } - public function test_can_rebuild_documentation_page() + public function testCanRebuildDocumentationPage() { $this->file('_pages/foo.md'); StaticPageBuilder::handle(Pages::getPage('_pages/foo.md')); diff --git a/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php b/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php index 9907fc70c05..807059a5688 100644 --- a/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php +++ b/packages/framework/tests/Feature/StaticSiteBuilderDocumentationModuleTest.php @@ -42,7 +42,7 @@ protected function inspectHtml(array $expectedStrings, string $path = null) } } - public function test_can_create_page() + public function testCanCreatePage() { StaticPageBuilder::handle($this->page); @@ -51,7 +51,7 @@ public function test_can_create_page() unlink(Hyde::path('_site/docs/test-page.html')); } - public function test_page_contains_expected_content() + public function testPageContainsExpectedContent() { $this->inspectHtml([ 'Adventures in Wonderland', @@ -60,7 +60,7 @@ public function test_page_contains_expected_content() ]); } - public function test_can_compile_page_to_root_output_directory() + public function testCanCompilePageToRootOutputDirectory() { DocumentationPage::setOutputDirectory(''); diff --git a/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php b/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php index 4bc2c89957d..b94742e9d5a 100644 --- a/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php +++ b/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php @@ -55,14 +55,14 @@ protected function inspectHtml(array $expectedStrings) } } - public function test_can_create_post() + public function testCanCreatePost() { StaticPageBuilder::handle($this->post); $this->assertFileExists(Hyde::path('_site/posts/test-post.html')); } - public function test_post_contains_expected_content() + public function testPostContainsExpectedContent() { $this->inspectHtml([ 'Adventures in Wonderland', @@ -74,7 +74,7 @@ public function test_post_contains_expected_content() ]); } - public function test_post_contains_expected_elements() + public function testPostContainsExpectedElements() { $this->inspectHtml([ '', @@ -91,7 +91,7 @@ public function test_post_contains_expected_elements() ]); } - public function test_post_contains_expected_meta_tags() + public function testPostContainsExpectedMetaTags() { $this->inspectHtml([ '', @@ -103,7 +103,7 @@ public function test_post_contains_expected_meta_tags() ]); } - public function test_post_contains_expected_itemprops() + public function testPostContainsExpectedItemprops() { $this->inspectHtml([ 'itemtype="https://schema.org/Article"', @@ -117,7 +117,7 @@ public function test_post_contains_expected_itemprops() ]); } - public function test_post_contains_expected_aria_support() + public function testPostContainsExpectedAriaSupport() { $this->inspectHtml([ 'role="doc-pageheader"', @@ -126,7 +126,7 @@ public function test_post_contains_expected_aria_support() ]); } - public function test_post_image_is_resolved_relatively() + public function testPostImageIsResolvedRelatively() { $this->inspectHtml([ '', diff --git a/packages/framework/tests/Feature/StaticSiteServiceTest.php b/packages/framework/tests/Feature/StaticSiteServiceTest.php index 165a11ad07b..981eb1f73e4 100644 --- a/packages/framework/tests/Feature/StaticSiteServiceTest.php +++ b/packages/framework/tests/Feature/StaticSiteServiceTest.php @@ -31,7 +31,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_build_command_contains_expected_output() + public function testBuildCommandContainsExpectedOutput() { $this->artisan('build') ->expectsOutputToContain('Building your static site') @@ -40,7 +40,7 @@ public function test_build_command_contains_expected_output() ->assertExitCode(0); } - public function test_build_command_creates_html_files() + public function testBuildCommandCreatesHtmlFiles() { $this->file('_posts/test-post.md'); @@ -51,7 +51,7 @@ public function test_build_command_creates_html_files() $this->assertFileExists(Hyde::path('_site/posts/test-post.html')); } - public function test_build_command_transfers_media_asset_files() + public function testBuildCommandTransfersMediaAssetFiles() { file_put_contents(Hyde::path('_media/test-image.png'), 'foo'); $this->artisan('build'); @@ -60,7 +60,7 @@ public function test_build_command_transfers_media_asset_files() Filesystem::unlink('_site/media/test-image.png'); } - public function test_build_command_transfers_media_asset_files_recursively() + public function testBuildCommandTransfersMediaAssetFilesRecursively() { $this->directory('_media/foo'); @@ -69,7 +69,7 @@ public function test_build_command_transfers_media_asset_files_recursively() $this->assertFileEquals(Hyde::path('_media/foo/img.png'), Hyde::path('_site/media/foo/img.png')); } - public function test_all_page_types_can_be_compiled() + public function testAllPageTypesCanBeCompiled() { $this->file('_pages/html.html'); $this->file('_pages/blade.blade.php'); @@ -98,7 +98,7 @@ public function test_all_page_types_can_be_compiled() Filesystem::unlink('_site/docs/docs.html'); } - public function test_only_progress_bars_for_types_with_pages_are_shown() + public function testOnlyProgressBarsForTypesWithPagesAreShown() { $this->file('_pages/blade.blade.php'); $this->file('_pages/markdown.md'); @@ -118,14 +118,14 @@ public function test_only_progress_bars_for_types_with_pages_are_shown() Filesystem::unlink('_site/markdown.html'); } - public function test_print_initial_information_allows_api_to_be_disabled() + public function testPrintInitialInformationAllowsApiToBeDisabled() { $this->artisan('build --no-api') ->expectsOutput('Disabling external API calls') ->assertExitCode(0); } - public function test_node_action_outputs() + public function testNodeActionOutputs() { $this->artisan('build --run-prettier --run-dev --run-prod') ->expectsOutput('Prettifying code! This may take a second.') @@ -134,14 +134,14 @@ public function test_node_action_outputs() ->assertExitCode(0); } - public function test_pretty_urls_option_output() + public function testPrettyUrlsOptionOutput() { $this->artisan('build --pretty-urls') ->expectsOutput('Generating site with pretty URLs') ->assertExitCode(0); } - public function test_sitemap_is_not_generated_when_conditions_are_not_met() + public function testSitemapIsNotGeneratedWhenConditionsAreNotMet() { config(['hyde.url' => '']); config(['hyde.generate_sitemap' => false]); @@ -151,7 +151,7 @@ public function test_sitemap_is_not_generated_when_conditions_are_not_met() ->assertExitCode(0); } - public function test_sitemap_is_generated_when_conditions_are_met() + public function testSitemapIsGeneratedWhenConditionsAreMet() { config(['hyde.url' => 'https://example.com']); config(['hyde.generate_sitemap' => true]); @@ -162,7 +162,7 @@ public function test_sitemap_is_generated_when_conditions_are_met() Filesystem::unlink('_site/sitemap.xml'); } - public function test_rss_feed_is_not_generated_when_conditions_are_not_met() + public function testRssFeedIsNotGeneratedWhenConditionsAreNotMet() { config(['hyde.url' => '']); config(['hyde.rss.enabled' => false]); @@ -172,7 +172,7 @@ public function test_rss_feed_is_not_generated_when_conditions_are_not_met() ->assertExitCode(0); } - public function test_rss_feed_is_generated_when_conditions_are_met() + public function testRssFeedIsGeneratedWhenConditionsAreMet() { config(['hyde.url' => 'https://example.com']); config(['hyde.rss.enabled' => true]); @@ -187,7 +187,7 @@ public function test_rss_feed_is_generated_when_conditions_are_met() Filesystem::unlink('_site/feed.xml'); } - public function test_does_not_generate_search_files_when_conditions_are_not_met() + public function testDoesNotGenerateSearchFilesWhenConditionsAreNotMet() { $this->artisan('build') ->doesntExpectOutput('Generating search index...') @@ -195,7 +195,7 @@ public function test_does_not_generate_search_files_when_conditions_are_not_met( ->assertExitCode(0); } - public function test_generates_search_files_when_conditions_are_met() + public function testGeneratesSearchFilesWhenConditionsAreMet() { Filesystem::touch('_docs/foo.md'); @@ -207,7 +207,7 @@ public function test_generates_search_files_when_conditions_are_met() Filesystem::unlink('_docs/foo.md'); } - public function test_site_directory_is_emptied_before_build() + public function testSiteDirectoryIsEmptiedBeforeBuild() { Filesystem::touch('_site/foo.html'); $this->artisan('build') @@ -216,7 +216,7 @@ public function test_site_directory_is_emptied_before_build() $this->assertFileDoesNotExist(Hyde::path('_site/foo.html')); } - public function test_output_directory_is_not_emptied_if_disabled_in_config() + public function testOutputDirectoryIsNotEmptiedIfDisabledInConfig() { config(['hyde.empty_output_directory' => false]); Filesystem::touch('_site/keep.html'); @@ -229,7 +229,7 @@ public function test_output_directory_is_not_emptied_if_disabled_in_config() Filesystem::unlink('_site/keep.html'); } - public function test_aborts_when_non_standard_directory_is_emptied() + public function testAbortsWhenNonStandardDirectoryIsEmptied() { Hyde::setOutputDirectory('foo'); @@ -246,14 +246,14 @@ public function test_aborts_when_non_standard_directory_is_emptied() File::deleteDirectory(Hyde::path('foo')); } - public function test_without_warnings() + public function testWithoutWarnings() { $this->artisan('build') ->doesntExpectOutput('There were some warnings during the build process:') ->assertExitCode(0); } - public function test_with_warnings() + public function testWithWarnings() { BuildWarnings::report('This is a warning'); @@ -263,7 +263,7 @@ public function test_with_warnings() ->assertExitCode(0); } - public function test_with_warnings_and_verbose() + public function testWithWarningsAndVerbose() { BuildWarnings::report('This is a warning'); @@ -274,7 +274,7 @@ public function test_with_warnings_and_verbose() ->assertExitCode(0); } - public function test_with_warnings_but_warnings_are_disabled() + public function testWithWarningsButWarningsAreDisabled() { config(['hyde.log_warnings' => false]); BuildWarnings::report('This is a warning'); @@ -284,7 +284,7 @@ public function test_with_warnings_but_warnings_are_disabled() ->assertExitCode(0); } - public function test_with_warnings_converted_to_exceptions() + public function testWithWarningsConvertedToExceptions() { config(['hyde.convert_build_warnings_to_exceptions' => true]); BuildWarnings::report('This is a warning'); diff --git a/packages/framework/tests/Feature/Support/MediaFileTest.php b/packages/framework/tests/Feature/Support/MediaFileTest.php index 9b514b1c31f..a320126f2a5 100644 --- a/packages/framework/tests/Feature/Support/MediaFileTest.php +++ b/packages/framework/tests/Feature/Support/MediaFileTest.php @@ -15,7 +15,7 @@ */ class MediaFileTest extends TestCase { - public function test_can_construct() + public function testCanConstruct() { $file = new MediaFile('foo'); $this->assertInstanceOf(MediaFile::class, $file); @@ -27,41 +27,41 @@ public function can_make() $this->assertEquals(new MediaFile('foo'), MediaFile::make('foo')); } - public function test_can_construct_with_nested_paths() + public function testCanConstructWithNestedPaths() { $this->assertEquals('path/to/file.txt', MediaFile::make('path/to/file.txt')->path); } - public function test_absolute_path_is_normalized_to_relative() + public function testAbsolutePathIsNormalizedToRelative() { $this->assertEquals('foo', MediaFile::make(Hyde::path('foo'))->path); } - public function test_get_name_returns_name_of_file() + public function testGetNameReturnsNameOfFile() { $this->assertSame('foo.txt', MediaFile::make('foo.txt')->getName()); $this->assertSame('bar.txt', MediaFile::make('foo/bar.txt')->getName()); } - public function test_get_path_returns_path_of_file() + public function testGetPathReturnsPathOfFile() { $this->assertSame('foo.txt', MediaFile::make('foo.txt')->getPath()); $this->assertSame('foo/bar.txt', MediaFile::make('foo/bar.txt')->getPath()); } - public function test_get_absolute_path_returns_absolute_path_of_file() + public function testGetAbsolutePathReturnsAbsolutePathOfFile() { $this->assertSame(Hyde::path('foo.txt'), MediaFile::make('foo.txt')->getAbsolutePath()); $this->assertSame(Hyde::path('foo/bar.txt'), MediaFile::make('foo/bar.txt')->getAbsolutePath()); } - public function test_get_contents_returns_contents_of_file() + public function testGetContentsReturnsContentsOfFile() { $this->file('foo.txt', 'foo bar'); $this->assertSame('foo bar', MediaFile::make('foo.txt')->getContents()); } - public function test_get_extension_returns_extension_of_file() + public function testGetExtensionReturnsExtensionOfFile() { $this->file('foo.txt', 'foo'); $this->assertSame('txt', MediaFile::make('foo.txt')->getExtension()); @@ -70,7 +70,7 @@ public function test_get_extension_returns_extension_of_file() $this->assertSame('png', MediaFile::make('foo.png')->getExtension()); } - public function test_to_array_returns_array_of_file_properties() + public function testToArrayReturnsArrayOfFileProperties() { $this->file('foo.txt', 'foo bar'); @@ -82,7 +82,7 @@ public function test_to_array_returns_array_of_file_properties() ], MediaFile::make('foo.txt')->toArray()); } - public function test_to_array_with_empty_file_with_no_extension() + public function testToArrayWithEmptyFileWithNoExtension() { $this->file('foo', 'foo bar'); $this->assertSame([ @@ -93,7 +93,7 @@ public function test_to_array_with_empty_file_with_no_extension() ], MediaFile::make('foo')->toArray()); } - public function test_to_array_with_file_in_subdirectory() + public function testToArrayWithFileInSubdirectory() { mkdir(Hyde::path('foo')); touch(Hyde::path('foo/bar.txt')); @@ -107,19 +107,19 @@ public function test_to_array_with_file_in_subdirectory() rmdir(Hyde::path('foo')); } - public function test_getContentLength() + public function testGetContentLength() { $this->file('foo', 'Hello World!'); $this->assertSame(12, MediaFile::make('foo')->getContentLength()); } - public function test_getContentLength_with_empty_file() + public function testGetContentLengthWithEmptyFile() { $this->file('foo', ''); $this->assertSame(0, MediaFile::make('foo')->getContentLength()); } - public function test_getContentLength_with_directory() + public function testGetContentLengthWithDirectory() { $this->directory('foo'); @@ -128,50 +128,50 @@ public function test_getContentLength_with_directory() MediaFile::make('foo')->getContentLength(); } - public function test_getContentLength_with_non_existent_file() + public function testGetContentLengthWithNonExistentFile() { $this->expectException(FileNotFoundException::class); $this->expectExceptionMessage('File [foo] not found.'); MediaFile::make('foo')->getContentLength(); } - public function test_getMimeType() + public function testGetMimeType() { $this->file('foo.txt', 'Hello World!'); $this->assertSame('text/plain', MediaFile::make('foo.txt')->getMimeType()); } - public function test_getMimeType_without_extension() + public function testGetMimeTypeWithoutExtension() { $this->file('foo', 'Hello World!'); $this->assertSame('text/plain', MediaFile::make('foo')->getMimeType()); } - public function test_getMimeType_with_empty_file() + public function testGetMimeTypeWithEmptyFile() { $this->file('foo', ''); $this->assertSame('application/x-empty', MediaFile::make('foo')->getMimeType()); } - public function test_getMimeType_with_directory() + public function testGetMimeTypeWithDirectory() { $this->directory('foo'); $this->assertSame('directory', MediaFile::make('foo')->getMimeType()); } - public function test_getMimeType_with_non_existent_file() + public function testGetMimeTypeWithNonExistentFile() { $this->assertSame('text/plain', MediaFile::make('foo')->getMimeType()); } - public function test_all_helper_returns_all_media_files() + public function testAllHelperReturnsAllMediaFiles() { $this->assertEquals([ 'app.css' => new MediaFile('_media/app.css'), ], MediaFile::all()); } - public function test_all_helper_does_not_include_non_media_files() + public function testAllHelperDoesNotIncludeNonMediaFiles() { $this->file('_media/foo.blade.php'); $this->assertEquals([ @@ -179,7 +179,7 @@ public function test_all_helper_does_not_include_non_media_files() ], MediaFile::all()); } - public function test_files_helper() + public function testFilesHelper() { $this->assertSame(['app.css'], MediaFile::files()); } diff --git a/packages/framework/tests/Feature/Support/ProjectFileTest.php b/packages/framework/tests/Feature/Support/ProjectFileTest.php index e1ebb9d8bd5..a33c0b73bc4 100644 --- a/packages/framework/tests/Feature/Support/ProjectFileTest.php +++ b/packages/framework/tests/Feature/Support/ProjectFileTest.php @@ -14,7 +14,7 @@ */ class ProjectFileTest extends TestCase { - public function test_can_construct() + public function testCanConstruct() { $file = new ProjectFileTestClass('foo'); $this->assertInstanceOf(ProjectFileTestClass::class, $file); @@ -26,41 +26,41 @@ public function can_make() $this->assertEquals(new ProjectFileTestClass('foo'), ProjectFileTestClass::make('foo')); } - public function test_can_construct_with_nested_paths() + public function testCanConstructWithNestedPaths() { $this->assertEquals('path/to/file.txt', ProjectFileTestClass::make('path/to/file.txt')->path); } - public function test_absolute_path_is_normalized_to_relative() + public function testAbsolutePathIsNormalizedToRelative() { $this->assertEquals('foo', ProjectFileTestClass::make(Hyde::path('foo'))->path); } - public function test_get_name_returns_name_of_file() + public function testGetNameReturnsNameOfFile() { $this->assertSame('foo.txt', ProjectFileTestClass::make('foo.txt')->getName()); $this->assertSame('bar.txt', ProjectFileTestClass::make('foo/bar.txt')->getName()); } - public function test_get_path_returns_path_of_file() + public function testGetPathReturnsPathOfFile() { $this->assertSame('foo.txt', ProjectFileTestClass::make('foo.txt')->getPath()); $this->assertSame('foo/bar.txt', ProjectFileTestClass::make('foo/bar.txt')->getPath()); } - public function test_get_absolute_path_returns_absolute_path_of_file() + public function testGetAbsolutePathReturnsAbsolutePathOfFile() { $this->assertSame(Hyde::path('foo.txt'), ProjectFileTestClass::make('foo.txt')->getAbsolutePath()); $this->assertSame(Hyde::path('foo/bar.txt'), ProjectFileTestClass::make('foo/bar.txt')->getAbsolutePath()); } - public function test_get_contents_returns_contents_of_file() + public function testGetContentsReturnsContentsOfFile() { $this->file('foo.txt', 'foo bar'); $this->assertSame('foo bar', ProjectFileTestClass::make('foo.txt')->getContents()); } - public function test_get_extension_returns_extension_of_file() + public function testGetExtensionReturnsExtensionOfFile() { $this->file('foo.txt', 'foo'); $this->assertSame('txt', ProjectFileTestClass::make('foo.txt')->getExtension()); @@ -69,7 +69,7 @@ public function test_get_extension_returns_extension_of_file() $this->assertSame('png', ProjectFileTestClass::make('foo.png')->getExtension()); } - public function test_to_array_returns_array_of_file_properties() + public function testToArrayReturnsArrayOfFileProperties() { $this->file('foo.txt', 'foo bar'); @@ -79,7 +79,7 @@ public function test_to_array_returns_array_of_file_properties() ], ProjectFileTestClass::make('foo.txt')->toArray()); } - public function test_to_array_with_empty_file_with_no_extension() + public function testToArrayWithEmptyFileWithNoExtension() { $this->file('foo'); $this->assertSame([ @@ -88,7 +88,7 @@ public function test_to_array_with_empty_file_with_no_extension() ], ProjectFileTestClass::make('foo')->toArray()); } - public function test_to_array_with_file_in_subdirectory() + public function testToArrayWithFileInSubdirectory() { mkdir(Hyde::path('foo')); touch(Hyde::path('foo/bar.txt')); diff --git a/packages/framework/tests/Feature/Support/SourceFileTest.php b/packages/framework/tests/Feature/Support/SourceFileTest.php index 2b85f6e6809..62dde1f56a9 100644 --- a/packages/framework/tests/Feature/Support/SourceFileTest.php +++ b/packages/framework/tests/Feature/Support/SourceFileTest.php @@ -16,7 +16,7 @@ */ class SourceFileTest extends TestCase { - public function test_can_construct() + public function testCanConstruct() { $file = new SourceFile('foo'); $this->assertInstanceOf(SourceFile::class, $file); @@ -25,7 +25,7 @@ public function test_can_construct() $this->assertSame(HydePage::class, $file->pageClass); } - public function test_can_construct_with_model_class() + public function testCanConstructWithModelClass() { $file = new SourceFile('foo', MarkdownPage::class); $this->assertInstanceOf(SourceFile::class, $file); @@ -39,47 +39,47 @@ public function can_make() $this->assertEquals(new SourceFile('foo'), SourceFile::make('foo')); } - public function test_can_make_with_model_class() + public function testCanMakeWithModelClass() { $this->assertEquals(new SourceFile('foo', MarkdownPage::class), SourceFile::make('foo', MarkdownPage::class)); } - public function test_can_construct_with_nested_paths() + public function testCanConstructWithNestedPaths() { $this->assertEquals('path/to/file.txt', SourceFile::make('path/to/file.txt')->path); } - public function test_absolute_path_is_normalized_to_relative() + public function testAbsolutePathIsNormalizedToRelative() { $this->assertEquals('foo', SourceFile::make(Hyde::path('foo'))->path); } - public function test_get_name_returns_name_of_file() + public function testGetNameReturnsNameOfFile() { $this->assertSame('foo.txt', SourceFile::make('foo.txt')->getName()); $this->assertSame('bar.txt', SourceFile::make('foo/bar.txt')->getName()); } - public function test_get_path_returns_path_of_file() + public function testGetPathReturnsPathOfFile() { $this->assertSame('foo.txt', SourceFile::make('foo.txt')->getPath()); $this->assertSame('foo/bar.txt', SourceFile::make('foo/bar.txt')->getPath()); } - public function test_get_absolute_path_returns_absolute_path_of_file() + public function testGetAbsolutePathReturnsAbsolutePathOfFile() { $this->assertSame(Hyde::path('foo.txt'), SourceFile::make('foo.txt')->getAbsolutePath()); $this->assertSame(Hyde::path('foo/bar.txt'), SourceFile::make('foo/bar.txt')->getAbsolutePath()); } - public function test_get_contents_returns_contents_of_file() + public function testGetContentsReturnsContentsOfFile() { $this->file('foo.txt', 'foo bar'); $this->assertSame('foo bar', SourceFile::make('foo.txt')->getContents()); } - public function test_get_extension_returns_extension_of_file() + public function testGetExtensionReturnsExtensionOfFile() { $this->file('foo.txt', 'foo'); $this->assertSame('txt', SourceFile::make('foo.txt')->getExtension()); @@ -88,7 +88,7 @@ public function test_get_extension_returns_extension_of_file() $this->assertSame('png', SourceFile::make('foo.png')->getExtension()); } - public function test_to_array_returns_array_of_file_properties() + public function testToArrayReturnsArrayOfFileProperties() { $this->file('foo.txt', 'foo bar'); @@ -99,7 +99,7 @@ public function test_to_array_returns_array_of_file_properties() ], SourceFile::make('foo.txt')->toArray()); } - public function test_to_array_with_empty_file_with_no_extension() + public function testToArrayWithEmptyFileWithNoExtension() { $this->file('foo'); $this->assertSame([ @@ -109,7 +109,7 @@ public function test_to_array_with_empty_file_with_no_extension() ], SourceFile::make('foo')->toArray()); } - public function test_to_array_with_file_in_subdirectory() + public function testToArrayWithFileInSubdirectory() { mkdir(Hyde::path('foo')); touch(Hyde::path('foo/bar.txt')); diff --git a/packages/framework/tests/Unit/BaseFoundationCollectionTest.php b/packages/framework/tests/Unit/BaseFoundationCollectionTest.php index 2156d74e20e..9fb8edb7d5e 100644 --- a/packages/framework/tests/Unit/BaseFoundationCollectionTest.php +++ b/packages/framework/tests/Unit/BaseFoundationCollectionTest.php @@ -15,7 +15,7 @@ */ class BaseFoundationCollectionTest extends UnitTestCase { - public function test_init() + public function testInit() { $this->needsKernel(); @@ -28,19 +28,19 @@ public function test_init() $this->assertTrue($booted->isDiscovered()); } - public function test_exceptions_are_caught_and_rethrown_as_runtime_exceptions() + public function testExceptionsAreCaughtAndRethrownAsRuntimeExceptions() { $this->expectException(RuntimeException::class); ThrowingBaseFoundationCollectionTestClass::init(HydeKernel::getInstance())->boot(); } - public function test_exceptions_are_caught_and_rethrown_with_helpful_information() + public function testExceptionsAreCaughtAndRethrownWithHelpfulInformation() { $this->expectException(RuntimeException::class); ThrowingBaseFoundationCollectionTestClass::init(HydeKernel::getInstance())->boot(); } - public function test_can_get_previous_exception() + public function testCanGetPreviousException() { try { ThrowingBaseFoundationCollectionTestClass::init(HydeKernel::getInstance())->boot(); diff --git a/packages/framework/tests/Unit/BlogPostFrontMatterIsOptionalTest.php b/packages/framework/tests/Unit/BlogPostFrontMatterIsOptionalTest.php index 2b2366fee13..b90fe0a0c19 100644 --- a/packages/framework/tests/Unit/BlogPostFrontMatterIsOptionalTest.php +++ b/packages/framework/tests/Unit/BlogPostFrontMatterIsOptionalTest.php @@ -13,7 +13,7 @@ class BlogPostFrontMatterIsOptionalTest extends TestCase { - public function test_blog_post_can_be_created_without_front_matter() + public function testBlogPostCanBeCreatedWithoutFrontMatter() { file_put_contents(Hyde::path('_posts/test-post.md'), '# My New Post'); @@ -25,7 +25,7 @@ public function test_blog_post_can_be_created_without_front_matter() Filesystem::unlink('_site/posts/test-post.html'); } - public function test_blog_post_feed_can_be_rendered_when_post_has_no_front_matter() + public function testBlogPostFeedCanBeRenderedWhenPostHasNoFrontMatter() { file_put_contents(Hyde::path('_posts/test-post.md'), '# My New Post'); diff --git a/packages/framework/tests/Unit/BuildOutputDirectoryCanBeChangedTest.php b/packages/framework/tests/Unit/BuildOutputDirectoryCanBeChangedTest.php index 1cf82bb064f..6bd0380a70f 100644 --- a/packages/framework/tests/Unit/BuildOutputDirectoryCanBeChangedTest.php +++ b/packages/framework/tests/Unit/BuildOutputDirectoryCanBeChangedTest.php @@ -16,7 +16,7 @@ */ class BuildOutputDirectoryCanBeChangedTest extends TestCase { - public function test_site_output_directory_can_be_changed_for_site_builds() + public function testSiteOutputDirectoryCanBeChangedForSiteBuilds() { $this->file('_posts/test-post.md'); @@ -32,7 +32,7 @@ public function test_site_output_directory_can_be_changed_for_site_builds() File::deleteDirectory(Hyde::path('_site/build')); } - public function test_site_output_directory_can_be_changed_in_static_page_builder() + public function testSiteOutputDirectoryCanBeChangedInStaticPageBuilder() { $this->file('_posts/test-post.md'); @@ -45,7 +45,7 @@ public function test_site_output_directory_can_be_changed_in_static_page_builder File::deleteDirectory(Hyde::path('_site/build')); } - public function test_output_directory_is_created_if_it_does_not_exist_in_static_page_builder() + public function testOutputDirectoryIsCreatedIfItDoesNotExistInStaticPageBuilder() { $this->file('_posts/test-post.md'); File::deleteDirectory(Hyde::path('_site/build/foo')); @@ -56,7 +56,7 @@ public function test_output_directory_is_created_if_it_does_not_exist_in_static_ File::deleteDirectory(Hyde::path('_site/build/foo')); } - public function test_site_output_directory_can_be_changed_in_configuration() + public function testSiteOutputDirectoryCanBeChangedInConfiguration() { $this->assertEquals('_site', Hyde::kernel()->getOutputDirectory()); @@ -72,7 +72,7 @@ public function test_site_output_directory_can_be_changed_in_configuration() File::deleteDirectory(Hyde::path('_site/build')); } - public function test_site_output_directory_path_is_normalized_to_trim_trailing_slashes() + public function testSiteOutputDirectoryPathIsNormalizedToTrimTrailingSlashes() { Hyde::setOutputDirectory('foo/bar/'); $this->assertEquals('foo/bar', Hyde::kernel()->getOutputDirectory()); diff --git a/packages/framework/tests/Unit/ConfigFileTest.php b/packages/framework/tests/Unit/ConfigFileTest.php index 4661a36c591..8ea6dda5e80 100644 --- a/packages/framework/tests/Unit/ConfigFileTest.php +++ b/packages/framework/tests/Unit/ConfigFileTest.php @@ -23,22 +23,22 @@ class ConfigFileTest extends UnitTestCase protected static bool $needsKernel = true; protected static bool $needsConfig = true; - public function test_default_output_directory_value_matches_declared_value() + public function testDefaultOutputDirectoryValueMatchesDeclaredValue() { expect($this->getConfig('output_directory'))->toBe(Hyde::getOutputDirectory()); } - public function test_default_media_directory_value_matches_declared_value() + public function testDefaultMediaDirectoryValueMatchesDeclaredValue() { expect($this->getConfig('media_directory'))->toBe(Hyde::getMediaDirectory()); } - public function test_default_source_root_value_matches_declared_value() + public function testDefaultSourceRootValueMatchesDeclaredValue() { expect($this->getConfig('source_root'))->toBe(Hyde::getSourceRoot()); } - public function test_default_source_directories_values_match_declared_values() + public function testDefaultSourceDirectoriesValuesMatchDeclaredValues() { expect($this->getConfig('source_directories'))->toBe([ HtmlPage::class => '_pages', @@ -49,7 +49,7 @@ public function test_default_source_directories_values_match_declared_values() ]); } - public function test_default_source_directories_values_cover_all_core_extension_classes() + public function testDefaultSourceDirectoriesValuesCoverAllCoreExtensionClasses() { expect($this->getConfig('source_directories'))->toBe(collect(HydeCoreExtension::getPageClasses()) ->mapWithKeys(fn ($pageClass) => [$pageClass => $pageClass::sourceDirectory()]) @@ -57,7 +57,7 @@ public function test_default_source_directories_values_cover_all_core_extension_ ); } - public function test_default_output_directories_values_match_declared_values() + public function testDefaultOutputDirectoriesValuesMatchDeclaredValues() { expect($this->getConfig('output_directories'))->toBe([ HtmlPage::class => '', @@ -68,7 +68,7 @@ public function test_default_output_directories_values_match_declared_values() ]); } - public function test_default_output_directories_values_cover_all_core_extension_classes() + public function testDefaultOutputDirectoriesValuesCoverAllCoreExtensionClasses() { expect($this->getConfig('output_directories'))->toBe(collect(HydeCoreExtension::getPageClasses()) ->mapWithKeys(fn ($pageClass) => [$pageClass => $pageClass::outputDirectory()]) @@ -76,7 +76,7 @@ public function test_default_output_directories_values_cover_all_core_extension_ ); } - public function test_default_features_array_matches_default_features() + public function testDefaultFeaturesArrayMatchesDefaultFeatures() { expect($this->getConfig('features')) ->toBe((new ReflectionClass(Features::class))->getMethod('getDefaultOptions')->invoke(null)); diff --git a/packages/framework/tests/Unit/DocumentationPageTest.php b/packages/framework/tests/Unit/DocumentationPageTest.php index 733d96dc177..b725e59477a 100644 --- a/packages/framework/tests/Unit/DocumentationPageTest.php +++ b/packages/framework/tests/Unit/DocumentationPageTest.php @@ -22,19 +22,19 @@ */ class DocumentationPageTest extends TestCase { - public function test_can_generate_table_of_contents() + public function testCanGenerateTableOfContents() { $page = DocumentationPage::make(markdown: '# Foo'); $this->assertIsString($page->getTableOfContents()); } - public function test_can_get_current_page_path() + public function testCanGetCurrentPagePath() { $page = DocumentationPage::make('foo'); $this->assertEquals('docs/foo', $page->getRouteKey()); } - public function test_can_get_current_custom_page_path() + public function testCanGetCurrentCustomPagePath() { config(['hyde.output_directories.documentation-page' => 'documentation/latest/']); (new HydeServiceProvider($this->app))->register(); @@ -43,7 +43,7 @@ public function test_can_get_current_custom_page_path() $this->assertEquals('documentation/latest/foo', $page->getRouteKey()); } - public function test_can_get_current_page_path_when_using_flattened_output_paths() + public function testCanGetCurrentPagePathWhenUsingFlattenedOutputPaths() { Config::set('docs.flattened_output_paths', true); @@ -57,7 +57,7 @@ public function test_can_get_current_page_path_when_using_flattened_output_paths $this->assertEquals('documentation/latest/bar', $page->getRouteKey()); } - public function test_can_get_current_page_path_when_not_using_flattened_output_paths() + public function testCanGetCurrentPagePathWhenNotUsingFlattenedOutputPaths() { Config::set('docs.flattened_output_paths', false); @@ -71,20 +71,20 @@ public function test_can_get_current_page_path_when_not_using_flattened_output_p $this->assertEquals('documentation/latest/foo/bar', $page->getRouteKey()); } - public function test_can_get_online_source_path() + public function testCanGetOnlineSourcePath() { $page = DocumentationPage::make('foo'); $this->assertFalse($page->getOnlineSourcePath()); } - public function test_can_get_online_source_path_with_source_file_location_base() + public function testCanGetOnlineSourcePathWithSourceFileLocationBase() { config(['docs.source_file_location_base' => 'docs.example.com/edit']); $page = DocumentationPage::make('foo'); $this->assertEquals('docs.example.com/edit/foo.md', $page->getOnlineSourcePath()); } - public function test_can_get_online_source_path_with_trailing_slash() + public function testCanGetOnlineSourcePathWithTrailingSlash() { $page = DocumentationPage::make('foo'); @@ -95,19 +95,19 @@ public function test_can_get_online_source_path_with_trailing_slash() $this->assertEquals('edit/foo.md', $page->getOnlineSourcePath()); } - public function test_can_get_documentation_output_path() + public function testCanGetDocumentationOutputPath() { $this->assertEquals('docs', DocumentationPage::outputDirectory()); } - public function test_can_get_documentation_output_path_with_custom_output_directory() + public function testCanGetDocumentationOutputPathWithCustomOutputDirectory() { config(['hyde.output_directories.documentation-page' => 'foo']); (new HydeServiceProvider($this->app))->register(); $this->assertEquals('foo', DocumentationPage::outputDirectory()); } - public function test_can_get_documentation_output_path_with_trailing_slashes() + public function testCanGetDocumentationOutputPathWithTrailingSlashes() { $tests = [ 'foo', @@ -124,7 +124,7 @@ public function test_can_get_documentation_output_path_with_trailing_slashes() } } - public function test_get_source_path_returns_qualified_basename() + public function testGetSourcePathReturnsQualifiedBasename() { $this->assertEquals( DocumentationPage::sourcePath('foo'), @@ -132,7 +132,7 @@ public function test_get_source_path_returns_qualified_basename() ); } - public function test_get_source_path_returns_qualified_basename_for_nested_page() + public function testGetSourcePathReturnsQualifiedBasenameForNestedPage() { $this->assertEquals( DocumentationPage::sourcePath('foo/bar'), @@ -140,12 +140,12 @@ public function test_get_source_path_returns_qualified_basename_for_nested_page( ); } - public function test_home_method_returns_null_when_there_is_no_index_page() + public function testHomeMethodReturnsNullWhenThereIsNoIndexPage() { $this->assertNull(DocumentationPage::home()); } - public function test_home_method_returns_docs_index_route_when_it_exists() + public function testHomeMethodReturnsDocsIndexRouteWhenItExists() { Filesystem::touch('_docs/index.md'); $this->assertInstanceOf(Route::class, DocumentationPage::home()); @@ -153,7 +153,7 @@ public function test_home_method_returns_docs_index_route_when_it_exists() Filesystem::unlink('_docs/index.md'); } - public function test_home_method_finds_docs_index_for_custom_output_directory() + public function testHomeMethodFindsDocsIndexForCustomOutputDirectory() { config(['hyde.output_directories.documentation-page' => 'foo']); (new HydeServiceProvider($this->app))->register(); @@ -165,7 +165,7 @@ public function test_home_method_finds_docs_index_for_custom_output_directory() File::deleteDirectory(Hyde::path('foo')); } - public function test_home_method_finds_docs_index_for_custom_nested_output_directory() + public function testHomeMethodFindsDocsIndexForCustomNestedOutputDirectory() { config(['hyde.output_directories.documentation-page' => 'foo/bar']); (new HydeServiceProvider($this->app))->register(); @@ -178,12 +178,12 @@ public function test_home_method_finds_docs_index_for_custom_nested_output_direc File::deleteDirectory(Hyde::path('foo')); } - public function test_home_route_name_method_returns_output_directory_slash_index() + public function testHomeRouteNameMethodReturnsOutputDirectorySlashIndex() { $this->assertSame('docs/index', DocumentationPage::homeRouteName()); } - public function test_home_route_name_method_returns_customized_output_directory_slash_index() + public function testHomeRouteNameMethodReturnsCustomizedOutputDirectorySlashIndex() { config(['hyde.output_directories.documentation-page' => 'foo/bar']); (new HydeServiceProvider($this->app))->register(); @@ -191,7 +191,7 @@ public function test_home_route_name_method_returns_customized_output_directory_ $this->assertSame('foo/bar/index', DocumentationPage::homeRouteName()); } - public function test_has_table_of_contents() + public function testHasTableOfContents() { $this->assertIsBool(DocumentationPage::hasTableOfContents()); @@ -202,27 +202,27 @@ public function test_has_table_of_contents() $this->assertFalse(DocumentationPage::hasTableOfContents()); } - public function test_compiled_pages_originating_in_subdirectories_get_output_to_root_docs_path() + public function testCompiledPagesOriginatingInSubdirectoriesGetOutputToRootDocsPath() { $page = DocumentationPage::make('foo/bar'); $this->assertEquals('docs/bar.html', $page->getOutputPath()); } - public function test_compiled_pages_originating_in_subdirectories_get_output_to_root_docs_path_when_using_flattened_output_paths() + public function testCompiledPagesOriginatingInSubdirectoriesGetOutputToRootDocsPathWhenUsingFlattenedOutputPaths() { Config::set('docs.flattened_output_paths', true); $page = DocumentationPage::make('foo/bar'); $this->assertEquals('docs/bar.html', $page->getOutputPath()); } - public function test_compiled_pages_originating_in_subdirectories_retain_subdirectory_structure_when_not_using_flattened_output_paths() + public function testCompiledPagesOriginatingInSubdirectoriesRetainSubdirectoryStructureWhenNotUsingFlattenedOutputPaths() { Config::set('docs.flattened_output_paths', false); $page = DocumentationPage::make('foo/bar'); $this->assertEquals('docs/foo/bar.html', $page->getOutputPath()); } - public function test_page_has_front_matter() + public function testPageHasFrontMatter() { $this->markdown('_docs/foo.md', matter: $expected = [ 'foo' => 'bar', @@ -236,7 +236,7 @@ public function test_page_has_front_matter() $this->assertEquals(new FrontMatter($expected), $page->matter()); } - public function test_page_can_be_hidden_from_sidebar_using_front_matter() + public function testPageCanBeHiddenFromSidebarUsingFrontMatter() { $this->markdown('_docs/foo.md', matter: [ 'navigation' => [ @@ -247,14 +247,14 @@ public function test_page_can_be_hidden_from_sidebar_using_front_matter() $this->assertFalse($page->showInNavigation()); } - public function test_page_is_visible_in_sidebar_without_using_front_matter() + public function testPageIsVisibleInSidebarWithoutUsingFrontMatter() { $this->markdown('_docs/foo.md'); $page = DocumentationPage::parse('foo'); $this->assertTrue($page->showInNavigation()); } - public function test_page_can_set_sidebar_priority_using_front_matter() + public function testPageCanSetSidebarPriorityUsingFrontMatter() { $this->file('_docs/foo.md', '--- navigation: @@ -265,7 +265,7 @@ public function test_page_can_set_sidebar_priority_using_front_matter() $this->assertEquals(10, $page->navigationMenuPriority()); } - public function test_page_can_set_sidebar_label_using_front_matter() + public function testPageCanSetSidebarLabelUsingFrontMatter() { $this->file('_docs/foo.md', '--- navigation: diff --git a/packages/framework/tests/Unit/ExtensionsUnitTest.php b/packages/framework/tests/Unit/ExtensionsUnitTest.php index 3eb2b92e193..60b7653dcf5 100644 --- a/packages/framework/tests/Unit/ExtensionsUnitTest.php +++ b/packages/framework/tests/Unit/ExtensionsUnitTest.php @@ -189,12 +189,12 @@ public function testRouteHandlerDependencyInjection() RouteCollection::init($this->kernel)->boot(); } - public function test_get_registered_page_classes_returns_core_extension_classes() + public function testGetRegisteredPageClassesReturnsCoreExtensionClasses() { $this->assertSame(HydeCoreExtension::getPageClasses(), $this->kernel->getRegisteredPageClasses()); } - public function test_get_registered_page_classes_merges_all_extension_classes() + public function testGetRegisteredPageClassesMergesAllExtensionClasses() { $this->kernel->registerExtension(HydeTestExtension::class); @@ -204,7 +204,7 @@ public function test_get_registered_page_classes_merges_all_extension_classes() ); } - public function test_merged_registered_page_classes_array_contents() + public function testMergedRegisteredPageClassesArrayContents() { $this->assertSame([ HtmlPage::class, diff --git a/packages/framework/tests/Unit/Facades/AssetFacadeTest.php b/packages/framework/tests/Unit/Facades/AssetFacadeTest.php index 0dbd09e7ef8..df8344a3771 100644 --- a/packages/framework/tests/Unit/Facades/AssetFacadeTest.php +++ b/packages/framework/tests/Unit/Facades/AssetFacadeTest.php @@ -13,17 +13,17 @@ */ class AssetFacadeTest extends TestCase { - public function test_asset_facade_returns_the_asset_service() + public function testAssetFacadeReturnsTheAssetService() { $this->assertInstanceOf(AssetService::class, Asset::getFacadeRoot()); } - public function test_facade_returns_same_instance_as_bound_by_the_container() + public function testFacadeReturnsSameInstanceAsBoundByTheContainer() { $this->assertSame(Asset::getFacadeRoot(), app(AssetService::class)); } - public function test_asset_facade_can_call_methods_on_the_asset_service() + public function testAssetFacadeCanCallMethodsOnTheAssetService() { $service = new AssetService(); $this->assertEquals($service->version(), Asset::version()); diff --git a/packages/framework/tests/Unit/Facades/HydeFacadesAreAliasedInAppConfigTest.php b/packages/framework/tests/Unit/Facades/HydeFacadesAreAliasedInAppConfigTest.php index 0aab7438c86..132e7bda662 100644 --- a/packages/framework/tests/Unit/Facades/HydeFacadesAreAliasedInAppConfigTest.php +++ b/packages/framework/tests/Unit/Facades/HydeFacadesAreAliasedInAppConfigTest.php @@ -9,7 +9,7 @@ class HydeFacadesAreAliasedInAppConfigTest extends TestCase { - public function test_all_facades_are_aliased_in_app_config() + public function testAllFacadesAreAliasedInAppConfig() { $this->assertArrayHasKey('Hyde', config('app.aliases')); diff --git a/packages/framework/tests/Unit/FileConflictExceptionTest.php b/packages/framework/tests/Unit/FileConflictExceptionTest.php index 50f6ce988d0..13116df22ff 100644 --- a/packages/framework/tests/Unit/FileConflictExceptionTest.php +++ b/packages/framework/tests/Unit/FileConflictExceptionTest.php @@ -13,35 +13,35 @@ */ class FileConflictExceptionTest extends UnitTestCase { - public function test_it_can_be_instantiated() + public function testItCanBeInstantiated() { $this->assertInstanceOf(FileConflictException::class, new FileConflictException()); } - public function test_it_can_be_thrown() + public function testItCanBeThrown() { $this->expectException(FileConflictException::class); throw new FileConflictException(); } - public function test_exception_code() + public function testExceptionCode() { $this->assertSame(409, (new FileConflictException())->getCode()); } - public function test_exception_message() + public function testExceptionMessage() { $this->assertSame('A file already exists at this path.', (new FileConflictException())->getMessage()); } - public function test_exception_message_with_path() + public function testExceptionMessageWithPath() { HydeKernel::setInstance(new HydeKernel('my-base-path')); $this->assertSame('File [path/to/file] already exists.', (new FileConflictException('path/to/file'))->getMessage()); } - public function test_exception_message_with_absolute_path() + public function testExceptionMessageWithAbsolutePath() { HydeKernel::setInstance(new HydeKernel('my-base-path')); $this->assertSame('File [path/to/file] already exists.', (new FileConflictException('my-base-path/path/to/file'))->getMessage()); diff --git a/packages/framework/tests/Unit/Foundation/HyperlinkFormatHtmlPathTest.php b/packages/framework/tests/Unit/Foundation/HyperlinkFormatHtmlPathTest.php index 902d9dc5e70..2c4ad10058a 100644 --- a/packages/framework/tests/Unit/Foundation/HyperlinkFormatHtmlPathTest.php +++ b/packages/framework/tests/Unit/Foundation/HyperlinkFormatHtmlPathTest.php @@ -18,87 +18,87 @@ public static function setUpBeforeClass(): void self::mockConfig(); } - public function test_helper_returns_string_as_is_if_pretty_urls_is_not_true() + public function testHelperReturnsStringAsIsIfPrettyUrlsIsNotTrue() { self::mockConfig(['hyde.pretty_urls' => false]); $this->assertEquals('foo/bar.html', Hyde::formatLink('foo/bar.html')); } - public function test_helper_returns_pretty_url_if_pretty_urls_is_true() + public function testHelperReturnsPrettyUrlIfPrettyUrlsIsTrue() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('foo/bar', Hyde::formatLink('foo/bar.html')); } - public function test_helper_respects_absolute_urls() + public function testHelperRespectsAbsoluteUrls() { self::mockConfig(['hyde.pretty_urls' => false]); $this->assertEquals('/foo/bar.html', Hyde::formatLink('/foo/bar.html')); } - public function test_helper_respects_pretty_absolute_urls() + public function testHelperRespectsPrettyAbsoluteUrls() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('/foo/bar', Hyde::formatLink('/foo/bar.html')); } - public function test_helper_respects_relative_urls() + public function testHelperRespectsRelativeUrls() { self::mockConfig(['hyde.pretty_urls' => false]); $this->assertEquals('../foo/bar.html', Hyde::formatLink('../foo/bar.html')); } - public function test_helper_respects_pretty_relative_urls() + public function testHelperRespectsPrettyRelativeUrls() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('../foo/bar', Hyde::formatLink('../foo/bar.html')); } - public function test_non_html_links_are_not_modified() + public function testNonHtmlLinksAreNotModified() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('/foo/bar.jpg', Hyde::formatLink('/foo/bar.jpg')); } - public function test_helper_respects_absolute_urls_with_pretty_urls_enabled() + public function testHelperRespectsAbsoluteUrlsWithPrettyUrlsEnabled() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('/foo/bar.jpg', Hyde::formatLink('/foo/bar.jpg')); } - public function test_helper_rewrites_index_when_using_pretty_urls() + public function testHelperRewritesIndexWhenUsingPrettyUrls() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('/', Hyde::formatLink('index.html')); } - public function test_helper_does_not_rewrite_index_when_not_using_pretty_urls() + public function testHelperDoesNotRewriteIndexWhenNotUsingPrettyUrls() { self::mockConfig(['hyde.pretty_urls' => false]); $this->assertEquals('index.html', Hyde::formatLink('index.html')); } - public function test_helper_rewrites_documentation_page_index_when_using_pretty_urls() + public function testHelperRewritesDocumentationPageIndexWhenUsingPrettyUrls() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('docs/', Hyde::formatLink('docs/index.html')); } - public function test_helper_does_not_rewrite_documentation_page_index_when_not_using_pretty_urls() + public function testHelperDoesNotRewriteDocumentationPageIndexWhenNotUsingPrettyUrls() { self::mockConfig(['hyde.pretty_urls' => false]); $this->assertEquals('docs/index.html', Hyde::formatLink('docs/index.html')); } - public function test_helpers_rewrites_arbitrary_nested_index_pages_when_using_pretty_urls() + public function testHelpersRewritesArbitraryNestedIndexPagesWhenUsingPrettyUrls() { self::mockConfig(['hyde.pretty_urls' => true]); $this->assertEquals('foo/bar/', Hyde::formatLink('foo/bar/index.html')); } - public function test_helpers_does_not_rewrite_arbitrary_nested_index_pages_when_not_using_pretty_urls() + public function testHelpersDoesNotRewriteArbitraryNestedIndexPagesWhenNotUsingPrettyUrls() { self::mockConfig(['hyde.pretty_urls' => false]); $this->assertEquals('foo/bar/index.html', Hyde::formatLink('foo/bar/index.html')); diff --git a/packages/framework/tests/Unit/Foundation/HyperlinksUrlPathHelpersTest.php b/packages/framework/tests/Unit/Foundation/HyperlinksUrlPathHelpersTest.php index 8a400d7a78b..8da1536405d 100644 --- a/packages/framework/tests/Unit/Foundation/HyperlinksUrlPathHelpersTest.php +++ b/packages/framework/tests/Unit/Foundation/HyperlinksUrlPathHelpersTest.php @@ -24,43 +24,43 @@ protected function setUp(): void $this->class = new Hyperlinks(HydeKernel::getInstance()); } - public function test_has_site_url_returns_false_when_no_site_url_is_set() + public function testHasSiteUrlReturnsFalseWhenNoSiteUrlIsSet() { config(['hyde.url' => null]); $this->assertFalse($this->class->hasSiteUrl()); } - public function test_has_site_url_returns_true_when_site_url_is_set() + public function testHasSiteUrlReturnsTrueWhenSiteUrlIsSet() { config(['hyde.url' => 'https://example.com']); $this->assertTrue($this->class->hasSiteUrl()); } - public function test_qualified_url_returns_site_url_when_no_path_is_given() + public function testQualifiedUrlReturnsSiteUrlWhenNoPathIsGiven() { config(['hyde.url' => 'https://example.com']); $this->assertEquals('https://example.com', $this->class->url()); } - public function test_qualified_url_returns_site_url_plus_given_path() + public function testQualifiedUrlReturnsSiteUrlPlusGivenPath() { config(['hyde.url' => 'https://example.com']); $this->assertEquals('https://example.com/path', $this->class->url('path')); } - public function test_qualified_url_returns_site_url_plus_given_path_with_extension() + public function testQualifiedUrlReturnsSiteUrlPlusGivenPathWithExtension() { config(['hyde.url' => 'https://example.com']); $this->assertEquals('https://example.com/path.html', $this->class->url('path.html')); } - public function test_qualified_url_returns_site_url_plus_given_path_with_extension_and_query_string() + public function testQualifiedUrlReturnsSiteUrlPlusGivenPathWithExtensionAndQueryString() { config(['hyde.url' => 'https://example.com']); $this->assertEquals('https://example.com/path.html?query=string', $this->class->url('path.html?query=string')); } - public function test_qualified_url_trims_trailing_slashes() + public function testQualifiedUrlTrimsTrailingSlashes() { config(['hyde.url' => 'https://example.com/']); $this->assertEquals('https://example.com', $this->class->url()); @@ -68,13 +68,13 @@ public function test_qualified_url_trims_trailing_slashes() $this->assertEquals('https://example.com/foo', $this->class->url('/foo/')); } - public function test_qualified_url_accepts_multiple_schemes() + public function testQualifiedUrlAcceptsMultipleSchemes() { config(['hyde.url' => 'http://example.com']); $this->assertEquals('http://example.com', $this->class->url()); } - public function test_qualified_url_throws_exception_when_no_site_url_is_set() + public function testQualifiedUrlThrowsExceptionWhenNoSiteUrlIsSet() { config(['hyde.url' => null]); $this->expectException(BaseUrlNotSetException::class); @@ -82,13 +82,13 @@ public function test_qualified_url_throws_exception_when_no_site_url_is_set() $this->class->url(); } - public function test_helper_returns_expected_string_when_site_url_is_set() + public function testHelperReturnsExpectedStringWhenSiteUrlIsSet() { config(['hyde.url' => 'https://example.com']); $this->assertEquals('https://example.com/foo/bar.html', $this->class->url('foo/bar.html')); } - public function test_helper_returns_expected_string_when_pretty_urls_are_enabled() + public function testHelperReturnsExpectedStringWhenPrettyUrlsAreEnabled() { config(['hyde.url' => 'https://example.com', 'hyde.pretty_urls' => true]); $this->assertEquals('https://example.com', $this->class->url('index.html')); diff --git a/packages/framework/tests/Unit/GenerateBuildManifestTest.php b/packages/framework/tests/Unit/GenerateBuildManifestTest.php index 4892244e034..f3ffc9fd849 100644 --- a/packages/framework/tests/Unit/GenerateBuildManifestTest.php +++ b/packages/framework/tests/Unit/GenerateBuildManifestTest.php @@ -21,7 +21,7 @@ public static function setUpBeforeClass(): void self::mockConfig(); } - public function test_action_generates_build_manifest() + public function testActionGeneratesBuildManifest() { (new GenerateBuildManifest())->handle(); diff --git a/packages/framework/tests/Unit/GetLatestMarkdownPostsTest.php b/packages/framework/tests/Unit/GetLatestMarkdownPostsTest.php index 7511e342989..5cbfb808f7c 100644 --- a/packages/framework/tests/Unit/GetLatestMarkdownPostsTest.php +++ b/packages/framework/tests/Unit/GetLatestMarkdownPostsTest.php @@ -15,7 +15,7 @@ */ class GetLatestMarkdownPostsTest extends TestCase { - public function test_markdown_page_get_latest_helper_returns_sorted_markdown_page_collection() + public function testMarkdownPageGetLatestHelperReturnsSortedMarkdownPageCollection() { file_put_contents(Hyde::path('_posts/new.md'), "---\ndate: '2022-01-01 12:00'\n---\n"); file_put_contents(Hyde::path('_posts/old.md'), "---\ndate: '2021-01-01 12:00'\n---\n"); diff --git a/packages/framework/tests/Unit/HydeBasePathCanBeChangedTest.php b/packages/framework/tests/Unit/HydeBasePathCanBeChangedTest.php index 3eff9f91dd1..9e40d9ff1da 100644 --- a/packages/framework/tests/Unit/HydeBasePathCanBeChangedTest.php +++ b/packages/framework/tests/Unit/HydeBasePathCanBeChangedTest.php @@ -34,7 +34,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_hyde_base_path_can_be_changed() + public function testHydeBasePathCanBeChanged() { Hyde::setBasePath('/foo/bar'); $this->assertEquals('/foo/bar', Hyde::getBasePath()); diff --git a/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php b/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php index a056cefe5f2..ff906d2c717 100644 --- a/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php +++ b/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php @@ -23,7 +23,7 @@ protected function setUp(): void } } - public function test_hyde_config_files_are_matching() + public function testHydeConfigFilesAreMatching() { $this->assertFileEqualsIgnoringNewlineType( Hyde::path('config/hyde.php'), @@ -31,7 +31,7 @@ public function test_hyde_config_files_are_matching() ); } - public function test_docs_config_files_are_matching() + public function testDocsConfigFilesAreMatching() { $this->assertFileEqualsIgnoringNewlineType( Hyde::path('config/docs.php'), @@ -39,7 +39,7 @@ public function test_docs_config_files_are_matching() ); } - public function test_markdown_config_files_are_matching() + public function testMarkdownConfigFilesAreMatching() { $this->assertFileEqualsIgnoringNewlineType( Hyde::path('config/markdown.php'), diff --git a/packages/framework/tests/Unit/HydeFileHelpersTest.php b/packages/framework/tests/Unit/HydeFileHelpersTest.php index b451d58c3e9..b5838e93b87 100644 --- a/packages/framework/tests/Unit/HydeFileHelpersTest.php +++ b/packages/framework/tests/Unit/HydeFileHelpersTest.php @@ -14,24 +14,24 @@ */ class HydeFileHelpersTest extends TestCase { - public function test_current_page_returns_current_page_view_property() + public function testCurrentPageReturnsCurrentPageViewProperty() { Render::share('routeKey', 'foo'); $this->assertEquals('foo', Hyde::currentRouteKey()); } - public function test_current_page_falls_back_to_empty_string_if_current_page_view_property_is_not_set() + public function testCurrentPageFallsBackToEmptyStringIfCurrentPageViewPropertyIsNotSet() { $this->assertEquals('', Hyde::currentRouteKey()); } - public function test_current_route_returns_current_route_view_property() + public function testCurrentRouteReturnsCurrentRouteViewProperty() { Render::share('route', Routes::get('index')); $this->assertEquals(Routes::get('index'), Hyde::currentRoute()); } - public function test_current_route_falls_back_to_null_if_current_route_view_property_is_not_set() + public function testCurrentRouteFallsBackToNullIfCurrentRouteViewPropertyIsNotSet() { $this->assertNull(Hyde::currentRoute()); } diff --git a/packages/framework/tests/Unit/HydeGetBasePathHasFallbackTest.php b/packages/framework/tests/Unit/HydeGetBasePathHasFallbackTest.php index cdb7eb66daf..dab5596d1d5 100644 --- a/packages/framework/tests/Unit/HydeGetBasePathHasFallbackTest.php +++ b/packages/framework/tests/Unit/HydeGetBasePathHasFallbackTest.php @@ -14,7 +14,7 @@ */ class HydeGetBasePathHasFallbackTest extends TestCase { - public function test_hyde_get_base_path_falls_back_to_getcwd() + public function testHydeGetBasePathFallsBackToGetcwd() { $mock = new class extends Hyde { diff --git a/packages/framework/tests/Unit/HydeHelperFacadeTest.php b/packages/framework/tests/Unit/HydeHelperFacadeTest.php index e8ca9eb8843..d4780b1f412 100644 --- a/packages/framework/tests/Unit/HydeHelperFacadeTest.php +++ b/packages/framework/tests/Unit/HydeHelperFacadeTest.php @@ -13,7 +13,7 @@ */ class HydeHelperFacadeTest extends TestCase { - public function test_features_facade_returns_instance_of_features_class() + public function testFeaturesFacadeReturnsInstanceOfFeaturesClass() { $this->assertInstanceOf( Features::class, @@ -21,14 +21,14 @@ public function test_features_facade_returns_instance_of_features_class() ); } - public function test_features_facade_can_be_used_to_call_static_methods_on_features_class() + public function testFeaturesFacadeCanBeUsedToCallStaticMethodsOnFeaturesClass() { $this->assertTrue( Hyde::features()->hasMarkdownPosts() ); } - public function test_hyde_has_feature_shorthand_calls_static_method_on_features_class() + public function testHydeHasFeatureShorthandCallsStaticMethodOnFeaturesClass() { $this->assertTrue( Hyde::hasFeature('markdown-posts') diff --git a/packages/framework/tests/Unit/HydeVendorPathHelperTest.php b/packages/framework/tests/Unit/HydeVendorPathHelperTest.php index 49628d4c4c0..21959d721a6 100644 --- a/packages/framework/tests/Unit/HydeVendorPathHelperTest.php +++ b/packages/framework/tests/Unit/HydeVendorPathHelperTest.php @@ -10,29 +10,29 @@ class HydeVendorPathHelperTest extends TestCase { - public function test_method_exists() + public function testMethodExists() { $this->assertTrue(method_exists(HydeKernel::class, 'vendorPath')); } - public function test_method_returns_string() + public function testMethodReturnsString() { $this->assertIsString(Hyde::vendorPath()); } - public function test_method_returns_string_containing_vendor_path() + public function testMethodReturnsStringContainingVendorPath() { $this->assertStringContainsString('vendor', Hyde::vendorPath()); } - public function test_method_returns_path_to_the_vendor_directory() + public function testMethodReturnsPathToTheVendorDirectory() { $this->assertDirectoryExists(Hyde::vendorPath()); $this->assertFileExists(Hyde::vendorPath().'/composer.json'); $this->assertStringContainsString('"name": "hyde/framework",', file_get_contents(Hyde::vendorPath().'/composer.json')); } - public function test_can_specify_which_hyde_package_to_use() + public function testCanSpecifyWhichHydePackageToUse() { $this->assertDirectoryExists(Hyde::vendorPath(package: 'realtime-compiler')); $this->assertFileExists(Hyde::vendorPath('composer.json', 'realtime-compiler')); diff --git a/packages/framework/tests/Unit/InteractsWithDirectoriesConcernTest.php b/packages/framework/tests/Unit/InteractsWithDirectoriesConcernTest.php index 7832e01f667..e8210d71776 100644 --- a/packages/framework/tests/Unit/InteractsWithDirectoriesConcernTest.php +++ b/packages/framework/tests/Unit/InteractsWithDirectoriesConcernTest.php @@ -32,7 +32,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_methods_can_be_called_statically() + public function testMethodsCanBeCalledStatically() { static::needsDirectory('foo'); $this->assertDirectoryExists(Hyde::path('foo')); @@ -41,32 +41,32 @@ public function test_methods_can_be_called_statically() $this->assertDirectoryExists(Hyde::path('foo')); } - public function test_needs_directory_creates_the_directory() + public function testNeedsDirectoryCreatesTheDirectory() { $this->needsDirectory('foo'); $this->assertDirectoryExists(Hyde::path('foo')); } - public function test_needs_directory_creates_the_directory_recursively() + public function testNeedsDirectoryCreatesTheDirectoryRecursively() { $this->needsDirectory('foo/bar/baz'); $this->assertDirectoryExists(Hyde::path('foo/bar/baz')); } - public function test_needs_directory_handles_existing_directory() + public function testNeedsDirectoryHandlesExistingDirectory() { $this->needsDirectory('foo'); $this->needsDirectory('foo'); $this->assertDirectoryExists(Hyde::path('foo')); } - public function test_needs_directories_creates_single_directory() + public function testNeedsDirectoriesCreatesSingleDirectory() { $this->needsDirectories(['foo']); $this->assertDirectoryExists(Hyde::path('foo')); } - public function test_needs_directories_creates_multiple_directories() + public function testNeedsDirectoriesCreatesMultipleDirectories() { $this->needsDirectories(['foo', 'bar']); $this->assertDirectoryExists(Hyde::path('foo')); @@ -75,7 +75,7 @@ public function test_needs_directories_creates_multiple_directories() File::deleteDirectory(Hyde::path('bar')); } - public function test_needs_parent_directory_creates_directory_for_the_parent_file() + public function testNeedsParentDirectoryCreatesDirectoryForTheParentFile() { $this->needsParentDirectory(Hyde::path('foo/bar/baz.txt')); $this->assertDirectoryExists(Hyde::path('foo/bar')); diff --git a/packages/framework/tests/Unit/MarkdownDocumentTest.php b/packages/framework/tests/Unit/MarkdownDocumentTest.php index 90d9fdc822f..dce948cd7c2 100644 --- a/packages/framework/tests/Unit/MarkdownDocumentTest.php +++ b/packages/framework/tests/Unit/MarkdownDocumentTest.php @@ -17,44 +17,44 @@ */ class MarkdownDocumentTest extends TestCase { - public function test_constructor_creates_new_markdown_document() + public function testConstructorCreatesNewMarkdownDocument() { $document = new MarkdownDocument([], ''); $this->assertInstanceOf(MarkdownDocument::class, $document); } - public function test_constructor_arguments_are_optional() + public function testConstructorArgumentsAreOptional() { $document = new MarkdownDocument(); $this->assertInstanceOf(MarkdownDocument::class, $document); } - public function test_constructor_arguments_are_assigned() + public function testConstructorArgumentsAreAssigned() { $document = new MarkdownDocument(['foo' => 'bar'], 'Hello, world!'); $this->assertEquals(FrontMatter::fromArray(['foo' => 'bar']), $document->matter); } - public function test_magic_to_string_method_returns_body() + public function testMagicToStringMethodReturnsBody() { $document = new MarkdownDocument(['foo' => 'bar'], 'Hello, world!'); $this->assertEquals('Hello, world!', (string) $document); } - public function test_compile_method_returns_rendered_html() + public function testCompileMethodReturnsRenderedHtml() { $document = new MarkdownDocument([], 'Hello, world!'); $this->assertEquals("

Hello, world!

\n", $document->markdown->compile()); } - public function test_to_html_method_returns_rendered_as_html_string() + public function testToHtmlMethodReturnsRenderedAsHtmlString() { $document = new MarkdownDocument([], 'Hello, world!'); $this->assertInstanceOf(HtmlString::class, $document->markdown->toHtml()); $this->assertEquals("

Hello, world!

\n", (string) $document->markdown->toHtml()); } - public function test_parse_method_parses_a_file_using_the_markdown_file_service() + public function testParseMethodParsesAFileUsingTheMarkdownFileService() { file_put_contents('_pages/foo.md', "---\nfoo: bar\n---\nHello, world!"); $document = MarkdownDocument::parse('_pages/foo.md'); @@ -64,13 +64,13 @@ public function test_parse_method_parses_a_file_using_the_markdown_file_service( Filesystem::unlink('_pages/foo.md'); } - public function test_to_array_method_returns_array_markdown_body_lines() + public function testToArrayMethodReturnsArrayMarkdownBodyLines() { $document = new MarkdownDocument(body: "foo\nbar\nbaz"); $this->assertEquals(['foo', 'bar', 'baz'], $document->markdown->toArray()); } - public function test_from_file_method_returns_new_markdown_document() + public function testFromFileMethodReturnsNewMarkdownDocument() { file_put_contents('_pages/foo.md', "---\nfoo: bar\n---\nHello, world!"); $markdown = Markdown::fromFile('_pages/foo.md'); @@ -85,7 +85,7 @@ public function end_of_markdown_body_is_trimmed() $this->assertEquals('Hello, world!', $markdown->body()); } - public function test_carriage_returns_are_normalized() + public function testCarriageReturnsAreNormalized() { $markdown = new Markdown("foo\rbar"); $this->assertEquals("foo\rbar", $markdown->body()); diff --git a/packages/framework/tests/Unit/MarkdownFacadeTest.php b/packages/framework/tests/Unit/MarkdownFacadeTest.php index 32a41f1a0da..2f17ee603a5 100644 --- a/packages/framework/tests/Unit/MarkdownFacadeTest.php +++ b/packages/framework/tests/Unit/MarkdownFacadeTest.php @@ -14,7 +14,7 @@ */ class MarkdownFacadeTest extends TestCase { - public function test_render(): void + public function testRender(): void { $markdown = '# Hello World!'; diff --git a/packages/framework/tests/Unit/MediaDirectoryCanBeChangedTest.php b/packages/framework/tests/Unit/MediaDirectoryCanBeChangedTest.php index bd8bd522f3d..f2521fc54f6 100644 --- a/packages/framework/tests/Unit/MediaDirectoryCanBeChangedTest.php +++ b/packages/framework/tests/Unit/MediaDirectoryCanBeChangedTest.php @@ -19,7 +19,7 @@ */ class MediaDirectoryCanBeChangedTest extends TestCase { - public function test_media_output_directory_can_be_changed_for_site_builds() + public function testMediaOutputDirectoryCanBeChangedForSiteBuilds() { Filesystem::deleteDirectory('_site'); @@ -37,7 +37,7 @@ public function test_media_output_directory_can_be_changed_for_site_builds() $this->resetSite(); } - public function test_media_output_directory_can_be_changed_for_site_rebuilds() + public function testMediaOutputDirectoryCanBeChangedForSiteRebuilds() { Filesystem::deleteDirectory('_site'); @@ -55,7 +55,7 @@ public function test_media_output_directory_can_be_changed_for_site_rebuilds() $this->resetSite(); } - public function test_compiled_pages_have_links_to_the_right_media_file_location() + public function testCompiledPagesHaveLinksToTheRightMediaFileLocation() { Filesystem::moveDirectory('_media', '_assets'); Hyde::setMediaDirectory('_assets'); diff --git a/packages/framework/tests/Unit/NavItemTest.php b/packages/framework/tests/Unit/NavItemTest.php index ec17247b674..81989ba6321 100644 --- a/packages/framework/tests/Unit/NavItemTest.php +++ b/packages/framework/tests/Unit/NavItemTest.php @@ -38,7 +38,7 @@ protected function setUp(): void Render::swap(new RenderData()); } - public function test__construct() + public function testConstruct() { $route = new Route(new MarkdownPage()); $item = new NavItem($route, 'Test', 500); @@ -86,7 +86,7 @@ public function testFromRoute() $this->assertSame($route, $item->destination); } - public function test__toString() + public function testToString() { Render::shouldReceive('getRouteKey')->once()->andReturn('index'); diff --git a/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php b/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php index 3d063cc9770..ce7b358e5e6 100644 --- a/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php +++ b/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php @@ -86,7 +86,7 @@ abstract public function testAll(); abstract public function testMetadata(); - abstract public function test__construct(); + abstract public function testConstruct(); abstract public function testMake(); diff --git a/packages/framework/tests/Unit/Pages/BladePageUnitTest.php b/packages/framework/tests/Unit/Pages/BladePageUnitTest.php index b7ddc68a07e..7376f56a15e 100644 --- a/packages/framework/tests/Unit/Pages/BladePageUnitTest.php +++ b/packages/framework/tests/Unit/Pages/BladePageUnitTest.php @@ -146,7 +146,7 @@ public function testMetadata() $this->assertInstanceOf(PageMetadataBag::class, (new BladePage())->metadata()); } - public function test__construct() + public function testConstruct() { $this->assertInstanceOf(BladePage::class, new BladePage()); } diff --git a/packages/framework/tests/Unit/Pages/DocumentationPageUnitTest.php b/packages/framework/tests/Unit/Pages/DocumentationPageUnitTest.php index 39f1f2bb721..2ef2ae376ed 100644 --- a/packages/framework/tests/Unit/Pages/DocumentationPageUnitTest.php +++ b/packages/framework/tests/Unit/Pages/DocumentationPageUnitTest.php @@ -154,7 +154,7 @@ public function testMetadata() $this->assertInstanceOf(PageMetadataBag::class, (new DocumentationPage())->metadata()); } - public function test__construct() + public function testConstruct() { $this->assertInstanceOf(DocumentationPage::class, new DocumentationPage()); } diff --git a/packages/framework/tests/Unit/Pages/HtmlPageUnitTest.php b/packages/framework/tests/Unit/Pages/HtmlPageUnitTest.php index 060a9e62fc7..c634358579b 100644 --- a/packages/framework/tests/Unit/Pages/HtmlPageUnitTest.php +++ b/packages/framework/tests/Unit/Pages/HtmlPageUnitTest.php @@ -180,7 +180,7 @@ public function testMetadata() $this->assertInstanceOf(PageMetadataBag::class, (new HtmlPage())->metadata()); } - public function test__construct() + public function testConstruct() { $this->assertInstanceOf(HtmlPage::class, new HtmlPage()); } diff --git a/packages/framework/tests/Unit/Pages/InMemoryPageUnitTest.php b/packages/framework/tests/Unit/Pages/InMemoryPageUnitTest.php index fc79dd0d58e..2169a655ebc 100644 --- a/packages/framework/tests/Unit/Pages/InMemoryPageUnitTest.php +++ b/packages/framework/tests/Unit/Pages/InMemoryPageUnitTest.php @@ -184,7 +184,7 @@ public function testMetadata() $this->assertInstanceOf(PageMetadataBag::class, (new InMemoryPage('foo'))->metadata()); } - public function test__construct() + public function testConstruct() { $this->assertInstanceOf(InMemoryPage::class, new InMemoryPage('foo')); } diff --git a/packages/framework/tests/Unit/Pages/MarkdownPageModelConstructorArgumentsAreOptionalTest.php b/packages/framework/tests/Unit/Pages/MarkdownPageModelConstructorArgumentsAreOptionalTest.php index ed9fb44b061..d0ba705219d 100644 --- a/packages/framework/tests/Unit/Pages/MarkdownPageModelConstructorArgumentsAreOptionalTest.php +++ b/packages/framework/tests/Unit/Pages/MarkdownPageModelConstructorArgumentsAreOptionalTest.php @@ -11,7 +11,7 @@ class MarkdownPageModelConstructorArgumentsAreOptionalTest extends TestCase { - public function test_markdown_page_model_constructor_arguments_are_optional() + public function testMarkdownPageModelConstructorArgumentsAreOptional() { $models = [ MarkdownPage::class, diff --git a/packages/framework/tests/Unit/Pages/MarkdownPageTest.php b/packages/framework/tests/Unit/Pages/MarkdownPageTest.php index 4f6af8ddd11..712ccdb84e7 100644 --- a/packages/framework/tests/Unit/Pages/MarkdownPageTest.php +++ b/packages/framework/tests/Unit/Pages/MarkdownPageTest.php @@ -16,13 +16,13 @@ */ class MarkdownPageTest extends TestCase { - public function test_can_get_collection_of_slugs() + public function testCanGetCollectionOfSlugs() { $this->file('_pages/test-page.md', "# Test Page \n Hello World!"); $this->assertSame(['test-page'], MarkdownPage::files()); } - public function test_created_model_contains_expected_data() + public function testCreatedModelContainsExpectedData() { $this->file('_pages/test-page.md', "# Test Page \n Hello World!"); $page = MarkdownPage::parse('test-page'); @@ -32,7 +32,7 @@ public function test_created_model_contains_expected_data() $this->assertEquals('test-page', $page->identifier); } - public function test_can_render_markdown_page() + public function testCanRenderMarkdownPage() { $this->file('_pages/test-page.md', "# Test Page \n Hello World!"); $page = MarkdownPage::parse('test-page'); diff --git a/packages/framework/tests/Unit/Pages/MarkdownPageUnitTest.php b/packages/framework/tests/Unit/Pages/MarkdownPageUnitTest.php index 9a38dd55fb1..1942e97f108 100644 --- a/packages/framework/tests/Unit/Pages/MarkdownPageUnitTest.php +++ b/packages/framework/tests/Unit/Pages/MarkdownPageUnitTest.php @@ -182,7 +182,7 @@ public function testMetadata() $this->assertInstanceOf(PageMetadataBag::class, (new MarkdownPage())->metadata()); } - public function test__construct() + public function testConstruct() { $this->assertInstanceOf(MarkdownPage::class, new MarkdownPage()); } diff --git a/packages/framework/tests/Unit/Pages/MarkdownPostHelpersTest.php b/packages/framework/tests/Unit/Pages/MarkdownPostHelpersTest.php index 6f4a9354714..7e93b577afa 100644 --- a/packages/framework/tests/Unit/Pages/MarkdownPostHelpersTest.php +++ b/packages/framework/tests/Unit/Pages/MarkdownPostHelpersTest.php @@ -12,39 +12,39 @@ */ class MarkdownPostHelpersTest extends TestCase { - public function test_get_current_page_path_returns_local_uri_path_for_post_slug() + public function testGetCurrentPagePathReturnsLocalUriPathForPostSlug() { $post = new MarkdownPost('foo-bar'); $this->assertEquals('posts/foo-bar', $post->getRouteKey()); } - public function test_get_canonical_link_returns_canonical_uri_path_for_post_slug() + public function testGetCanonicalLinkReturnsCanonicalUriPathForPostSlug() { config(['hyde.url' => 'https://example.com']); $post = new MarkdownPost('foo-bar'); $this->assertEquals('https://example.com/posts/foo-bar.html', $post->getCanonicalUrl()); } - public function test_get_canonical_link_returns_pretty_url_when_enabled() + public function testGetCanonicalLinkReturnsPrettyUrlWhenEnabled() { config(['hyde.url' => 'https://example.com', 'hyde.pretty_urls' => true]); $post = new MarkdownPost('foo-bar'); $this->assertEquals('https://example.com/posts/foo-bar', $post->getCanonicalUrl()); } - public function test_get_post_description_returns_post_description_when_set_in_front_matter() + public function testGetPostDescriptionReturnsPostDescriptionWhenSetInFrontMatter() { $post = MarkdownPost::make('foo-bar', ['description' => 'This is a post description']); $this->assertEquals('This is a post description', $post->description); } - public function test_get_post_description_returns_post_body_when_no_description_set_in_front_matter() + public function testGetPostDescriptionReturnsPostBodyWhenNoDescriptionSetInFrontMatter() { $post = MarkdownPost::make('foo-bar', [], 'This is a post body'); $this->assertEquals('This is a post body', $post->description); } - public function test_dynamic_description_is_truncated_when_longer_than_128_characters() + public function testDynamicDescriptionIsTruncatedWhenLongerThan128Characters() { $post = MarkdownPost::make('foo-bar', [], str_repeat('a', 128)); $this->assertEquals(str_repeat('a', 125).'...', $post->description); diff --git a/packages/framework/tests/Unit/Pages/MarkdownPostParserTest.php b/packages/framework/tests/Unit/Pages/MarkdownPostParserTest.php index c9387c8b9ce..c6b0d4f7eb8 100644 --- a/packages/framework/tests/Unit/Pages/MarkdownPostParserTest.php +++ b/packages/framework/tests/Unit/Pages/MarkdownPostParserTest.php @@ -39,7 +39,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_can_parse_markdown_file() + public function testCanParseMarkdownFile() { $post = MarkdownPost::parse('test-post'); $this->assertInstanceOf(MarkdownPost::class, $post); @@ -52,7 +52,7 @@ public function test_can_parse_markdown_file() $this->assertTrue(strlen($post->identifier) > 8); } - public function test_parsed_markdown_post_contains_valid_front_matter() + public function testParsedMarkdownPostContainsValidFrontMatter() { $post = MarkdownPost::parse('test-post'); $this->assertEquals('My New Post', $post->data('title')); diff --git a/packages/framework/tests/Unit/Pages/MarkdownPostUnitTest.php b/packages/framework/tests/Unit/Pages/MarkdownPostUnitTest.php index a3f12d4ed73..9bddaf592b7 100644 --- a/packages/framework/tests/Unit/Pages/MarkdownPostUnitTest.php +++ b/packages/framework/tests/Unit/Pages/MarkdownPostUnitTest.php @@ -182,7 +182,7 @@ public function testMetadata() $this->assertInstanceOf(PageMetadataBag::class, (new MarkdownPost())->metadata()); } - public function test__construct() + public function testConstruct() { $this->assertInstanceOf(MarkdownPost::class, new MarkdownPost()); } diff --git a/packages/framework/tests/Unit/Pages/PageModelGetAllFilesHelperTest.php b/packages/framework/tests/Unit/Pages/PageModelGetAllFilesHelperTest.php index 26b77d05110..8ccd211d324 100644 --- a/packages/framework/tests/Unit/Pages/PageModelGetAllFilesHelperTest.php +++ b/packages/framework/tests/Unit/Pages/PageModelGetAllFilesHelperTest.php @@ -16,7 +16,7 @@ */ class PageModelGetAllFilesHelperTest extends TestCase { - public function test_blade_page_get_helper_returns_blade_page_array() + public function testBladePageGetHelperReturnsBladePageArray() { $array = BladePage::files(); $this->assertCount(2, $array); @@ -24,7 +24,7 @@ public function test_blade_page_get_helper_returns_blade_page_array() $this->assertEquals(['404', 'index'], $array); } - public function test_markdown_page_get_helper_returns_markdown_page_array() + public function testMarkdownPageGetHelperReturnsMarkdownPageArray() { Filesystem::touch('_pages/test-page.md'); @@ -36,7 +36,7 @@ public function test_markdown_page_get_helper_returns_markdown_page_array() Filesystem::unlink('_pages/test-page.md'); } - public function test_markdown_post_get_helper_returns_markdown_post_array() + public function testMarkdownPostGetHelperReturnsMarkdownPostArray() { Filesystem::touch('_posts/test-post.md'); @@ -48,7 +48,7 @@ public function test_markdown_post_get_helper_returns_markdown_post_array() Filesystem::unlink('_posts/test-post.md'); } - public function test_documentation_page_get_helper_returns_documentation_page_array() + public function testDocumentationPageGetHelperReturnsDocumentationPageArray() { Filesystem::touch('_docs/test-page.md'); diff --git a/packages/framework/tests/Unit/Pages/PageModelGetHelperTest.php b/packages/framework/tests/Unit/Pages/PageModelGetHelperTest.php index f8727b4caed..e04c4838a17 100644 --- a/packages/framework/tests/Unit/Pages/PageModelGetHelperTest.php +++ b/packages/framework/tests/Unit/Pages/PageModelGetHelperTest.php @@ -17,7 +17,7 @@ */ class PageModelGetHelperTest extends TestCase { - public function test_blade_page_get_helper_returns_blade_page_collection() + public function testBladePageGetHelperReturnsBladePageCollection() { $collection = BladePage::all(); $this->assertCount(2, $collection); @@ -25,7 +25,7 @@ public function test_blade_page_get_helper_returns_blade_page_collection() $this->assertContainsOnlyInstancesOf(BladePage::class, $collection); } - public function test_markdown_page_get_helper_returns_markdown_page_collection() + public function testMarkdownPageGetHelperReturnsMarkdownPageCollection() { Filesystem::touch('_pages/test-page.md'); @@ -37,7 +37,7 @@ public function test_markdown_page_get_helper_returns_markdown_page_collection() Filesystem::unlink('_pages/test-page.md'); } - public function test_markdown_post_get_helper_returns_markdown_post_collection() + public function testMarkdownPostGetHelperReturnsMarkdownPostCollection() { Filesystem::touch('_posts/test-post.md'); @@ -49,7 +49,7 @@ public function test_markdown_post_get_helper_returns_markdown_post_collection() Filesystem::unlink('_posts/test-post.md'); } - public function test_documentation_page_get_helper_returns_documentation_page_collection() + public function testDocumentationPageGetHelperReturnsDocumentationPageCollection() { $this->withoutDocumentationSearch(); diff --git a/packages/framework/tests/Unit/Pages/PageModelParseHelperTest.php b/packages/framework/tests/Unit/Pages/PageModelParseHelperTest.php index 3f86e47bb85..8e4c55fedd7 100644 --- a/packages/framework/tests/Unit/Pages/PageModelParseHelperTest.php +++ b/packages/framework/tests/Unit/Pages/PageModelParseHelperTest.php @@ -16,7 +16,7 @@ */ class PageModelParseHelperTest extends TestCase { - public function test_blade_page_get_helper_returns_blade_page_object() + public function testBladePageGetHelperReturnsBladePageObject() { Filesystem::touch('_pages/foo.blade.php'); @@ -26,7 +26,7 @@ public function test_blade_page_get_helper_returns_blade_page_object() Filesystem::unlink('_pages/foo.blade.php'); } - public function test_markdown_page_get_helper_returns_markdown_page_object() + public function testMarkdownPageGetHelperReturnsMarkdownPageObject() { Filesystem::touch('_pages/foo.md'); @@ -36,7 +36,7 @@ public function test_markdown_page_get_helper_returns_markdown_page_object() Filesystem::unlink('_pages/foo.md'); } - public function test_markdown_post_get_helper_returns_markdown_post_object() + public function testMarkdownPostGetHelperReturnsMarkdownPostObject() { Filesystem::touch('_posts/foo.md'); @@ -46,7 +46,7 @@ public function test_markdown_post_get_helper_returns_markdown_post_object() Filesystem::unlink('_posts/foo.md'); } - public function test_documentation_page_get_helper_returns_documentation_page_object() + public function testDocumentationPageGetHelperReturnsDocumentationPageObject() { Filesystem::touch('_docs/foo.md'); diff --git a/packages/framework/tests/Unit/RelativeLinksAcrossPagesRetainsIntegrityTest.php b/packages/framework/tests/Unit/RelativeLinksAcrossPagesRetainsIntegrityTest.php index 5dfec04d50f..7441cf0ce74 100644 --- a/packages/framework/tests/Unit/RelativeLinksAcrossPagesRetainsIntegrityTest.php +++ b/packages/framework/tests/Unit/RelativeLinksAcrossPagesRetainsIntegrityTest.php @@ -69,7 +69,7 @@ protected function assertSee(string $page, string|array $text): void "Failed asserting that the page '$page' contains the text '$text'"); } - public function test_relative_links_across_pages_retains_integrity() + public function testRelativeLinksAcrossPagesRetainsIntegrity() { $service = new BuildService(Mockery::mock(OutputStyle::class, [ 'getFormatter' => Mockery::mock(OutputFormatterInterface::class, [ diff --git a/packages/framework/tests/Unit/RouteNotFoundExceptionTest.php b/packages/framework/tests/Unit/RouteNotFoundExceptionTest.php index 87390343056..caa8dea127e 100644 --- a/packages/framework/tests/Unit/RouteNotFoundExceptionTest.php +++ b/packages/framework/tests/Unit/RouteNotFoundExceptionTest.php @@ -12,14 +12,14 @@ */ class RouteNotFoundExceptionTest extends UnitTestCase { - public function test_it_can_be_instantiated() + public function testItCanBeInstantiated() { $exception = new RouteNotFoundException(); $this->assertInstanceOf(RouteNotFoundException::class, $exception); } - public function test_it_throws_an_exception_when_page_type_is_not_supported() + public function testItThrowsAnExceptionWhenPageTypeIsNotSupported() { $this->expectException(RouteNotFoundException::class); $this->expectExceptionMessage('Route [not-found] not found.'); diff --git a/packages/framework/tests/Unit/ServeCommandOptionsUnitTest.php b/packages/framework/tests/Unit/ServeCommandOptionsUnitTest.php index 9b73aa63aa0..86cf267463d 100644 --- a/packages/framework/tests/Unit/ServeCommandOptionsUnitTest.php +++ b/packages/framework/tests/Unit/ServeCommandOptionsUnitTest.php @@ -28,58 +28,58 @@ protected function setUp(): void ]); } - public function test_getHostSelection() + public function testGetHostSelection() { $this->assertSame('localhost', $this->getMock()->getHostSelection()); } - public function test_getHostSelection_withHostOption() + public function testGetHostSelectionWithHostOption() { $this->assertSame('foo', $this->getMock(['host' => 'foo'])->getHostSelection()); } - public function test_getHostSelection_withConfigOption() + public function testGetHostSelectionWithConfigOption() { self::mockConfig(['hyde.server.host' => 'foo']); $this->assertSame('foo', $this->getMock()->getHostSelection()); } - public function test_getHostSelection_withHostOptionAndConfigOption() + public function testGetHostSelectionWithHostOptionAndConfigOption() { self::mockConfig(['hyde.server.host' => 'foo']); $this->assertSame('bar', $this->getMock(['host' => 'bar'])->getHostSelection()); } - public function test_getPortSelection() + public function testGetPortSelection() { $this->assertSame(8080, $this->getMock()->getPortSelection()); } - public function test_getPortSelection_withPortOption() + public function testGetPortSelectionWithPortOption() { $this->assertSame(8081, $this->getMock(['port' => 8081])->getPortSelection()); } - public function test_getPortSelection_withConfigOption() + public function testGetPortSelectionWithConfigOption() { self::mockConfig(['hyde.server.port' => 8082]); $this->assertSame(8082, $this->getMock()->getPortSelection()); } - public function test_getPortSelection_withPortOptionAndConfigOption() + public function testGetPortSelectionWithPortOptionAndConfigOption() { self::mockConfig(['hyde.server.port' => 8082]); $this->assertSame(8081, $this->getMock(['port' => 8081])->getPortSelection()); } - public function test_getEnvironmentVariables() + public function testGetEnvironmentVariables() { $this->assertSame([ 'HYDE_SERVER_REQUEST_OUTPUT' => true, ], $this->getMock()->getEnvironmentVariables()); } - public function test_getEnvironmentVariables_withNoAnsiOption() + public function testGetEnvironmentVariablesWithNoAnsiOption() { $this->assertSame([ 'HYDE_SERVER_REQUEST_OUTPUT' => false, @@ -158,7 +158,7 @@ public function testPlayCdnOptionPropagatesToEnvironmentVariables() $this->assertFalse(isset($command->getEnvironmentVariables()['HYDE_PLAY_CDN'])); } - public function test_parseEnvironmentOption() + public function testParseEnvironmentOption() { $command = $this->getMock(['foo' => 'true']); $this->assertSame('enabled', $command->parseEnvironmentOption('foo')); @@ -167,19 +167,19 @@ public function test_parseEnvironmentOption() $this->assertSame('disabled', $command->parseEnvironmentOption('foo')); } - public function test_parseEnvironmentOption_withEmptyString() + public function testParseEnvironmentOptionWithEmptyString() { $command = $this->getMock(['foo' => '']); $this->assertSame('enabled', $command->parseEnvironmentOption('foo')); } - public function test_parseEnvironmentOption_withNull() + public function testParseEnvironmentOptionWithNull() { $command = $this->getMock(['foo' => null]); $this->assertNull($command->parseEnvironmentOption('foo')); } - public function test_parseEnvironmentOption_withInvalidValue() + public function testParseEnvironmentOptionWithInvalidValue() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid boolean value for --foo option.'); @@ -188,7 +188,7 @@ public function test_parseEnvironmentOption_withInvalidValue() $command->parseEnvironmentOption('foo'); } - public function test_checkArgvForOption() + public function testCheckArgvForOption() { $serverBackup = $_SERVER; @@ -233,7 +233,7 @@ protected function openInBrowser(): void $this->assertTrue($command->openInBrowserCalled); } - public function test_openInBrowser() + public function testOpenInBrowser() { $output = $this->createMock(OutputStyle::class); $output->expects($this->never())->method('writeln'); @@ -254,7 +254,7 @@ public function test_openInBrowser() $command->openInBrowser(); } - public function test_openInBrowserThatFails() + public function testOpenInBrowserThatFails() { $output = Mockery::mock(OutputStyle::class); $output->shouldReceive('getFormatter')->andReturn($this->createMock(OutputFormatterInterface::class)); diff --git a/packages/framework/tests/Unit/SourceFilesInCustomDirectoriesCanBeCompiledTest.php b/packages/framework/tests/Unit/SourceFilesInCustomDirectoriesCanBeCompiledTest.php index 14e519cfc2a..f5208611fe0 100644 --- a/packages/framework/tests/Unit/SourceFilesInCustomDirectoriesCanBeCompiledTest.php +++ b/packages/framework/tests/Unit/SourceFilesInCustomDirectoriesCanBeCompiledTest.php @@ -34,7 +34,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_markdown_posts_in_changed_directory_can_be_compiled() + public function testMarkdownPostsInChangedDirectoryCanBeCompiled() { mkdir(Hyde::path('testSourceDir/blog')); Filesystem::touch('testSourceDir/blog/test.md'); @@ -47,7 +47,7 @@ public function test_markdown_posts_in_changed_directory_can_be_compiled() Filesystem::unlink('_site/posts/test.html'); } - public function test_markdown_pages_in_changed_directory_can_be_compiled() + public function testMarkdownPagesInChangedDirectoryCanBeCompiled() { mkdir(Hyde::path('testSourceDir/pages')); Filesystem::touch('testSourceDir/pages/test.md'); @@ -60,7 +60,7 @@ public function test_markdown_pages_in_changed_directory_can_be_compiled() Filesystem::unlink('_site/test.html'); } - public function test_documentation_pages_in_changed_directory_can_be_compiled() + public function testDocumentationPagesInChangedDirectoryCanBeCompiled() { mkdir(Hyde::path('testSourceDir/documentation')); Filesystem::touch('testSourceDir/documentation/test.md'); @@ -73,7 +73,7 @@ public function test_documentation_pages_in_changed_directory_can_be_compiled() Filesystem::unlink('_site/docs/test.html'); } - public function test_blade_pages_in_changed_directory_can_be_compiled() + public function testBladePagesInChangedDirectoryCanBeCompiled() { mkdir(Hyde::path('testSourceDir/blade')); Filesystem::touch('testSourceDir/blade/test.blade.php'); diff --git a/packages/framework/tests/Unit/TestBuildStaticSiteCommandFlagToEnablePrettyUrlsTest.php b/packages/framework/tests/Unit/TestBuildStaticSiteCommandFlagToEnablePrettyUrlsTest.php index ea6231665cc..b9e3638b7d2 100644 --- a/packages/framework/tests/Unit/TestBuildStaticSiteCommandFlagToEnablePrettyUrlsTest.php +++ b/packages/framework/tests/Unit/TestBuildStaticSiteCommandFlagToEnablePrettyUrlsTest.php @@ -13,7 +13,7 @@ */ class TestBuildStaticSiteCommandFlagToEnablePrettyUrlsTest extends TestCase { - public function test_pretty_urls_can_be_enabled_with_flag() + public function testPrettyUrlsCanBeEnabledWithFlag() { config(['hyde.pretty_urls' => false]); @@ -26,7 +26,7 @@ public function test_pretty_urls_can_be_enabled_with_flag() File::cleanDirectory(Hyde::path('_site')); } - public function test_config_change_is_not_persisted() + public function testConfigChangeIsNotPersisted() { $this->assertFalse(config('hyde.pretty_urls', false)); } diff --git a/packages/framework/tests/Unit/TracksExecutionTimeTest.php b/packages/framework/tests/Unit/TracksExecutionTimeTest.php index 44752ba2816..e85b94a4060 100644 --- a/packages/framework/tests/Unit/TracksExecutionTimeTest.php +++ b/packages/framework/tests/Unit/TracksExecutionTimeTest.php @@ -12,7 +12,7 @@ */ class TracksExecutionTimeTest extends UnitTestCase { - public function test_startClock() + public function testStartClock() { $class = new TracksExecutionTimeTestClass(); @@ -25,7 +25,7 @@ public function test_startClock() $this->assertLessThan(1, abs(microtime(true) - $class->timeStart)); } - public function test_stopClock() + public function testStopClock() { $class = new TracksExecutionTimeTestClass(); $class->startClock(); @@ -34,7 +34,7 @@ public function test_stopClock() $this->assertLessThan(1, $class->stopClock()); } - public function test_getExecutionTimeInMs() + public function testGetExecutionTimeInMs() { $class = new FixedStopClockTestClass(); @@ -42,7 +42,7 @@ public function test_getExecutionTimeInMs() $this->assertSame(3.14, $class->getExecutionTimeInMs()); } - public function test_getExecutionTimeString() + public function testGetExecutionTimeString() { $class = new FixedStopClockTestClass(); diff --git a/packages/framework/tests/Unit/UnixsumTest.php b/packages/framework/tests/Unit/UnixsumTest.php index 58ccde0a033..b72b3eefab1 100644 --- a/packages/framework/tests/Unit/UnixsumTest.php +++ b/packages/framework/tests/Unit/UnixsumTest.php @@ -14,42 +14,42 @@ class UnixsumTest extends TestCase { - public function test_method_returns_string() + public function testMethodReturnsString() { $this->assertIsString(unixsum('foo')); } - public function test_method_returns_string_with_length_of_32() + public function testMethodReturnsStringWithLengthOf32() { $this->assertEquals(32, strlen(unixsum('foo'))); } - public function test_method_returns_string_matching_expected_format() + public function testMethodReturnsStringMatchingExpectedFormat() { $this->assertMatchesRegularExpression('/^[a-f0-9]{32}$/', unixsum('foo')); } - public function test_method_returns_same_value_for_same_string_using_normal_method() + public function testMethodReturnsSameValueForSameStringUsingNormalMethod() { $this->assertEquals(md5('foo'), unixsum('foo')); } - public function test_method_returns_different_value_for_different_string() + public function testMethodReturnsDifferentValueForDifferentString() { $this->assertNotEquals(unixsum('foo'), unixsum('bar')); } - public function test_function_is_case_sensitive() + public function testFunctionIsCaseSensitive() { $this->assertNotEquals(unixsum('foo'), unixsum('FOO')); } - public function test_function_is_space_sensitive() + public function testFunctionIsSpaceSensitive() { $this->assertNotEquals(unixsum(' foo '), unixsum('foo')); } - public function test_method_returns_same_value_regardless_of_end_of_line_sequence() + public function testMethodReturnsSameValueRegardlessOfEndOfLineSequence() { $this->assertEquals(unixsum('foo'), unixsum('foo')); $this->assertEquals(unixsum("foo\n"), unixsum("foo\n")); @@ -57,13 +57,13 @@ public function test_method_returns_same_value_regardless_of_end_of_line_sequenc $this->assertEquals(unixsum("foo\n"), unixsum("foo\r\n")); } - public function test_method_returns_same_value_for_string_with_mixed_end_of_line_sequences() + public function testMethodReturnsSameValueForStringWithMixedEndOfLineSequences() { $this->assertEquals(unixsum("foo\nbar\r\nbaz\r\n"), unixsum("foo\nbar\nbaz\n")); } - public function test_method_returns_same_value_when_loaded_from_file_using_shorthand() + public function testMethodReturnsSameValueWhenLoadedFromFileUsingShorthand() { $string = "foo\nbar\r\nbaz\r\n"; diff --git a/packages/framework/tests/Unit/UnsupportedPageTypeExceptionTest.php b/packages/framework/tests/Unit/UnsupportedPageTypeExceptionTest.php index e9307a0edca..36e972b997b 100644 --- a/packages/framework/tests/Unit/UnsupportedPageTypeExceptionTest.php +++ b/packages/framework/tests/Unit/UnsupportedPageTypeExceptionTest.php @@ -12,14 +12,14 @@ */ class UnsupportedPageTypeExceptionTest extends UnitTestCase { - public function test_it_can_be_instantiated() + public function testItCanBeInstantiated() { $exception = new UnsupportedPageTypeException(); $this->assertInstanceOf(UnsupportedPageTypeException::class, $exception); } - public function test_it_throws_an_exception_when_page_type_is_not_supported() + public function testItThrowsAnExceptionWhenPageTypeIsNotSupported() { $this->expectException(UnsupportedPageTypeException::class); $this->expectExceptionMessage('The page type [unsupported] is not supported.'); diff --git a/packages/framework/tests/Unit/ValidatesExistenceTest.php b/packages/framework/tests/Unit/ValidatesExistenceTest.php index 3cef88c692d..51414ea4507 100644 --- a/packages/framework/tests/Unit/ValidatesExistenceTest.php +++ b/packages/framework/tests/Unit/ValidatesExistenceTest.php @@ -15,7 +15,7 @@ */ class ValidatesExistenceTest extends TestCase { - public function test_validate_existence_does_nothing_if_file_exists() + public function testValidateExistenceDoesNothingIfFileExists() { $class = new ValidatesExistenceTestClass(); @@ -24,7 +24,7 @@ public function test_validate_existence_does_nothing_if_file_exists() $this->assertTrue(true); } - public function test_validate_existence_throws_file_not_found_exception_if_file_does_not_exist() + public function testValidateExistenceThrowsFileNotFoundExceptionIfFileDoesNotExist() { $this->expectException(FileNotFoundException::class); diff --git a/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php b/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php index e42b88a8e09..aa445431c65 100644 --- a/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php +++ b/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php @@ -21,13 +21,13 @@ protected function renderTestView(MarkdownPost $post): string ), ['post' => $post]); } - public function test_component_can_be_rendered() + public function testComponentCanBeRendered() { $view = $this->renderTestView(MarkdownPost::make()); $this->assertStringContainsString('https://schema.org/Article', $view); } - public function test_component_renders_post_data() + public function testComponentRendersPostData() { $view = $this->renderTestView(MarkdownPost::make(matter: [ 'title' => 'Test Post', @@ -43,7 +43,7 @@ public function test_component_renders_post_data() $this->assertStringContainsString('Read post', $view); } - public function test_component_renders_post_with_author_object() + public function testComponentRendersPostWithAuthorObject() { $view = $this->renderTestView(MarkdownPost::make(matter: [ 'author' => [ @@ -55,7 +55,7 @@ public function test_component_renders_post_with_author_object() $this->assertStringContainsString('John Doe', $view); } - public function test_there_is_no_comma_after_date_string_when_there_is_no_author() + public function testThereIsNoCommaAfterDateStringWhenThereIsNoAuthor() { $view = $this->renderTestView(MarkdownPost::make(matter: [ 'date' => '2022-01-01', @@ -65,7 +65,7 @@ public function test_there_is_no_comma_after_date_string_when_there_is_no_author $this->assertStringNotContainsString('Jan 1st, 2022,', $view); } - public function test_there_is_a_comma_after_date_string_when_there_is_a_author() + public function testThereIsACommaAfterDateStringWhenThereIsAAuthor() { $view = $this->renderTestView(MarkdownPost::make(matter: [ 'date' => '2022-01-01', diff --git a/packages/framework/tests/Unit/Views/Components/LinkComponentTest.php b/packages/framework/tests/Unit/Views/Components/LinkComponentTest.php index bc877f981a8..7e5e667e735 100644 --- a/packages/framework/tests/Unit/Views/Components/LinkComponentTest.php +++ b/packages/framework/tests/Unit/Views/Components/LinkComponentTest.php @@ -14,19 +14,19 @@ */ class LinkComponentTest extends TestCase { - public function test_link_component_can_be_rendered() + public function testLinkComponentCanBeRendered() { $this->assertEquals('
bar', rtrim(Blade::render('bar'))); } - public function test_link_component_can_be_rendered_with_route() + public function testLinkComponentCanBeRenderedWithRoute() { $route = Routes::get('index'); $this->assertEquals('bar', rtrim( Blade::render('bar'))); } - public function test_link_component_can_be_rendered_with_route_for_nested_pages() + public function testLinkComponentCanBeRenderedWithRouteForNestedPages() { Render::share('routeKey', 'foo/bar'); $route = Routes::get('index'); diff --git a/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php b/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php index 9b3c11db6f6..8d60759d23e 100644 --- a/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php +++ b/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php @@ -22,7 +22,7 @@ */ class FeaturedImageViewTest extends TestCase { - public function test_the_view() + public function testTheView() { $component = $this->renderComponent([ 'image.source' => 'foo.jpg', @@ -48,7 +48,7 @@ public function test_the_view() ); } - public function test_image_author_attribution_string() + public function testImageAuthorAttributionString() { $string = $this->renderComponent(['image.authorName' => 'John Doe']); $this->assertStringContainsString('itemprop="creator"', $string); @@ -56,7 +56,7 @@ public function test_image_author_attribution_string() $this->assertStringContainsString('John Doe', $string); } - public function test_image_author_attribution_string_with_url() + public function testImageAuthorAttributionStringWithUrl() { $string = $this->renderComponent([ 'image.authorName' => 'John Doe', @@ -69,27 +69,27 @@ public function test_image_author_attribution_string_with_url() $this->assertStringContainsString('renderComponent(['image.copyright' => 'foo copy']); $this->assertStringContainsString('', $string); $this->assertStringContainsString('foo copy', $string); } - public function test_copyright_string_inverse() + public function testCopyrightStringInverse() { $string = $this->renderComponent([]); $this->assertStringNotContainsString('', $string); } - public function test_license_string() + public function testLicenseString() { $string = $this->renderComponent(['image.licenseName' => 'foo']); $this->assertStringContainsString('foo', $string); } - public function test_license_string_with_url() + public function testLicenseStringWithUrl() { $image = $this->make([ 'image.licenseName' => 'foo', @@ -100,21 +100,21 @@ public function test_license_string_with_url() $this->assertStringContainsString('foo', $string); } - public function test_license_string_inverse() + public function testLicenseStringInverse() { $string = $this->renderComponent([]); $this->assertStringNotContainsString('', $string); $this->assertStringNotContainsString('license', $string); } - public function test_license_string_inverse_with_url() + public function testLicenseStringInverseWithUrl() { $string = $this->renderComponent(['image.licenseUrl' => 'https://example.com/bar.html']); $this->assertStringNotContainsString('', $string); $this->assertStringNotContainsString('license', $string); } - public function test_fluent_attribution_logic_uses_rich_html_tags() + public function testFluentAttributionLogicUsesRichHtmlTags() { $image = $this->make([ 'image.authorName' => 'John Doe', @@ -133,7 +133,7 @@ public function test_fluent_attribution_logic_uses_rich_html_tags() $this->assertStringContainsString('John Doe', $string); } - public function test_fluent_attribution_logic_uses_rich_html_tags_1() + public function testFluentAttributionLogicUsesRichHtmlTags1() { $image = $this->make(['image.authorName' => 'John Doe']); $string = $this->renderComponent($image); @@ -141,7 +141,7 @@ public function test_fluent_attribution_logic_uses_rich_html_tags_1() $this->assertStringContainsString('John Doe', $string); } - public function test_fluent_attribution_logic_uses_rich_html_tags_2() + public function testFluentAttributionLogicUsesRichHtmlTags2() { $image = $this->make(['image.copyright' => 'foo']); $string = $this->renderComponent($image); @@ -149,7 +149,7 @@ public function test_fluent_attribution_logic_uses_rich_html_tags_2() $this->assertStringContainsString('foo', $string); } - public function test_fluent_attribution_logic_uses_rich_html_tags_3() + public function testFluentAttributionLogicUsesRichHtmlTags3() { $image = $this->make(['image.licenseName' => 'foo']); @@ -157,7 +157,7 @@ public function test_fluent_attribution_logic_uses_rich_html_tags_3() $this->assertStringContainsString('foo', $string); } - public function test_fluent_attribution_logic_uses_rich_html_tags_4() + public function testFluentAttributionLogicUsesRichHtmlTags4() { $image = $this->make(); $string = $this->renderComponent($image); @@ -165,7 +165,7 @@ public function test_fluent_attribution_logic_uses_rich_html_tags_4() $this->assertStringNotContainsString('License', $string); } - public function test_fluent_attribution_logic_creates_fluent_messages1() + public function testFluentAttributionLogicCreatesFluentMessages1() { $image = $this->make([ 'image.authorName' => 'John Doe', @@ -179,7 +179,7 @@ public function test_fluent_attribution_logic_creates_fluent_messages1() ); } - public function test_fluent_attribution_logic_creates_fluent_messages2() + public function testFluentAttributionLogicCreatesFluentMessages2() { $image = $this->make([ 'image.authorName' => 'John Doe', @@ -192,7 +192,7 @@ public function test_fluent_attribution_logic_creates_fluent_messages2() ); } - public function test_fluent_attribution_logic_creates_fluent_messages3() + public function testFluentAttributionLogicCreatesFluentMessages3() { $expect = 'Image by John Doe. CC.'; $image = $this->make([ @@ -206,7 +206,7 @@ public function test_fluent_attribution_logic_creates_fluent_messages3() ); } - public function test_fluent_attribution_logic_creates_fluent_messages4() + public function testFluentAttributionLogicCreatesFluentMessages4() { $expect = 'All rights reserved.'; $image = $this->make([ @@ -219,7 +219,7 @@ public function test_fluent_attribution_logic_creates_fluent_messages4() ); } - public function test_fluent_attribution_logic_creates_fluent_messages5() + public function testFluentAttributionLogicCreatesFluentMessages5() { $expect = 'Image by John Doe.'; $image = $this->make([ @@ -232,7 +232,7 @@ public function test_fluent_attribution_logic_creates_fluent_messages5() ); } - public function test_fluent_attribution_logic_creates_fluent_messages6() + public function testFluentAttributionLogicCreatesFluentMessages6() { $expect = 'License MIT.'; $image = $this->make([ @@ -245,7 +245,7 @@ public function test_fluent_attribution_logic_creates_fluent_messages6() ); } - public function test_fluent_attribution_logic_creates_fluent_messages7() + public function testFluentAttributionLogicCreatesFluentMessages7() { $expect = ''; $image = $this->make(); diff --git a/packages/framework/tests/Unit/Views/HeadComponentViewTest.php b/packages/framework/tests/Unit/Views/HeadComponentViewTest.php index fd8935f97d6..3678fd3a04f 100644 --- a/packages/framework/tests/Unit/Views/HeadComponentViewTest.php +++ b/packages/framework/tests/Unit/Views/HeadComponentViewTest.php @@ -72,6 +72,20 @@ public function testComponentIncludesStylesView() $this->assertStringContainsString("@include('hyde::layouts.styles')", $this->renderTestView()); } + public function testCanAddHeadHtmlFromConfigHook() + { + config(['hyde.head' => '']); + + $this->assertStringContainsString('', $this->renderTestView()); + } + + public function testCanAddHeadHtmlFromHtmlInclude() + { + $this->file('resources/includes/head.html', ''); + + $this->assertStringContainsString('', $this->renderTestView()); + } + protected function escapeIncludes(string $contents): string { return str_replace('@include', '@@include', $contents); diff --git a/packages/framework/tests/Unit/Views/NavigationBrandViewTest.php b/packages/framework/tests/Unit/Views/NavigationBrandViewTest.php index 98a52e424b2..577295f5cf0 100644 --- a/packages/framework/tests/Unit/Views/NavigationBrandViewTest.php +++ b/packages/framework/tests/Unit/Views/NavigationBrandViewTest.php @@ -26,12 +26,12 @@ protected function render(): string ])->render(); } - public function test_component_links_to_home_route() + public function testComponentLinksToHomeRoute() { $this->assertStringContainsString('href="index.html"', $this->render()); } - public function test_component_uses_site_name() + public function testComponentUsesSiteName() { $this->assertStringContainsString('HydePHP', $this->render()); config(['hyde.name' => 'foo']); diff --git a/packages/framework/tests/Unit/Views/NavigationLinkViewTest.php b/packages/framework/tests/Unit/Views/NavigationLinkViewTest.php index 2e56951fbdc..1018d2ae3c0 100644 --- a/packages/framework/tests/Unit/Views/NavigationLinkViewTest.php +++ b/packages/framework/tests/Unit/Views/NavigationLinkViewTest.php @@ -27,23 +27,23 @@ protected function render(?NavItem $item = null): string ])->render(); } - public function test_component_links_to_route_destination() + public function testComponentLinksToRouteDestination() { $this->assertStringContainsString('href="foo.html"', $this->render()); } - public function test_component_uses_title() + public function testComponentUsesTitle() { $this->assertStringContainsString('Foo', $this->render()); } - public function test_component_is_current_when_current_route_matches() + public function testComponentIsCurrentWhenCurrentRouteMatches() { $this->mockRoute(Routes::get('index')); $this->assertStringContainsString('current', $this->render(NavItem::forRoute(Routes::get('index'), 'Home'))); } - public function test_component_has_aria_current_when_current_route_matches() + public function testComponentHasAriaCurrentWhenCurrentRouteMatches() { $this->mockRoute(Routes::get('index')); $this->assertStringContainsString('aria-current="page"', $this->render(NavItem::forRoute(Routes::get('index'), 'Home'))); diff --git a/packages/framework/tests/Unit/Views/NavigationMenuViewTest.php b/packages/framework/tests/Unit/Views/NavigationMenuViewTest.php index 41f13a493de..0d9145a99de 100644 --- a/packages/framework/tests/Unit/Views/NavigationMenuViewTest.php +++ b/packages/framework/tests/Unit/Views/NavigationMenuViewTest.php @@ -27,37 +27,37 @@ protected function render(): string return view('hyde::layouts.navigation')->render(); } - public function test_component_can_be_rendered() + public function testComponentCanBeRendered() { $this->assertStringContainsString('id="main-navigation"', $this->render()); } - public function test_component_contains_dark_mode_button() + public function testComponentContainsDarkModeButton() { $this->assertStringContainsString('theme-toggle-button', $this->render()); } - public function test_component_contains_navigation_menu_toggle_button() + public function testComponentContainsNavigationMenuToggleButton() { $this->assertStringContainsString('id="navigation-toggle-button"', $this->render()); } - public function test_component_contains_main_navigation_links() + public function testComponentContainsMainNavigationLinks() { $this->assertStringContainsString('id="main-navigation-links"', $this->render()); } - public function test_component_contains_index_html_link() + public function testComponentContainsIndexHtmlLink() { $this->assertStringContainsString('href="index.html"', $this->render()); } - public function test_component_not_contains_404_html_link() + public function testComponentNotContains404HtmlLink() { $this->assertStringNotContainsString('href="404.html"', $this->render()); } - public function test_navigation_menu_label_can_be_changed_in_front_matter() + public function testNavigationMenuLabelCanBeChangedInFrontMatter() { $this->file('_pages/foo.md', '--- navigation: @@ -71,7 +71,7 @@ public function test_navigation_menu_label_can_be_changed_in_front_matter() Filesystem::unlink('_site/foo.html'); } - public function test_navigation_menu_label_can_be_changed_in_blade_matter() + public function testNavigationMenuLabelCanBeChangedInBladeMatter() { $this->file('_pages/foo.blade.php', <<<'BLADE' @extends('hyde::layouts.app') diff --git a/packages/framework/tests/Unit/Views/ScriptsComponentViewTest.php b/packages/framework/tests/Unit/Views/ScriptsComponentViewTest.php index 15df7638a7a..63abb92a8a9 100644 --- a/packages/framework/tests/Unit/Views/ScriptsComponentViewTest.php +++ b/packages/framework/tests/Unit/Views/ScriptsComponentViewTest.php @@ -26,24 +26,24 @@ protected function renderTestView(): string )); } - public function test_component_can_be_rendered() + public function testComponentCanBeRendered() { $this->assertStringContainsString('']); + + $this->assertStringContainsString('', $this->renderTestView()); + } + + public function testCanAddScriptsHtmlFromHtmlInclude() + { + $this->file('resources/includes/scripts.html', ''); + + $this->assertStringContainsString('', $this->renderTestView()); + } + + public function testScriptsCanBePushedToTheComponentScriptsStack() { view()->share('routeKey', ''); diff --git a/packages/framework/tests/Unit/Views/StylesComponentViewTest.php b/packages/framework/tests/Unit/Views/StylesComponentViewTest.php index 4630fe7039d..36a30f7c2b9 100644 --- a/packages/framework/tests/Unit/Views/StylesComponentViewTest.php +++ b/packages/framework/tests/Unit/Views/StylesComponentViewTest.php @@ -31,17 +31,17 @@ protected function renderTestView(): string )); } - public function test_component_can_be_rendered() + public function testComponentCanBeRendered() { $this->assertStringContainsString('renderTestView()); } - public function test_component_has_link_to_app_css_file() + public function testComponentHasLinkToAppCssFile() { $this->assertStringContainsString('renderTestView()); } - public function test_component_uses_relative_path_to_app_css_file_for_nested_pages() + public function testComponentUsesRelativePathToAppCssFileForNestedPages() { $this->mockCurrentPage = 'foo'; $this->assertStringContainsString('renderTestView()); @@ -52,14 +52,14 @@ public function test_component_uses_relative_path_to_app_css_file_for_nested_pag $this->mockCurrentPage = null; } - public function test_component_does_not_render_link_to_app_css_when_it_does_not_exist() + public function testComponentDoesNotRenderLinkToAppCssWhenItDoesNotExist() { rename(Hyde::path('_media/app.css'), Hyde::path('_media/app.css.bak')); $this->assertStringNotContainsString('renderTestView()); rename(Hyde::path('_media/app.css.bak'), Hyde::path('_media/app.css')); } - public function test_styles_can_be_pushed_to_the_component_styles_stack() + public function testStylesCanBePushedToTheComponentStylesStack() { Render::share('routeKey', ''); @@ -74,25 +74,25 @@ public function test_styles_can_be_pushed_to_the_component_styles_stack() ); } - public function test_component_renders_tailwind_play_cdn_link_when_enabled_in_config() + public function testComponentRendersTailwindPlayCdnLinkWhenEnabledInConfig() { config(['hyde.use_play_cdn' => true]); $this->assertStringContainsString('', $this->renderTestView()); } - public function test_component_renders_app_cdn_link_when_enabled_in_config() + public function testComponentRendersAppCdnLinkWhenEnabledInConfig() { config(['hyde.load_app_styles_from_cdn' => true]); $this->assertStringContainsString(Asset::cdnLink('app.css'), $this->renderTestView()); } - public function test_component_does_not_render_link_to_local_app_css_when_cdn_link_is_enabled_in_config() + public function testComponentDoesNotRenderLinkToLocalAppCssWhenCdnLinkIsEnabledInConfig() { config(['hyde.load_app_styles_from_cdn' => true]); $this->assertStringNotContainsString('renderTestView()); } - public function test_component_does_not_render_cdn_link_when_a_local_file_exists() + public function testComponentDoesNotRenderCdnLinkWhenALocalFileExists() { Filesystem::touch('_media/hyde.css'); $this->assertStringNotContainsString('https://cdn.jsdelivr.net/npm/hydefront', $this->renderTestView()); diff --git a/packages/hyde/composer.json b/packages/hyde/composer.json index 9d7bdc8cf57..be5b61f04f7 100644 --- a/packages/hyde/composer.json +++ b/packages/hyde/composer.json @@ -25,11 +25,11 @@ ], "require": { "php": "^8.1", - "hyde/framework": "^1.4", + "hyde/framework": "^1.5", "laravel-zero/framework": "^10.0" }, "require-dev": { - "hyde/realtime-compiler": "^3.2" + "hyde/realtime-compiler": "^3.3" }, "autoload": { "psr-4": { diff --git a/packages/hyde/tests/DefaultContentTest.php b/packages/hyde/tests/DefaultContentTest.php index 358d619c9ab..0da224d54c6 100644 --- a/packages/hyde/tests/DefaultContentTest.php +++ b/packages/hyde/tests/DefaultContentTest.php @@ -14,7 +14,7 @@ public static function setUpBeforeClass(): void self::needsKernel(); } - public function test_default_pages_are_present() + public function testDefaultPagesArePresent() { $this->assertFileExists(Hyde::path('_pages/index.blade.php')); $this->assertFileExists(Hyde::path('_pages/404.blade.php')); @@ -30,7 +30,7 @@ public function test_default_pages_are_present() ); } - public function test_default_compiled_stylesheet_is_present() + public function testDefaultCompiledStylesheetIsPresent() { $this->assertFileExists(Hyde::path('_media/app.css')); @@ -40,7 +40,7 @@ public function test_default_compiled_stylesheet_is_present() ); } - public function test_laravel_mix_resources_are_present() + public function testLaravelMixResourcesArePresent() { $this->assertFileExists(Hyde::path('resources/assets/app.css')); $this->assertFileExists(Hyde::path('resources/assets/app.js')); diff --git a/packages/hyde/tests/ExampleTest.php b/packages/hyde/tests/ExampleTest.php index d433f04adee..ebccc2b91e9 100644 --- a/packages/hyde/tests/ExampleTest.php +++ b/packages/hyde/tests/ExampleTest.php @@ -8,7 +8,7 @@ class ExampleTest extends UnitTestCase { - public function test_example() + public function testExample() { $this->assertTrue(true); } diff --git a/packages/hyde/tests/HydeCLITest.php b/packages/hyde/tests/HydeCLITest.php index df58abc3cae..bcf5e86cd27 100644 --- a/packages/hyde/tests/HydeCLITest.php +++ b/packages/hyde/tests/HydeCLITest.php @@ -8,7 +8,7 @@ class HydeCLITest extends TestCase { - public function test_can_show_hyde_console() + public function testCanShowHydeConsole() { $this->artisan('list') ->expectsOutputToContain('hyde') diff --git a/packages/hyde/tests/StaticSiteBuilderTest.php b/packages/hyde/tests/StaticSiteBuilderTest.php index 42960d2b2e2..41c73a302c8 100644 --- a/packages/hyde/tests/StaticSiteBuilderTest.php +++ b/packages/hyde/tests/StaticSiteBuilderTest.php @@ -10,7 +10,7 @@ class StaticSiteBuilderTest extends TestCase { - public function test_can_build_static_site() + public function testCanBuildStaticSite() { File::cleanDirectory(Hyde::path('_site')); diff --git a/packages/hydefront/dist/app.css b/packages/hydefront/dist/app.css index 1a4bda8d77f..8d86eec7b94 100644 --- a/packages/hydefront/dist/app.css +++ b/packages/hydefront/dist/app.css @@ -1,2 +1,2 @@ -/*! HydeFront v3.3.3 | MIT License | https://hydephp.com*/.hyde-search-context{margin-bottom:10px}.hyde-search-results{margin-top:1.25em;max-height:60vh;overflow-y:auto}#search-status{margin-top:0}#sidebar-toggle{display:inline-block;height:2rem;position:relative;width:2rem}#sidebar-toggle span.icon-bar{background-color:#000;display:block;height:2.375px;left:5.5px;position:absolute;transition:all .3s ease-out;width:20px}#sidebar-toggle span.icon-bar:first-child{top:9px}#sidebar-toggle span.icon-bar:nth-child(2),#sidebar-toggle span.icon-bar:nth-child(3){top:15px;transform-origin:center}#sidebar-toggle span.icon-bar:last-child{top:21px}#sidebar-toggle.active span.icon-bar:first-child{opacity:0}#sidebar-toggle.active span.icon-bar:nth-child(2){transform:rotate(45deg)}#sidebar-toggle.active span.icon-bar:nth-child(3){transform:rotate(-45deg)}#sidebar-toggle.active span.icon-bar:last-child{opacity:0}.dark #sidebar-toggle span.icon-bar{background-color:#fff;height:2px}.table-of-contents{padding-bottom:.75rem}.table-of-contents>li{margin-bottom:.35rem;margin-top:.15rem}.table-of-contents ul{padding-left:.5rem}.table-of-contents a{display:block;margin-left:-2rem;opacity:.825;padding-left:2rem}.table-of-contents a:before{content:"#";font-size:75%;margin-right:4px;opacity:.5;transition:opacity .3s ease-in-out}.table-of-contents a:hover{background-color:hsla(0,0%,50%,.2);opacity:1;transition:opacity,background .3s ease-in-out}.table-of-contents a:hover:before{opacity:1}#hyde-docs .prose h1,#hyde-docs .prose h2,#hyde-docs .prose h3,#hyde-docs .prose h4,#hyde-docs .prose h5,#hyde-docs .prose h6{width:-moz-fit-content;width:fit-content}#hyde-docs .prose h1:focus .heading-permalink,#hyde-docs .prose h1:hover .heading-permalink,#hyde-docs .prose h2:focus .heading-permalink,#hyde-docs .prose h2:hover .heading-permalink,#hyde-docs .prose h3:focus .heading-permalink,#hyde-docs .prose h3:hover .heading-permalink,#hyde-docs .prose h4:focus .heading-permalink,#hyde-docs .prose h4:hover .heading-permalink,#hyde-docs .prose h5:focus .heading-permalink,#hyde-docs .prose h5:hover .heading-permalink,#hyde-docs .prose h6:focus .heading-permalink,#hyde-docs .prose h6:hover .heading-permalink{filter:grayscale(100%);opacity:.75;transition:opacity .1s ease-out}#hyde-docs .prose h1 .heading-permalink,#hyde-docs .prose h2 .heading-permalink,#hyde-docs .prose h3 .heading-permalink,#hyde-docs .prose h4 .heading-permalink,#hyde-docs .prose h5 .heading-permalink,#hyde-docs .prose h6 .heading-permalink{margin-left:.25rem;opacity:0;padding:0 .25rem;scroll-margin:1rem;transition:opacity .3s ease}#hyde-docs .prose h1 .heading-permalink:focus,#hyde-docs .prose h1 .heading-permalink:hover,#hyde-docs .prose h2 .heading-permalink:focus,#hyde-docs .prose h2 .heading-permalink:hover,#hyde-docs .prose h3 .heading-permalink:focus,#hyde-docs .prose h3 .heading-permalink:hover,#hyde-docs .prose h4 .heading-permalink:focus,#hyde-docs .prose h4 .heading-permalink:hover,#hyde-docs .prose h5 .heading-permalink:focus,#hyde-docs .prose h5 .heading-permalink:hover,#hyde-docs .prose h6 .heading-permalink:focus,#hyde-docs .prose h6 .heading-permalink:hover{filter:unset;opacity:1}html{scroll-behavior:smooth}.torchlight-enabled pre{border-radius:.25rem;margin-bottom:1rem;margin-top:1rem;overflow-x:auto;padding:0}.torchlight-enabled pre code.torchlight{display:block;min-width:-moz-max-content;min-width:max-content;padding-bottom:1rem;padding-top:1rem}.torchlight-enabled pre code.torchlight .line{padding-left:1rem;padding-right:1rem}.torchlight-enabled pre code.torchlight .line-number,.torchlight-enabled pre code.torchlight .summary-caret{margin-right:1rem}.prose blockquote.info{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.prose blockquote.success{--tw-border-opacity:1;border-color:rgb(34 197 94/var(--tw-border-opacity))}.prose blockquote.warning{--tw-border-opacity:1;border-color:rgb(245 158 11/var(--tw-border-opacity))}.prose blockquote.danger{--tw-border-opacity:1;border-color:rgb(220 38 38/var(--tw-border-opacity))}code{display:inline-block;max-width:80vw;overflow-x:auto;vertical-align:top;word-break:break-all}pre code{display:block;max-width:unset}pre>code>.filepath{float:right;opacity:.5;position:relative;right:.25rem;top:-.25rem;transition:opacity .25s}pre>code>.filepath:hover{opacity:1}.torchlight-enabled pre>code>.filepath{right:1rem}@media screen and (max-width:767px){pre>code>.filepath{display:none}}@media screen and (min-width:768px){[x-cloak].x-uncloak-md{display:revert!important}} +/*! HydeFront v3.3.4 | MIT License | https://hydephp.com*/.hyde-search-context{margin-bottom:10px}.hyde-search-results{margin-top:1.25em;max-height:60vh;overflow-y:auto}#search-status{margin-top:0}#sidebar-toggle{display:inline-block;height:2rem;position:relative;width:2rem}#sidebar-toggle span.icon-bar{background-color:#000;display:block;height:2.375px;left:5.5px;position:absolute;transition:all .3s ease-out;width:20px}#sidebar-toggle span.icon-bar:first-child{top:9px}#sidebar-toggle span.icon-bar:nth-child(2),#sidebar-toggle span.icon-bar:nth-child(3){top:15px;transform-origin:center}#sidebar-toggle span.icon-bar:last-child{top:21px}#sidebar-toggle.active span.icon-bar:first-child{opacity:0}#sidebar-toggle.active span.icon-bar:nth-child(2){transform:rotate(45deg)}#sidebar-toggle.active span.icon-bar:nth-child(3){transform:rotate(-45deg)}#sidebar-toggle.active span.icon-bar:last-child{opacity:0}.dark #sidebar-toggle span.icon-bar{background-color:#fff;height:2px}.table-of-contents{padding-bottom:.75rem}.table-of-contents>li{margin-bottom:.35rem;margin-top:.15rem}.table-of-contents ul{padding-left:.5rem}.table-of-contents a{display:block;margin-left:-2rem;opacity:.825;padding-left:2rem}.table-of-contents a:before{content:"#";font-size:75%;margin-right:4px;opacity:.5;transition:opacity .3s ease-in-out}.table-of-contents a:hover{background-color:hsla(0,0%,50%,.2);opacity:1;transition:opacity,background .3s ease-in-out}.table-of-contents a:hover:before{opacity:1}#hyde-docs .prose h1,#hyde-docs .prose h2,#hyde-docs .prose h3,#hyde-docs .prose h4,#hyde-docs .prose h5,#hyde-docs .prose h6{width:-moz-fit-content;width:fit-content}#hyde-docs .prose h1:focus .heading-permalink,#hyde-docs .prose h1:hover .heading-permalink,#hyde-docs .prose h2:focus .heading-permalink,#hyde-docs .prose h2:hover .heading-permalink,#hyde-docs .prose h3:focus .heading-permalink,#hyde-docs .prose h3:hover .heading-permalink,#hyde-docs .prose h4:focus .heading-permalink,#hyde-docs .prose h4:hover .heading-permalink,#hyde-docs .prose h5:focus .heading-permalink,#hyde-docs .prose h5:hover .heading-permalink,#hyde-docs .prose h6:focus .heading-permalink,#hyde-docs .prose h6:hover .heading-permalink{filter:grayscale(100%);opacity:.75;transition:opacity .1s ease-out}#hyde-docs .prose h1 .heading-permalink,#hyde-docs .prose h2 .heading-permalink,#hyde-docs .prose h3 .heading-permalink,#hyde-docs .prose h4 .heading-permalink,#hyde-docs .prose h5 .heading-permalink,#hyde-docs .prose h6 .heading-permalink{margin-left:.25rem;opacity:0;padding:0 .25rem;scroll-margin:1rem;transition:opacity .3s ease;visibility:hidden}#hyde-docs .prose h1 .heading-permalink:focus,#hyde-docs .prose h1 .heading-permalink:hover,#hyde-docs .prose h2 .heading-permalink:focus,#hyde-docs .prose h2 .heading-permalink:hover,#hyde-docs .prose h3 .heading-permalink:focus,#hyde-docs .prose h3 .heading-permalink:hover,#hyde-docs .prose h4 .heading-permalink:focus,#hyde-docs .prose h4 .heading-permalink:hover,#hyde-docs .prose h5 .heading-permalink:focus,#hyde-docs .prose h5 .heading-permalink:hover,#hyde-docs .prose h6 .heading-permalink:focus,#hyde-docs .prose h6 .heading-permalink:hover{filter:unset;opacity:1;visibility:visible}html{scroll-behavior:smooth}.torchlight-enabled pre{border-radius:.25rem;margin-bottom:1rem;margin-top:1rem;overflow-x:auto;padding:0}.torchlight-enabled pre code.torchlight{display:block;min-width:-moz-max-content;min-width:max-content;padding-bottom:1rem;padding-top:1rem}.torchlight-enabled pre code.torchlight .line{padding-left:1rem;padding-right:1rem}.torchlight-enabled pre code.torchlight .line-number,.torchlight-enabled pre code.torchlight .summary-caret{margin-right:1rem}.prose blockquote.info{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.prose blockquote.success{--tw-border-opacity:1;border-color:rgb(34 197 94/var(--tw-border-opacity))}.prose blockquote.warning{--tw-border-opacity:1;border-color:rgb(245 158 11/var(--tw-border-opacity))}.prose blockquote.danger{--tw-border-opacity:1;border-color:rgb(220 38 38/var(--tw-border-opacity))}code{max-width:80vw;overflow-x:auto;vertical-align:top;word-break:break-all}pre code{display:block;max-width:unset}pre>code>.filepath{float:right;opacity:.5;position:relative;right:.25rem;top:-.25rem;transition:opacity .25s}pre>code>.filepath:hover{opacity:1}.torchlight-enabled pre>code>.filepath{right:1rem}@media screen and (max-width:767px){pre>code>.filepath{display:none}}@media screen and (min-width:768px){[x-cloak].x-uncloak-md{display:revert!important}} /*! tailwindcss v3.1.0 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:96ch}.prose :where([class~=lead]):not(:where([class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-bottom:1.2em;margin-top:1.2em}.prose :where(a):not(:where([class~=not-prose] *)){color:#5956eb;font-weight:500;text-decoration:none}.prose :where(a):not(:where([class~=not-prose] *)):hover{color:#4f46e5}.prose :where(strong):not(:where([class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(ol):not(:where([class~=not-prose] *)){list-style-type:decimal;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose] *)){list-style-type:disc;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(hr):not(:where([class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-bottom:3em;margin-top:3em}.prose :where(blockquote):not(:where([class~=not-prose] *)){background-color:#80808020;border-left-color:#d1d5db;border-left-width:.25rem;color:unset;font-style:unset;font-weight:500;line-height:1.25em;margin-bottom:1em;margin-top:1em;padding-bottom:.25em;padding-left:.75em;padding-top:.25em;quotes:"\201C""\201D""\2018""\2019"}.prose :where(blockquote):not(:where([class~=not-prose] *)) p{margin-bottom:.25em;margin-top:.25em;padding-right:.25em}.prose :where(blockquote):not(:where([class~=not-prose] *)) p:before{content:unset}.prose :where(blockquote):not(:where([class~=not-prose] *)) p:after{content:unset}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-size:2.25em;font-weight:800;line-height:1.1111111;margin-bottom:.8888889em;margin-top:0}.prose :where(h1 strong):not(:where([class~=not-prose] *)){font-weight:900}.prose :where(h2):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-size:1.5em;font-weight:700;line-height:1.3333333;margin-bottom:.75em;margin-top:1.5em}.prose :where(h2 strong):not(:where([class~=not-prose] *)){font-weight:800}.prose :where(h3):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-size:1.25em;font-weight:600;line-height:1.6;margin-bottom:.6em;margin-top:1.6em}.prose :where(h3 strong):not(:where([class~=not-prose] *)){font-weight:700}.prose :where(h4):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;line-height:1.5;margin-bottom:.5em;margin-top:1.5em}.prose :where(h4 strong):not(:where([class~=not-prose] *)){font-weight:700}.prose :where(figure>*):not(:where([class~=not-prose] *)){margin-bottom:0;margin-top:0}.prose :where(figcaption):not(:where([class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose :where(code):not(:where([class~=not-prose] *)){background-color:#80808033;border-radius:4px;color:var(--tw-prose-code);font-size:.875em;font-weight:600;font:unset;margin-left:-2px;margin-right:1px;padding-left:4px;padding-right:4px}.prose :where(code):not(:where([class~=not-prose] *)):before{content:unset}.prose :where(code):not(:where([class~=not-prose] *)):after{content:unset}.prose :where(a code):not(:where([class~=not-prose] *)){color:var(--tw-prose-links)}.prose :where(pre):not(:where([class~=not-prose] *)){background-color:var(--tw-prose-pre-bg);border-radius:.375rem;color:var(--tw-prose-pre-code);font-size:.875em;font-weight:400;line-height:1.7142857;margin-bottom:1.7142857em;margin-top:1.7142857em;overflow-x:auto;padding:.8571429em 1.1428571em}.prose :where(pre):not(:where([class~=not-prose] *)) code{font-family:Fira Code Regular,Consolas,Monospace,Courier New}.prose :where(pre code):not(:where([class~=not-prose] *)){background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;padding:0}.prose :where(pre code):not(:where([class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose] *)){font-size:.875em;line-height:1.7142857;margin-bottom:2em;margin-top:2em;table-layout:auto;text-align:left;width:100%}.prose :where(thead):not(:where([class~=not-prose] *)){border-bottom-color:var(--tw-prose-th-borders);border-bottom-width:1px}.prose :where(thead th):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;padding-bottom:.5714286em;padding-left:.5714286em;padding-right:.5714286em;vertical-align:bottom}.prose :where(tbody tr):not(:where([class~=not-prose] *)){border-bottom-color:var(--tw-prose-td-borders);border-bottom-width:1px}.prose :where(tbody tr:last-child):not(:where([class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose] *)){padding:.5714286em;vertical-align:baseline}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.5em}.prose :where(p):not(:where([class~=not-prose] *)){margin-bottom:1.25em;margin-top:1.25em}.prose :where(img):not(:where([class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(video):not(:where([class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(figure):not(:where([class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(h2 code):not(:where([class~=not-prose] *)){font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose] *)){font-size:.9em}.prose :where(li):not(:where([class~=not-prose] *)){margin-bottom:.5em;margin-top:.5em}.prose :where(ol>li):not(:where([class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose] *)){padding-left:.375em}.prose>:where(ul>li p):not(:where([class~=not-prose] *)){margin-bottom:.75em;margin-top:.75em}.prose>:where(ul>li>:first-child):not(:where([class~=not-prose] *)){margin-top:1.25em}.prose>:where(ul>li>:last-child):not(:where([class~=not-prose] *)){margin-bottom:1.25em}.prose>:where(ol>li>:first-child):not(:where([class~=not-prose] *)){margin-top:1.25em}.prose>:where(ol>li>:last-child):not(:where([class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose] *)){margin-bottom:.75em;margin-top:.75em}.prose :where(hr+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose] *)){padding-right:0}.prose :where(tbody td:first-child):not(:where([class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child):not(:where([class~=not-prose] *)){padding-right:0}.prose>:where(:first-child):not(:where([class~=not-prose] *)){margin-top:0}.prose>:where(:last-child):not(:where([class~=not-prose] *)){margin-bottom:0}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-80{left:20rem}.left-0{left:0}.right-0{right:0}.top-auto{top:auto}.top-16{top:4rem}.top-0{top:0}.right-4{right:1rem}.top-4{top:1rem}.bottom-4{bottom:1rem}.-left-64{left:-16rem}.bottom-0{bottom:0}.z-50{z-index:50}.z-40{z-index:40}.z-10{z-index:10}.z-30{z-index:30}.float-right{float:right}.float-left{float:left}.m-8{margin:2rem}.m-2{margin:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.my-4{margin-bottom:1rem;margin-top:1rem}.my-8{margin-bottom:2rem;margin-top:2rem}.mx-0{margin-left:0;margin-right:0}.mx-4{margin-left:1rem;margin-right:1rem}.mx-8{margin-left:2rem;margin-right:2rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-1{margin-bottom:.25rem;margin-top:.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.mb-8{margin-bottom:2rem}.mb-4{margin-bottom:1rem}.mt-2{margin-top:.5rem}.mt-8{margin-top:2rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.mt-3{margin-top:.75rem}.mr-1{margin-right:.25rem}.mr-4{margin-right:1rem}.mb-3{margin-bottom:.75rem}.-mb-2{margin-bottom:-.5rem}.-ml-4{margin-left:-1rem}.-ml-8{margin-left:-2rem}.-ml-2{margin-left:-.5rem}.ml-4{margin-left:1rem}.mb-2{margin-bottom:.5rem}.-ml-6{margin-left:-1.5rem}.mb-0{margin-bottom:0}.block{display:block}.inline{display:inline}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-auto{height:auto}.h-6{height:1.5rem}.h-16{height:4rem}.h-8{height:2rem}.h-screen{height:100vh}.h-0{height:0}.h-full{height:100%}.h-5{height:1.25rem}.max-h-\[75vh\]{max-height:75vh}.min-h-screen{min-height:100vh}.min-h-\[calc\(100vh_-_4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-\[300px\]{min-height:300px}.w-1{width:.25rem}.w-full{width:100%}.w-16{width:4rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-screen{width:100vw}.w-6{width:1.5rem}.w-\[70ch\]{width:70ch}.w-64{width:16rem}.w-5{width:1.25rem}.max-w-sm{max-width:24rem}.max-w-7xl{max-width:80rem}.max-w-lg{max-width:32rem}.max-w-3xl{max-width:48rem}.max-w-xs{max-width:20rem}.max-w-\[1000px\]{max-width:1000px}.max-w-full{max-width:100%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-auto{cursor:auto}.cursor-pointer{cursor:pointer}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border-2{border-width:2px}.border-4{border-width:4px}.border-y{border-bottom-width:1px}.border-t,.border-y{border-top-width:1px}.border-b-4{border-bottom-width:4px}.border-b{border-bottom-width:1px}.border-l-\[0\.325rem\]{border-left-width:.325rem}.border-l-4{border-left-width:4px}.border-yellow-400{--tw-border-opacity:1;border-color:rgb(250 204 21/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-indigo-400{--tw-border-opacity:1;border-color:rgb(129 140 248/var(--tw-border-opacity))}.border-indigo-500{--tw-border-opacity:1;border-color:rgb(89 86 235/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-black\/50{background-color:rgba(0,0,0,.5)}.bg-black\/5{background-color:rgba(0,0,0,.05)}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-cover{background-size:cover}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-no-repeat{background-repeat:no-repeat}.fill-current{fill:currentColor}.fill-black{fill:#000}.p-4{padding:1rem}.p-12{padding:3rem}.p-2{padding:.5rem}.py-0{padding-bottom:0;padding-top:0}.py-4{padding-bottom:1rem;padding-top:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.px-0{padding-left:0;padding-right:0}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-32{padding-bottom:8rem;padding-top:8rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-16{padding-bottom:4rem;padding-top:4rem}.py-12{padding-bottom:3rem;padding-top:3rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-24{padding-bottom:6rem;padding-top:6rem}.pb-12{padding-bottom:3rem}.pt-3{padding-top:.75rem}.pb-3{padding-bottom:.75rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-5xl{font-size:3rem;line-height:1}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[90\%\]{font-size:90%}.text-base{font-size:1rem;line-height:1.5rem}.font-black{font-weight:900}.font-light{font-weight:300}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-normal{line-height:1.5}.leading-10{line-height:2.5rem}.leading-relaxed{line-height:1.625}.leading-8{line-height:2rem}.leading-4{line-height:1rem}.tracking-wide{letter-spacing:.025em}.tracking-tight{letter-spacing:-.025em}.tracking-normal{letter-spacing:0}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-transparent{color:transparent}.text-gray-200{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity:1;color:rgb(89 86 235/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity))}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-75{opacity:.75}.opacity-50{opacity:.5}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.drop-shadow-2xl{--tw-drop-shadow:drop-shadow(0 25px 25px rgba(0,0,0,.15));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,fill,stroke,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{transition-duration:75ms}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[x-cloak]{display:none!important}.hover\:bg-black\/10:hover{background-color:rgba(0,0,0,.1)}.hover\:bg-black\/5:hover{background-color:rgba(0,0,0,.05)}.hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.hover\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:not-sr-only:focus{clip:auto;height:auto;margin:0;overflow:visible;padding:0;position:static;white-space:normal;width:auto}.focus\:absolute:focus{position:absolute}.focus\:mx-auto:focus{margin-left:auto;margin-right:auto}.focus\:mt-2:focus{margin-top:.5rem}.focus\:w-64:focus{width:16rem}.focus\:p-2:focus{padding:.5rem}.group:hover .group-hover\:opacity-100{opacity:1}.prose-h1\:mb-3 :is(:where(h1):not(:where([class~=not-prose] *))){margin-bottom:.75rem}.prose-p\:my-3 :is(:where(p):not(:where([class~=not-prose] *))){margin-bottom:.75rem;margin-top:.75rem}.prose-img\:inline :is(:where(img):not(:where([class~=not-prose] *))){display:inline}.dark .dark\:prose-invert{--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}.dark .dark\:prose-invert :where(a):not(:where([class~=not-prose] *)){color:#818cf8}.dark .dark\:prose-invert :where(a):not(:where([class~=not-prose] *)):hover{color:#6366f1}.dark .dark\:block{display:block}.dark .dark\:hidden{display:none}.dark .dark\:border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}.dark .dark\:border-\[\#1b2533\]{--tw-border-opacity:1;border-color:rgb(27 37 51/var(--tw-border-opacity))}.dark .dark\:bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.dark .dark\:bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.dark .dark\:bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.dark .dark\:bg-black\/10{background-color:rgba(0,0,0,.1)}.dark .dark\:bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.dark .dark\:fill-gray-200{fill:#e5e7eb}.dark .dark\:fill-white{fill:#fff}.dark .dark\:font-medium{font-weight:500}.dark .dark\:text-gray-200{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.dark .dark\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.dark .dark\:text-indigo-400{--tw-text-opacity:1;color:rgb(129 140 248/var(--tw-text-opacity))}.dark .dark\:text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.dark .dark\:hover\:bg-black\/10:hover{background-color:rgba(0,0,0,.1)}.dark .dark\:hover\:text-white:hover,.dark .group:hover .dark\:group-hover\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}@media (min-width:640px){.sm\:mb-0{margin-bottom:0}.sm\:mt-4{margin-top:1rem}.sm\:flex{display:flex}.sm\:leading-none{line-height:1}.sm\:shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}}@media (min-width:768px){.md\:visible{visibility:visible}.md\:top-0{top:0}.md\:left-64{left:16rem}.md\:left-0{left:0}.md\:my-6{margin-bottom:1.5rem;margin-top:1.5rem}.md\:mx-2{margin-left:.5rem;margin-right:.5rem}.md\:my-0{margin-bottom:0;margin-top:0}.md\:mt-8{margin-top:2rem}.md\:mb-12{margin-bottom:3rem}.md\:mt-0{margin-top:0}.md\:ml-0{margin-left:0}.md\:block{display:block}.md\:inline-block{display:inline-block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:min-h-screen{min-height:100vh}.md\:w-1\/2{width:50%}.md\:w-\[calc\(100vw_-_16rem\)\]{width:calc(100vw - 16rem)}.md\:w-auto{width:auto}.md\:max-w-none{max-width:none}.md\:max-w-2xl{max-width:42rem}.md\:flex-grow-0{flex-grow:0}.md\:flex-grow{flex-grow:1}.md\:items-center{align-items:center}.md\:border-none{border-style:none}.md\:bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.md\:bg-transparent{background-color:transparent}.md\:bg-left{background-position:0}.md\:py-0{padding-bottom:0;padding-top:0}.md\:px-16{padding-left:4rem;padding-right:4rem}.md\:py-16{padding-bottom:4rem;padding-top:4rem}.md\:pb-0{padding-bottom:0}.md\:pl-0{padding-left:0}.md\:text-center{text-align:center}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-6xl{font-size:3.75rem;line-height:1}.md\:text-5xl{font-size:3rem;line-height:1}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.dark .dark\:md\:bg-transparent{background-color:transparent}}@media (min-width:1024px){.lg\:mb-12{margin-bottom:3rem}.lg\:ml-8{margin-left:2rem}.lg\:bg-center{background-position:50%}.lg\:text-7xl{font-size:4.5rem;line-height:1}.lg\:text-lg{font-size:1.125rem;line-height:1.75rem}.lg\:text-5xl{font-size:3rem;line-height:1}}@media (min-width:1280px){.xl\:mb-16{margin-bottom:4rem}} diff --git a/packages/hydefront/dist/hyde.css b/packages/hydefront/dist/hyde.css index c58d7974a04..a582894378d 100644 --- a/packages/hydefront/dist/hyde.css +++ b/packages/hydefront/dist/hyde.css @@ -1,2 +1,2 @@ -/*! HydeFront v3.3.3 | MIT License | https://hydephp.com*/ +/*! HydeFront v3.3.4 | MIT License | https://hydephp.com*/ .hyde-search-context{margin-bottom:10px}.hyde-search-results{max-height:60vh;overflow-y:auto;margin-top:1.25em}#search-status{margin-top:0}#sidebar-toggle{position:relative;display:inline-block;width:2rem;height:2rem}#sidebar-toggle span.icon-bar{display:block;width:20px;height:2.375px;background-color:#000;position:absolute;left:5.5px;transition:all .3s ease-out}#sidebar-toggle span.icon-bar:first-child{top:9px}#sidebar-toggle span.icon-bar:nth-child(2),#sidebar-toggle span.icon-bar:nth-child(3){top:15px;transform-origin:center}#sidebar-toggle span.icon-bar:last-child{top:21px}#sidebar-toggle.active span.icon-bar:first-child{opacity:0}#sidebar-toggle.active span.icon-bar:nth-child(2){transform:rotate(45deg)}#sidebar-toggle.active span.icon-bar:nth-child(3){transform:rotate(-45deg)}#sidebar-toggle.active span.icon-bar:last-child{opacity:0}.dark #sidebar-toggle span.icon-bar{background-color:#fff;height:2px}.table-of-contents{padding-bottom:.75rem}.table-of-contents>li{margin-top:.15rem;margin-bottom:.35rem}.table-of-contents ul{padding-left:.5rem}.table-of-contents a{display:block;padding-left:2rem;margin-left:-2rem;opacity:.825}.table-of-contents a::before{content:"#";font-size:75%;opacity:.5;margin-right:4px;transition:opacity .3s ease-in-out}.table-of-contents a:hover{opacity:1;transition:opacity,background .3s ease-in-out;background-color:rgba(128,128,128,.2)}.table-of-contents a:hover::before{opacity:1}#hyde-docs .prose h1,#hyde-docs .prose h2,#hyde-docs .prose h3,#hyde-docs .prose h4,#hyde-docs .prose h5,#hyde-docs .prose h6{width:fit-content}#hyde-docs .prose h1:hover .heading-permalink,#hyde-docs .prose h1:focus .heading-permalink,#hyde-docs .prose h2:hover .heading-permalink,#hyde-docs .prose h2:focus .heading-permalink,#hyde-docs .prose h3:hover .heading-permalink,#hyde-docs .prose h3:focus .heading-permalink,#hyde-docs .prose h4:hover .heading-permalink,#hyde-docs .prose h4:focus .heading-permalink,#hyde-docs .prose h5:hover .heading-permalink,#hyde-docs .prose h5:focus .heading-permalink,#hyde-docs .prose h6:hover .heading-permalink,#hyde-docs .prose h6:focus .heading-permalink{opacity:.75;filter:grayscale(100%);transition:opacity .1s ease-out}#hyde-docs .prose h1 .heading-permalink,#hyde-docs .prose h2 .heading-permalink,#hyde-docs .prose h3 .heading-permalink,#hyde-docs .prose h4 .heading-permalink,#hyde-docs .prose h5 .heading-permalink,#hyde-docs .prose h6 .heading-permalink{opacity:0;visibility:hidden;margin-left:.25rem;transition:opacity .3s ease;padding:0 .25rem;scroll-margin:1rem}#hyde-docs .prose h1 .heading-permalink:hover,#hyde-docs .prose h1 .heading-permalink:focus,#hyde-docs .prose h2 .heading-permalink:hover,#hyde-docs .prose h2 .heading-permalink:focus,#hyde-docs .prose h3 .heading-permalink:hover,#hyde-docs .prose h3 .heading-permalink:focus,#hyde-docs .prose h4 .heading-permalink:hover,#hyde-docs .prose h4 .heading-permalink:focus,#hyde-docs .prose h5 .heading-permalink:hover,#hyde-docs .prose h5 .heading-permalink:focus,#hyde-docs .prose h6 .heading-permalink:hover,#hyde-docs .prose h6 .heading-permalink:focus{opacity:1;visibility:visible;filter:unset}html{scroll-behavior:smooth}.torchlight-enabled pre{border-radius:.25rem;margin-top:1rem;margin-bottom:1rem;overflow-x:auto;padding:0}.torchlight-enabled pre code.torchlight{display:block;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding-top:1rem;padding-bottom:1rem}.torchlight-enabled pre code.torchlight .line{padding-left:1rem;padding-right:1rem}.torchlight-enabled pre code.torchlight .line-number,.torchlight-enabled pre code.torchlight .summary-caret{margin-right:1rem}.prose blockquote.info{@apply border-blue-500}.prose blockquote.success{@apply border-green-500}.prose blockquote.warning{@apply border-amber-500}.prose blockquote.danger{@apply border-red-600}code{max-width:80vw;overflow-x:auto;vertical-align:top;word-break:break-all}pre code{display:block;max-width:unset}pre>code>.filepath{position:relative;top:-0.25rem;right:.25rem;float:right;opacity:.5;transition:opacity .25s}pre>code>.filepath:hover{opacity:1}.torchlight-enabled pre>code>.filepath{right:1rem}@media screen and (max-width: 767px){pre>code>.filepath{display:none}}@media screen and (min-width: 768px){[x-cloak].x-uncloak-md{display:revert !important}}/*# sourceMappingURL=hyde.css.map */ diff --git a/packages/hydefront/package-lock.json b/packages/hydefront/package-lock.json index d4c9b835ba8..25a2d68b1aa 100644 --- a/packages/hydefront/package-lock.json +++ b/packages/hydefront/package-lock.json @@ -1,12 +1,12 @@ { "name": "hydefront", - "version": "3.3.3", + "version": "3.3.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "hydefront", - "version": "3.3.3", + "version": "3.3.4", "license": "MIT", "devDependencies": { "sass": "1.50.0" diff --git a/packages/hydefront/package.json b/packages/hydefront/package.json index a55490a29fb..a4fcab08610 100644 --- a/packages/hydefront/package.json +++ b/packages/hydefront/package.json @@ -1,6 +1,6 @@ { "name": "hydefront", - "version": "3.3.3", + "version": "3.3.4", "description": "Frontend assets for HydePHP", "scripts": { "prod": "sass hyde.scss dist/hyde.css --style=compressed && php .github/scripts/post-build.php --inject-version", diff --git a/packages/publications/src/Concerns/PublicationFieldTypes.php b/packages/publications/src/Concerns/PublicationFieldTypes.php index ca48a4a5f81..b09bf0791d3 100644 --- a/packages/publications/src/Concerns/PublicationFieldTypes.php +++ b/packages/publications/src/Concerns/PublicationFieldTypes.php @@ -72,7 +72,7 @@ public static function getRules(self $type): array /** * The types that can be used for canonical fields (used to generate file names). * - * @return \Hyde\Publications\PublicationFieldTypes[] + * @return \Hyde\Publications\Concerns\PublicationFieldTypes[] */ public static function canonicable(): array { @@ -87,7 +87,7 @@ public static function canonicable(): array /** * The types that can be array values. * - * @return \Hyde\Publications\PublicationFieldTypes[] + * @return \Hyde\Publications\Concerns\PublicationFieldTypes[] */ public static function arrayable(): array { diff --git a/packages/publications/tests/Feature/CreatesNewPublicationTypeTest.php b/packages/publications/tests/Feature/CreatesNewPublicationTypeTest.php index d3cccea3fc3..a2cf634badc 100644 --- a/packages/publications/tests/Feature/CreatesNewPublicationTypeTest.php +++ b/packages/publications/tests/Feature/CreatesNewPublicationTypeTest.php @@ -26,7 +26,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_it_creates_a_new_publication_type() + public function testItCreatesANewPublicationType() { $creator = new CreatesNewPublicationType( 'Test Publication', @@ -54,7 +54,7 @@ public function test_it_creates_a_new_publication_type() ); } - public function test_create_with_default_parameters() + public function testCreateWithDefaultParameters() { $creator = new CreatesNewPublicationType( 'Test Publication', @@ -78,7 +78,7 @@ public function test_create_with_default_parameters() ); } - public function test_it_creates_list_and_detail_pages() + public function testItCreatesListAndDetailPages() { $creator = new CreatesNewPublicationType( 'Test Publication', @@ -98,7 +98,7 @@ public function test_it_creates_list_and_detail_pages() ); } - public function test_it_uses_the_paginated_list_view_when_pagination_is_enabled() + public function testItUsesThePaginatedListViewWhenPaginationIsEnabled() { $creator = new CreatesNewPublicationType( 'Test Publication', diff --git a/packages/publications/tests/Feature/GeneratesPublicationTagPagesTest.php b/packages/publications/tests/Feature/GeneratesPublicationTagPagesTest.php index e556cb9f47f..3a18efd4ab8 100644 --- a/packages/publications/tests/Feature/GeneratesPublicationTagPagesTest.php +++ b/packages/publications/tests/Feature/GeneratesPublicationTagPagesTest.php @@ -16,7 +16,7 @@ */ class GeneratesPublicationTagPagesTest extends TestCase { - public function test_tags_index_page_is_generated_when_tags_are_used() + public function testTagsIndexPageIsGeneratedWhenTagsAreUsed() { $this->directory('test-publication'); @@ -48,7 +48,7 @@ public function test_tags_index_page_is_generated_when_tags_are_used() ], $booted->getPages()->keys()->toArray()); } - public function test_tags_index_page_is_not_generated_when_tags_are_not_used() + public function testTagsIndexPageIsNotGeneratedWhenTagsAreNotUsed() { $booted = PageCollection::init(Hyde::getInstance())->boot(); @@ -58,7 +58,7 @@ public function test_tags_index_page_is_not_generated_when_tags_are_not_used() ], $booted->getPages()->keys()->toArray()); } - public function test_tags_pages_for_publications_are_generated_for_used_tag() + public function testTagsPagesForPublicationsAreGeneratedForUsedTag() { $this->directory('publication'); (new PublicationType('publication', fields: [ @@ -78,7 +78,7 @@ public function test_tags_pages_for_publications_are_generated_for_used_tag() ], $booted->getPages()->keys()->toArray()); } - public function test_tags_pages_for_publications_are_generated_for_used_tags_with_publication_tags_array() + public function testTagsPagesForPublicationsAreGeneratedForUsedTagsWithPublicationTagsArray() { $this->directory('publication'); (new PublicationType('publication', fields: [ @@ -99,7 +99,7 @@ public function test_tags_pages_for_publications_are_generated_for_used_tags_wit ], $booted->getPages()->keys()->toArray()); } - public function test_tags_pages_for_publications_are_not_generated_when_no_tags_are_used() + public function testTagsPagesForPublicationsAreNotGeneratedWhenNoTagsAreUsed() { $this->createPublication(); (new PublicationType('publication', fields: [ @@ -116,7 +116,7 @@ public function test_tags_pages_for_publications_are_not_generated_when_no_tags_ ], $booted->getPages()->keys()->toArray()); } - public function test_generated_index_page() + public function testGeneratedIndexPage() { $this->createPublication(); (new PublicationType('publication', fields: [ @@ -140,7 +140,7 @@ public function test_generated_index_page() $this->assertSame(['tags' => ['bar' => 2, 'foo' => 1]], $page->matter->toArray()); } - public function test_generated_detail_page() + public function testGeneratedDetailPage() { $this->createPublication(); (new PublicationType('publication', fields: [ diff --git a/packages/publications/tests/Feature/MakePublicationCommandTest.php b/packages/publications/tests/Feature/MakePublicationCommandTest.php index 3c0ecbb7c5a..67d73162436 100644 --- a/packages/publications/tests/Feature/MakePublicationCommandTest.php +++ b/packages/publications/tests/Feature/MakePublicationCommandTest.php @@ -37,7 +37,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_command_creates_publication() + public function testCommandCreatesPublication() { $this->makeSchemaFile(); @@ -53,7 +53,7 @@ public function test_command_creates_publication() $this->assertPublicationFileWasCreatedCorrectly(); } - public function test_command_with_no_publication_types() + public function testCommandWithNoPublicationTypes() { $this->throwOnConsoleException(false); $this->artisan('make:publication') @@ -62,7 +62,7 @@ public function test_command_with_no_publication_types() ->assertExitCode(1); } - public function test_command_selects_the_right_publication_using_the_names() + public function testCommandSelectsTheRightPublicationUsingTheNames() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', @@ -104,7 +104,7 @@ public function test_command_selects_the_right_publication_using_the_names() ->assertExitCode(0); } - public function test_command_with_existing_publication() + public function testCommandWithExistingPublication() { $this->makeSchemaFile(); file_put_contents(Hyde::path('test-publication/hello-world.md'), 'foo'); @@ -122,7 +122,7 @@ public function test_command_with_existing_publication() $this->assertSame('foo', file_get_contents(Hyde::path('test-publication/hello-world.md'))); } - public function test_command_with_existing_publication_and_overwrite() + public function testCommandWithExistingPublicationAndOverwrite() { $this->makeSchemaFile(); file_put_contents(Hyde::path('test-publication/hello-world.md'), 'foo'); @@ -138,7 +138,7 @@ public function test_command_with_existing_publication_and_overwrite() $this->assertNotEquals('foo', file_get_contents(Hyde::path('test-publication/hello-world.md'))); } - public function test_can_overwrite_existing_publication_by_passing_force_flag() + public function testCanOverwriteExistingPublicationByPassingForceFlag() { $this->makeSchemaFile(); file_put_contents(Hyde::path('test-publication/hello-world.md'), 'foo'); @@ -152,7 +152,7 @@ public function test_can_overwrite_existing_publication_by_passing_force_flag() $this->assertNotEquals('foo', file_get_contents(Hyde::path('test-publication/hello-world.md'))); } - public function test_command_with_publication_type_passed_as_argument() + public function testCommandWithPublicationTypePassedAsArgument() { $this->makeSchemaFile(); @@ -166,7 +166,7 @@ public function test_command_with_publication_type_passed_as_argument() $this->assertPublicationFileWasCreatedCorrectly(); } - public function test_command_with_invalid_publication_type_passed_as_argument() + public function testCommandWithInvalidPublicationTypePassedAsArgument() { $this->throwOnConsoleException(false); $this->makeSchemaFile(); @@ -176,7 +176,7 @@ public function test_command_with_invalid_publication_type_passed_as_argument() ->assertExitCode(1); } - public function test_command_with_schema_using_canonical_meta_field() + public function testCommandWithSchemaUsingCanonicalMetaField() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', @@ -199,7 +199,7 @@ public function test_command_with_schema_using_canonical_meta_field() MARKDOWN, file_get_contents(Hyde::path('test-publication/2022-01-01-000000.md'))); } - public function test_command_does_not_ask_user_to_fill_in_meta_fields() + public function testCommandDoesNotAskUserToFillInMetaFields() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', @@ -217,7 +217,7 @@ public function test_command_does_not_ask_user_to_fill_in_meta_fields() $this->assertDatedPublicationExists(); } - public function test_command_with_text_input() + public function testCommandWithTextInput() { InputStreamHandler::mockInput("Hello\nWorld\n<<<"); $this->makeSchemaFile([ @@ -239,7 +239,7 @@ public function test_command_with_text_input() ); } - public function test_command_with_boolean_input() + public function testCommandWithBooleanInput() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', @@ -257,7 +257,7 @@ public function test_command_with_boolean_input() $this->assertCreatedPublicationMatterEquals('published: true'); } - public function test_command_with_array_input() + public function testCommandWithArrayInput() { InputStreamHandler::mockInput("First Tag\nSecond Tag\nThird Tag\n<<<"); $this->makeSchemaFile([ @@ -281,7 +281,7 @@ public function test_command_with_array_input() ); } - public function test_command_with_media_input() + public function testCommandWithMediaInput() { $this->directory('_media/test-publication'); $this->file('_media/test-publication/image.jpg'); @@ -302,7 +302,7 @@ public function test_command_with_media_input() $this->assertCreatedPublicationMatterEquals('media: _media/test-publication/image.jpg'); } - public function test_media_input_selects_the_right_file() + public function testMediaInputSelectsTheRightFile() { $this->directory('_media/test-publication'); $this->file('_media/test-publication/foo.jpg'); @@ -326,7 +326,7 @@ public function test_media_input_selects_the_right_file() $this->assertCreatedPublicationMatterEquals('media: _media/test-publication/bar.png'); } - public function test_command_with_single_tag_input() + public function testCommandWithSingleTagInput() { $this->markdown('test-publication/existing.md', matter: [ 'tag' => ['foo', 'bar', 'baz'], @@ -350,7 +350,7 @@ public function test_command_with_single_tag_input() $this->assertCreatedPublicationMatterEquals("tag:\n - foo"); } - public function test_command_with_multiple_tag_inputs() + public function testCommandWithMultipleTagInputs() { $this->markdown('test-publication/existing.md', matter: [ 'tags' => ['foo', 'bar', 'baz'], @@ -375,7 +375,7 @@ public function test_command_with_multiple_tag_inputs() - bar'); } - public function test_media_input_with_no_images() + public function testMediaInputWithNoImages() { $this->throwOnConsoleException(false); $this->makeSchemaFile([ @@ -396,7 +396,7 @@ public function test_media_input_with_no_images() $this->assertFileDoesNotExist(Hyde::path('test-publication/2022-01-01-000000.md')); } - public function test_media_input_with_no_files_but_skips() + public function testMediaInputWithNoFilesButSkips() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', @@ -426,7 +426,7 @@ public function test_media_input_with_no_files_but_skips() MARKDOWN, $this->getDatedPublicationContents()); } - public function test_tag_input_with_no_tags() + public function testTagInputWithNoTags() { $this->throwOnConsoleException(false); $this->makeSchemaFile([ @@ -445,7 +445,7 @@ public function test_tag_input_with_no_tags() $this->assertFileExists(Hyde::path('test-publication/2022-01-01-000000.md')); } - public function test_handleEmptyOptionsCollection_for_required_field() + public function testHandleEmptyOptionsCollectionForRequiredField() { $this->throwOnConsoleException(false); $this->makeSchemaFile([ @@ -464,7 +464,7 @@ public function test_handleEmptyOptionsCollection_for_required_field() ->assertExitCode(1); } - public function test_with_custom_validation_rules() + public function testWithCustomValidationRules() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', @@ -488,7 +488,7 @@ public function test_with_custom_validation_rules() $this->assertCreatedPublicationMatterEquals('integer: 5'); } - public function test_with_skipping_inputs() + public function testWithSkippingInputs() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', diff --git a/packages/publications/tests/Feature/MakePublicationTypeCommandTest.php b/packages/publications/tests/Feature/MakePublicationTypeCommandTest.php index 9fda7c52d06..f50541cef32 100644 --- a/packages/publications/tests/Feature/MakePublicationTypeCommandTest.php +++ b/packages/publications/tests/Feature/MakePublicationTypeCommandTest.php @@ -33,7 +33,7 @@ protected function tearDown(): void parent::tearDown(); } - public function test_command_creates_publication_type() + public function testCommandCreatesPublicationType() { $this->artisan('make:publicationType') ->expectsQuestion('Publication type name', 'Test Publication') @@ -100,7 +100,7 @@ public function test_command_creates_publication_type() $this->assertStringContainsString('paginator', file_get_contents(Hyde::path('test-publication/list.blade.php'))); } - public function test_with_default_values() + public function testWithDefaultValues() { // When running this command with the no-interaction flag in an actual console, no questions are asked. // However, when running it in a test, the questions are still asked, presumably due to a vendor bug. @@ -137,7 +137,7 @@ public function test_with_default_values() $this->assertStringNotContainsString('paginator', file_get_contents(Hyde::path('test-publication/list.blade.php'))); } - public function test_with_multiple_fields_of_the_same_name() + public function testWithMultipleFieldsOfTheSameName() { $this->artisan('make:publicationType "Test Publication"') @@ -166,7 +166,7 @@ public function test_with_multiple_fields_of_the_same_name() ->assertExitCode(0); } - public function test_with_existing_file_of_the_same_name() + public function testWithExistingFileOfTheSameName() { $this->throwOnConsoleException(false); @@ -177,7 +177,7 @@ public function test_with_existing_file_of_the_same_name() ->assertExitCode(1); } - public function test_with_existing_publication_of_the_same_name() + public function testWithExistingPublicationOfTheSameName() { $this->throwOnConsoleException(false); diff --git a/packages/publications/tests/Feature/PublicationFieldDefinitionTest.php b/packages/publications/tests/Feature/PublicationFieldDefinitionTest.php index 35c9e95cc17..1cb35e732a5 100644 --- a/packages/publications/tests/Feature/PublicationFieldDefinitionTest.php +++ b/packages/publications/tests/Feature/PublicationFieldDefinitionTest.php @@ -14,7 +14,7 @@ */ class PublicationFieldDefinitionTest extends TestCase { - public function test_can_instantiate_class() + public function testCanInstantiateClass() { $field = new PublicationFieldDefinition('string', 'test'); $this->assertInstanceOf(PublicationFieldDefinition::class, $field); @@ -23,7 +23,7 @@ public function test_can_instantiate_class() $this->assertSame('test', $field->name); } - public function test_from_array_method() + public function testFromArrayMethod() { $field = PublicationFieldDefinition::fromArray([ 'type' => 'string', @@ -36,7 +36,7 @@ public function test_from_array_method() $this->assertSame('test', $field->name); } - public function test_can_get_field_as_array() + public function testCanGetFieldAsArray() { $this->assertSame([ 'type' => 'string', @@ -44,7 +44,7 @@ public function test_can_get_field_as_array() ], (new PublicationFieldDefinition('string', 'test'))->toArray()); } - public function test_can_get_field_with_optional_properties_as_array() + public function testCanGetFieldWithOptionalPropertiesAsArray() { $this->assertSame([ 'type' => 'string', @@ -53,12 +53,12 @@ public function test_can_get_field_with_optional_properties_as_array() ], (new PublicationFieldDefinition('string', 'test', ['required']))->toArray()); } - public function test_can_encode_field_as_json() + public function testCanEncodeFieldAsJson() { $this->assertSame('{"type":"string","name":"test"}', json_encode(new PublicationFieldDefinition('string', 'test'))); } - public function test_can_get_field_with_optional_properties_as_json() + public function testCanGetFieldWithOptionalPropertiesAsJson() { $this->assertSame('{"type":"string","name":"test","rules":["required"]}', json_encode(new PublicationFieldDefinition('string', 'test', @@ -66,7 +66,7 @@ public function test_can_get_field_with_optional_properties_as_json() ))); } - public function test_can_construct_type_using_enum_case() + public function testCanConstructTypeUsingEnumCase() { $field1 = new PublicationFieldDefinition(PublicationFieldTypes::String, 'test'); $this->assertSame(PublicationFieldTypes::String, $field1->type); @@ -77,32 +77,32 @@ public function test_can_construct_type_using_enum_case() $this->assertEquals($field1, $field2); } - public function test_type_must_be_valid() + public function testTypeMustBeValid() { $this->expectException(ValueError::class); new PublicationFieldDefinition('invalid', 'test'); } - public function test_type_input_is_case_insensitive() + public function testTypeInputIsCaseInsensitive() { $field = new PublicationFieldDefinition('STRING', 'test'); $this->assertSame(PublicationFieldTypes::String, $field->type); } - public function test_name_gets_stored_as_kebab_case() + public function testNameGetsStoredAsKebabCase() { $field = new PublicationFieldDefinition('string', 'Test Field'); $this->assertSame('test-field', $field->name); } - public function test_get_rules() + public function testGetRules() { $field = new PublicationFieldDefinition('string', 'test'); $this->assertSame(['string'], $field->getRules()); } - public function test_get_rules_with_custom_type_rules() + public function testGetRulesWithCustomTypeRules() { $field = new PublicationFieldDefinition('string', 'test', ['required', 'foo']); $this->assertSame(['string', 'required', 'foo'], $field->getRules()); diff --git a/packages/publications/tests/Feature/PublicationListPageTest.php b/packages/publications/tests/Feature/PublicationListPageTest.php index 5d4d50acc06..14c41479948 100644 --- a/packages/publications/tests/Feature/PublicationListPageTest.php +++ b/packages/publications/tests/Feature/PublicationListPageTest.php @@ -15,7 +15,7 @@ */ class PublicationListPageTest extends TestCase { - public function test_source_path_mappings() + public function testSourcePathMappings() { $this->createPublicationFiles(); @@ -28,7 +28,7 @@ public function test_source_path_mappings() File::deleteDirectory(Hyde::path('test-publication')); } - public function test_listing_page_can_be_compiled() + public function testListingPageCanBeCompiled() { $this->createPublicationFiles(); @@ -41,7 +41,7 @@ public function test_listing_page_can_be_compiled() File::deleteDirectory(Hyde::path('test-publication')); } - public function test_list_page_can_show_up_in_navigation() + public function testListPageCanShowUpInNavigation() { $this->createPublicationFiles(); @@ -52,7 +52,7 @@ public function test_list_page_can_show_up_in_navigation() File::deleteDirectory(Hyde::path('test-publication')); } - public function test_list_page_is_not_added_to_navigation_when_publication_identifier_is_set_in_config() + public function testListPageIsNotAddedToNavigationWhenPublicationIdentifierIsSetInConfig() { config(['hyde.navigation.exclude' => ['test-publication']]); diff --git a/packages/publications/tests/Feature/PublicationPageCompilerTest.php b/packages/publications/tests/Feature/PublicationPageCompilerTest.php index 3198b31ae87..93ee701f37f 100644 --- a/packages/publications/tests/Feature/PublicationPageCompilerTest.php +++ b/packages/publications/tests/Feature/PublicationPageCompilerTest.php @@ -22,7 +22,7 @@ */ class PublicationPageCompilerTest extends TestCase { - public function test_can_compile_publication_pages() + public function testCanCompilePublicationPages() { $this->setupPublicationType(); @@ -33,7 +33,7 @@ public function test_can_compile_publication_pages() $this->assertEquals('Detail: My Publication', $string); } - public function test_can_compile_list_pages() + public function testCanCompileListPages() { $this->setupPublicationType(); @@ -45,7 +45,7 @@ public function test_can_compile_list_pages() $this->assertEquals('List: My Publication', $string); } - public function test_can_compile_publication_pages_with_registered_view() + public function testCanCompilePublicationPagesWithRegisteredView() { $this->setupPublicationType(); @@ -60,7 +60,7 @@ public function test_can_compile_publication_pages_with_registered_view() $this->assertEquals('Registered detail view', PublicationPageCompiler::call($publicationPage)); } - public function test_can_compile_list_pages_with_registered_view() + public function testCanCompileListPagesWithRegisteredView() { $this->setupPublicationType(); @@ -75,7 +75,7 @@ public function test_can_compile_list_pages_with_registered_view() $this->assertEquals('Registered list view', PublicationPageCompiler::call($publicationPage)); } - public function test_can_compile_publication_pages_with_registered_namespaced_view() + public function testCanCompilePublicationPagesWithRegisteredNamespacedView() { $this->setupPublicationType(); @@ -88,7 +88,7 @@ public function test_can_compile_publication_pages_with_registered_namespaced_vi $this->assertStringContainsString('My Publication', PublicationPageCompiler::call($publicationPage)); } - public function test_can_compile_list_pages_with_registered_namespaced_view() + public function testCanCompileListPagesWithRegisteredNamespacedView() { $this->setupPublicationType(); $this->file('vendor/hyde/framework/resources/views/layouts/test.blade.php', 'Registered list view'); @@ -103,7 +103,7 @@ public function test_can_compile_list_pages_with_registered_namespaced_view() $this->assertEquals('Registered list view', PublicationPageCompiler::call($publicationPage)); } - public function test_with_missing_detail_blade_view() + public function testWithMissingDetailBladeView() { $this->setupPublicationType(); @@ -113,7 +113,7 @@ public function test_with_missing_detail_blade_view() PublicationPageCompiler::call(new PublicationPage('my-publication', type: PublicationType::get('test-publication'))); } - public function test_with_missing_list_blade_view() + public function testWithMissingListBladeView() { $this->setupPublicationType(); diff --git a/packages/publications/tests/Feature/PublicationPageTest.php b/packages/publications/tests/Feature/PublicationPageTest.php index 9258c4c6b88..bad633352a1 100644 --- a/packages/publications/tests/Feature/PublicationPageTest.php +++ b/packages/publications/tests/Feature/PublicationPageTest.php @@ -17,7 +17,7 @@ */ class PublicationPageTest extends TestCase { - public function test_source_path_mappings() + public function testSourcePathMappings() { $this->createPublicationFiles(); @@ -29,7 +29,7 @@ public function test_source_path_mappings() $this->assertSame('test-publication/foo.html', $page->getOutputPath()); } - public function test_publication_pages_are_routable() + public function testPublicationPagesAreRoutable() { $this->createPublicationFiles(); @@ -41,7 +41,7 @@ public function test_publication_pages_are_routable() $this->assertArrayHasKey($page->getRouteKey(), Hyde::routes()); } - public function test_publication_pages_are_discoverable() + public function testPublicationPagesAreDiscoverable() { $this->createPublicationFiles(); @@ -49,7 +49,7 @@ public function test_publication_pages_are_discoverable() $this->assertInstanceOf(PublicationPage::class, $collection->get('test-publication/foo.md')); } - public function test_publication_pages_are_properly_parsed() + public function testPublicationPagesAreProperlyParsed() { $this->createPublicationFiles(); @@ -63,7 +63,7 @@ public function test_publication_pages_are_properly_parsed() $this->assertEquals('Hello World!', $page->markdown()->body()); } - public function test_publication_pages_are_parsable() + public function testPublicationPagesAreParsable() { $this->directory('test-publication'); @@ -90,7 +90,7 @@ public function test_publication_pages_are_parsable() $this->assertTrue($page->matter->has('__createdAt')); } - public function test_publication_pages_are_compilable() + public function testPublicationPagesAreCompilable() { $this->createRealPublicationFiles(); @@ -100,7 +100,7 @@ public function test_publication_pages_are_compilable() $this->assertStringContainsString('Hello World!', $page->compile()); } - public function test_identifier_passed_constructor_is_normalized() + public function testIdentifierPassedConstructorIsNormalized() { $this->createPublicationFiles(); $type = PublicationType::fromFile('test-publication/schema.json'); @@ -114,7 +114,7 @@ public function test_identifier_passed_constructor_is_normalized() $this->assertEquals($page1, $page2); } - public function test_identifier_normalizer_does_not_affect_directory_with_same_name_as_identifier() + public function testIdentifierNormalizerDoesNotAffectDirectoryWithSameNameAsIdentifier() { $this->createPublicationFiles(); $type = PublicationType::fromFile('test-publication/schema.json'); diff --git a/packages/publications/tests/Feature/PublicationPageUnitTest.php b/packages/publications/tests/Feature/PublicationPageUnitTest.php index 7093427d157..f9e9fb3cff3 100644 --- a/packages/publications/tests/Feature/PublicationPageUnitTest.php +++ b/packages/publications/tests/Feature/PublicationPageUnitTest.php @@ -182,7 +182,7 @@ public function testMetadata() (new PublicationPage('', [], '', $this->pubType()))->metadata()); } - public function test__construct() + public function testConstruct() { $this->assertInstanceOf(PublicationPage::class, new PublicationPage('', [], '', $this->pubType())); } diff --git a/packages/publications/tests/Feature/PublicationTypeTest.php b/packages/publications/tests/Feature/PublicationTypeTest.php index 16bfd064e57..89dced119dd 100644 --- a/packages/publications/tests/Feature/PublicationTypeTest.php +++ b/packages/publications/tests/Feature/PublicationTypeTest.php @@ -25,7 +25,7 @@ */ class PublicationTypeTest extends TestCase { - public function test_can_construct_new_publication_type() + public function testCanConstructNewPublicationType() { $publicationType = new PublicationType(...$this->getTestData()); @@ -42,7 +42,7 @@ public function test_can_construct_new_publication_type() } } - public function test_construct_with_default_values() + public function testConstructWithDefaultValues() { $publicationType = new PublicationType('Test Publication'); @@ -58,7 +58,7 @@ public function test_construct_with_default_values() $this->assertEquals('test-publication', $publicationType->getDirectory()); } - public function test_construct_with_pagination_settings() + public function testConstructWithPaginationSettings() { $paginationSettings = [ 'sortField' => 'title', @@ -72,43 +72,43 @@ public function test_construct_with_pagination_settings() $this->assertSame(10, $publicationType->pageSize); } - public function test_class_is_arrayable() + public function testClassIsArrayable() { $publicationType = new PublicationType(...$this->getTestData()); $this->assertSame($this->getTestData(), $publicationType->toArray()); } - public function test_class_is_json_serializable() + public function testClassIsJsonSerializable() { $publicationType = new PublicationType(...$this->getTestData()); $this->assertSame(json_encode($this->getTestData()), json_encode($publicationType)); } - public function test_class_is_jsonable() + public function testClassIsJsonable() { $publicationType = new PublicationType(...$this->getTestData()); $this->assertSame(json_encode($this->getTestData(), 128), $publicationType->toJson()); } - public function test_get_directory() + public function testGetDirectory() { $publicationType = new PublicationType(...$this->getTestDataWithPathInformation()); $this->assertSame('test-publication', $publicationType->getDirectory()); } - public function test_get_identifier() + public function testGetIdentifier() { $publicationType = new PublicationType(...$this->getTestDataWithPathInformation()); $this->assertSame('test-publication', $publicationType->getIdentifier()); } - public function test_get_identifier_with_no_directory() + public function testGetIdentifierWithNoDirectory() { $publicationType = new PublicationType(...$this->getTestData()); $this->assertSame('test-publication', $publicationType->getIdentifier()); } - public function test_can_save_to_json_file() + public function testCanSaveToJsonFile() { $publicationType = new PublicationType(...$this->getTestDataWithPathInformation()); $publicationType->save(); @@ -119,7 +119,7 @@ public function test_can_save_to_json_file() File::deleteDirectory(Hyde::path('test-publication')); } - public function test_can_save_to_json_file_using_custom_path() + public function testCanSaveToJsonFileUsingCustomPath() { $publicationType = new PublicationType(...$this->getTestData()); $publicationType->save('test-publication/foo.json'); @@ -130,7 +130,7 @@ public function test_can_save_to_json_file_using_custom_path() File::deleteDirectory(Hyde::path('test-publication')); } - public function test_can_load_from_json_file() + public function testCanLoadFromJsonFile() { $this->directory('test-publication'); @@ -158,7 +158,7 @@ public function test_can_load_from_json_file() $this->assertEquals($publicationType, PublicationType::fromFile('test-publication/schema.json')); } - public function test_can_load_fields_with_validation_rules() + public function testCanLoadFieldsWithValidationRules() { $this->directory('test-publication'); $fields = [ @@ -177,7 +177,7 @@ public function test_can_load_fields_with_validation_rules() $this->assertSame($fields, $publicationType->getFields()->toArray()); } - public function test_get_fields_method_returns_collection_of_field_objects() + public function testGetFieldsMethodReturnsCollectionOfFieldObjects() { $publicationType = new PublicationType(...$this->getTestDataWithPathInformation()); $collection = $publicationType->getFields(); @@ -189,7 +189,7 @@ public function test_get_fields_method_returns_collection_of_field_objects() ]), $collection); } - public function test_get_field_method_parses_publication_fields_from_schema_file() + public function testGetFieldMethodParsesPublicationFieldsFromSchemaFile() { $this->directory('test-publication'); $this->file('test-publication/schema.json', json_encode([ @@ -207,7 +207,7 @@ public function test_get_field_method_parses_publication_fields_from_schema_file ]), $publicationType->getFields()); } - public function test_get_field_method_parses_publication_fields_with_option_properties_from_schema_file() + public function testGetFieldMethodParsesPublicationFieldsWithOptionPropertiesFromSchemaFile() { $this->directory('test-publication'); $this->file('test-publication/schema.json', json_encode([ @@ -225,7 +225,7 @@ public function test_get_field_method_parses_publication_fields_with_option_prop ]), $publicationType->getFields()); } - public function test_get_method_can_find_existing_file_on_disk() + public function testGetMethodCanFindExistingFileOnDisk() { $publicationType = new PublicationType(...$this->getTestDataWithPathInformation()); $publicationType->save(); @@ -234,14 +234,14 @@ public function test_get_method_can_find_existing_file_on_disk() File::deleteDirectory(Hyde::path('test-publication')); } - public function test_get_method_fails_if_publication_type_does_not_exist() + public function testGetMethodFailsIfPublicationTypeDoesNotExist() { $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Could not parse schema file '.'missing/schema.json'); PublicationType::get('missing'); } - public function test_get_list_page() + public function testGetListPage() { $publicationType = new PublicationType(...$this->getTestDataWithPathInformation()); $this->assertEquals(new PublicationListPage($publicationType), $publicationType->getListPage()); diff --git a/packages/publications/tests/Feature/PublicationsExtensionTest.php b/packages/publications/tests/Feature/PublicationsExtensionTest.php index e7fd39846a2..f81abb49c83 100644 --- a/packages/publications/tests/Feature/PublicationsExtensionTest.php +++ b/packages/publications/tests/Feature/PublicationsExtensionTest.php @@ -37,19 +37,19 @@ protected function tearDown(): void parent::tearDown(); } - public function test_get_page_classes_method() + public function testGetPageClassesMethod() { $this->assertSame([], PublicationsExtension::getPageClasses()); } - public function test_get_types_method() + public function testGetTypesMethod() { $extension = new PublicationsExtension; $extension->discoverFiles(Hyde::files()); $this->assertSame([], $extension->getTypes()->toArray()); } - public function test_get_types_method_with_types() + public function testGetTypesMethodWithTypes() { $this->createPublication(); @@ -58,7 +58,7 @@ public function test_get_types_method_with_types() $this->assertEquals(['publication' => PublicationType::get('publication')], $extension->getTypes()->all()); } - public function test_get_types_method_with_multiple_types() + public function testGetTypesMethodWithMultipleTypes() { $this->createPublication(); @@ -73,7 +73,7 @@ public function test_get_types_method_with_multiple_types() ], $extension->getTypes()->all()); } - public function test_publication_files_are_discovered() + public function testPublicationFilesAreDiscovered() { $this->createPublication(); @@ -88,7 +88,7 @@ public function test_publication_files_are_discovered() ); } - public function test_publication_files_are_discovered_for_multiple_types() + public function testPublicationFilesAreDiscoveredForMultipleTypes() { $this->createPublication(); @@ -102,7 +102,7 @@ public function test_publication_files_are_discovered_for_multiple_types() $this->assertSame(['publication/foo.md', 'publication2/bar.md'], $files); } - public function test_publication_media_files_are_discovered() + public function testPublicationMediaFilesAreDiscovered() { $this->directory('_media/publication'); $this->file('_media/publication/foo.jpg', 'foo'); @@ -112,7 +112,7 @@ public function test_publication_media_files_are_discovered() $this->assertInstanceOf(MediaFile::class, $files->get('publication/foo.jpg')); } - public function test_base_publication_pages_are_discovered() + public function testBasePublicationPagesAreDiscovered() { $this->createPublication(); @@ -122,7 +122,7 @@ public function test_base_publication_pages_are_discovered() ], PageCollection::init(Hyde::getInstance())->boot()->getPages()->keys()->toArray()); } - public function test_publication_pages_are_discovered() + public function testPublicationPagesAreDiscovered() { $this->createPublication(); @@ -138,7 +138,7 @@ public function test_publication_pages_are_discovered() ); } - public function test_listing_pages_for_publications_are_generated() + public function testListingPagesForPublicationsAreGenerated() { $this->createPublication(); $booted = PageCollection::init(Hyde::getInstance())->boot(); @@ -153,7 +153,7 @@ public function test_listing_pages_for_publications_are_generated() ); } - public function test_paginated_listing_pages_for_publications_are_generated() + public function testPaginatedListingPagesForPublicationsAreGenerated() { $this->createPublication(); (new PublicationType('publication', pageSize: 1))->save(); @@ -166,7 +166,7 @@ public function test_paginated_listing_pages_for_publications_are_generated() $this->assertInstanceOf(InMemoryPage::class, $booted->getPage('publication/page-2')); } - public function test_publication_tag_list_pages_are_generated() + public function testPublicationTagListPagesAreGenerated() { $this->directory('publication'); @@ -181,7 +181,7 @@ public function test_publication_tag_list_pages_are_generated() $this->assertInstanceOf(InMemoryPage::class, $booted->getPage('tags/index')); } - public function test_publication_tag_list_routes_with_tags_are_generated() + public function testPublicationTagListRoutesWithTagsAreGenerated() { $this->createPublication(); (new PublicationType('publication', fields: [ @@ -207,7 +207,7 @@ public function test_publication_tag_list_routes_with_tags_are_generated() $this->assertSame(['foo' => 1, 'bar' => 1], $tagPage->matter('tags')); } - public function test_publication_routes_are_discovered() + public function testPublicationRoutesAreDiscovered() { $this->createPublication(); @@ -230,7 +230,7 @@ public function test_publication_routes_are_discovered() ); } - public function test_publication_tag_list_routes_are_discovered() + public function testPublicationTagListRoutesAreDiscovered() { $this->directory('publication'); @@ -256,7 +256,7 @@ public function test_publication_tag_list_routes_are_discovered() $this->assertSame(['foo' => 1], $tagPage->matter('tags')); } - public function test_publication_tag_list_routes_with_tags_are_discovered() + public function testPublicationTagListRoutesWithTagsAreDiscovered() { $this->createPublication(); (new PublicationType('publication', fields: [ diff --git a/packages/publications/tests/Feature/SeedPublicationCommandTest.php b/packages/publications/tests/Feature/SeedPublicationCommandTest.php index f80908f1127..ac147794c41 100644 --- a/packages/publications/tests/Feature/SeedPublicationCommandTest.php +++ b/packages/publications/tests/Feature/SeedPublicationCommandTest.php @@ -25,7 +25,7 @@ protected function setUp(): void $this->pubType->save(); } - public function test_can_seed_publications() + public function testCanSeedPublications() { $this->artisan('seed:publications') ->expectsOutputToContain('Seeding new publications!') @@ -37,7 +37,7 @@ public function test_can_seed_publications() $this->assertPublicationsCreated(); } - public function test_can_seed_publications_using_arguments() + public function testCanSeedPublicationsUsingArguments() { $this->artisan('seed:publications test-publication 1') ->expectsOutputToContain('Seeding new publications!') @@ -46,7 +46,7 @@ public function test_can_seed_publications_using_arguments() $this->assertPublicationsCreated(); } - public function test_can_seed_multiple_publications() + public function testCanSeedMultiplePublications() { $this->artisan('seed:publications test-publication 2') ->expectsOutputToContain('Seeding new publications!') @@ -56,7 +56,7 @@ public function test_can_seed_multiple_publications() $this->assertPublicationsCreated(2); } - public function test_command_asks_to_confirm_before_creating_many_publications() + public function testCommandAsksToConfirmBeforeCreatingManyPublications() { $this->artisan('seed:publications') ->expectsOutputToContain('Seeding new publications!') @@ -69,7 +69,7 @@ public function test_command_asks_to_confirm_before_creating_many_publications() $this->assertPublicationsCreated(0); } - public function test_command_asks_to_confirm_before_creating_many_publications_when_using_arguments() + public function testCommandAsksToConfirmBeforeCreatingManyPublicationsWhenUsingArguments() { $this->artisan('seed:publications test-publication 10000') ->expectsOutputToContain('Seeding new publications!') @@ -80,14 +80,14 @@ public function test_command_asks_to_confirm_before_creating_many_publications_w $this->assertPublicationsCreated(0); } - public function test_with_invalid_publication_type() + public function testWithInvalidPublicationType() { $this->artisan('seed:publications invalid-publication') ->expectsOutput('Error: Unable to locate publication type [invalid-publication]') ->assertExitCode(1); } - public function test_with_no_publication_types() + public function testWithNoPublicationTypes() { unlink(Hyde::path('test-publication/schema.json')); $this->artisan('seed:publications') diff --git a/packages/realtime-compiler/src/Actions/AssetFileLocator.php b/packages/realtime-compiler/src/Actions/AssetFileLocator.php index ad5fa52f1ba..91b64d8dcca 100644 --- a/packages/realtime-compiler/src/Actions/AssetFileLocator.php +++ b/packages/realtime-compiler/src/Actions/AssetFileLocator.php @@ -1,5 +1,7 @@ browse(function (Browser $browser) { $browser->visit('/') @@ -40,7 +40,7 @@ public function test_welcome_homepage() Filesystem::unlink('_site/index.html'); } - public function test_404_page() + public function test404Page() { $this->browse(function (Browser $browser) { $browser->visit('/404') @@ -53,7 +53,7 @@ public function test_404_page() Filesystem::unlink('_site/404.html'); } - public function test_blank_homepage() + public function testBlankHomepage() { $this->artisan('publish:homepage blank -n'); @@ -69,7 +69,7 @@ public function test_blank_homepage() Filesystem::unlink('_site/index.html'); } - public function test_posts_homepage() + public function testPostsHomepage() { $this->artisan('publish:homepage posts -n'); @@ -86,7 +86,7 @@ public function test_posts_homepage() Filesystem::unlink('_site/index.html'); } - public function test_posts_homepage_with_posts() + public function testPostsHomepageWithPosts() { $this->artisan('publish:homepage posts -n'); file_put_contents(Hyde::path('_posts/my-new-post.md'), @@ -115,7 +115,7 @@ public function test_posts_homepage_with_posts() Filesystem::unlink('_site/index.html'); } - public function test_documentation_index() + public function testDocumentationIndex() { $this->artisan('make:page Index --type="documentation" -n'); @@ -135,7 +135,7 @@ public function test_documentation_index() Filesystem::unlink('_site/docs/index.html'); } - public function test_documentation_site_with_pages() + public function testDocumentationSiteWithPages() { $this->makeDocumentationTestPage('Page1', withText: true); $this->makeDocumentationTestPage('Page2'); @@ -163,7 +163,7 @@ public function test_documentation_site_with_pages() Filesystem::unlink('_site/docs/page1.html'); } - public function test_documentation_site_with_collapsible_grouped_pages() + public function testDocumentationSiteWithCollapsibleGroupedPages() { $this->makeDocumentationTestPage('Page1', ['navigation.group' => 'Group 1'], true); $this->makeDocumentationTestPage('Page2', ['navigation.group' => 'Group 1']); @@ -193,7 +193,7 @@ public function test_documentation_site_with_collapsible_grouped_pages() Filesystem::unlink('_site/docs/page1.html'); } - public function test_blog_post_pages() + public function testBlogPostPages() { copy(Hyde::path('tests/fixtures/_posts/typography-simple.md'), Hyde::path('_posts/typography-simple.md')); copy(Hyde::path('tests/fixtures/_posts/typography-front-matter.md'), Hyde::path('_posts/typography-front-matter.md')); diff --git a/tests/fixtures/_posts/typography-front-matter.md b/tests/fixtures/_posts/typography-front-matter.md index 6fe205ae735..c796166411f 100644 --- a/tests/fixtures/_posts/typography-front-matter.md +++ b/tests/fixtures/_posts/typography-front-matter.md @@ -80,4 +80,4 @@ Finally, a figure with a caption: -And that's the end of our little demo. \ No newline at end of file +And that's the end of our little demo. diff --git a/tests/fixtures/_posts/typography-simple.md b/tests/fixtures/_posts/typography-simple.md index a16fd775e1f..f966f97e94d 100644 --- a/tests/fixtures/_posts/typography-simple.md +++ b/tests/fixtures/_posts/typography-simple.md @@ -66,4 +66,4 @@ Finally, a figure with a caption: -And that's the end of our little demo. \ No newline at end of file +And that's the end of our little demo. diff --git a/tests/fixtures/markdown.md b/tests/fixtures/markdown.md index a5b79deb375..86c704bd8f4 100644 --- a/tests/fixtures/markdown.md +++ b/tests/fixtures/markdown.md @@ -48,4 +48,4 @@ Tempore placidos. Semina dilataque pericula, in decipit manus ego Antiphataeque in auras est Gratia ferro latus audes. Cythereiadasque invida dura Phoebus omnes qua, fata inquit agros quae umbra festinat nec prensos et una enim. Noctis tecta mihi. Cervus *dea ignes* cunctae hora saepe meritis prohibete excitus: a unicus -tamen, et parenti adeo, haud. \ No newline at end of file +tamen, et parenti adeo, haud.