Skip to content

Commit

Permalink
To camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 8, 2023
1 parent bb3f84c commit 2b8c026
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,79 +29,79 @@ protected function setUp(): void
View::swap(Mockery::mock(Factory::class)->makePartial());
}

public function test_helper_returns_string_as_is_if_current_is_not_set()
public function testHelperReturnsStringAsIsIfCurrentIsNotSet()
{
$this->assertEquals('foo/bar.html', Hyde::relativeLink('foo/bar.html'));
}

public function test_helper_injects_proper_number_of_doubles_slash()
public function testHelperInjectsProperNumberOfDoublesSlash()
{
$this->mockCurrentPage('foo/bar.html');
$this->assertEquals('../foo.html', Hyde::relativeLink('foo.html'));
}

public function test_helper_injects_proper_number_of_doubles_slash_for_deeply_nested_paths()
public function testHelperInjectsProperNumberOfDoublesSlashForDeeplyNestedPaths()
{
$this->mockCurrentPage('foo/bar/baz/qux.html');
$this->assertEquals('../../../foo.html', Hyde::relativeLink('foo.html'));
}

public function test_helper_handles_destination_without_file_extension()
public function testHelperHandlesDestinationWithoutFileExtension()
{
$this->mockCurrentPage('foo/bar.html');
$this->assertEquals('../foo', Hyde::relativeLink('foo'));
}

public function test_helper_handles_current_without_file_extension()
public function testHelperHandlesCurrentWithoutFileExtension()
{
$this->mockCurrentPage('foo/bar');
$this->assertEquals('../foo.html', Hyde::relativeLink('foo.html'));
}

public function test_helper_handles_case_without_any_file_extensions()
public function testHelperHandlesCaseWithoutAnyFileExtensions()
{
$this->mockCurrentPage('foo/bar');
$this->assertEquals('../foo', Hyde::relativeLink('foo'));
}

public function test_helper_handles_case_with_mixed_file_extensions()
public function testHelperHandlesCaseWithMixedFileExtensions()
{
$this->mockCurrentPage('foo/bar.md');
$this->assertEquals('../foo.md', Hyde::relativeLink('foo.md'));
$this->mockCurrentPage('foo/bar.txt');
$this->assertEquals('../foo.txt', Hyde::relativeLink('foo.txt'));
}

public function test_helper_handles_different_file_extensions()
public function testHelperHandlesDifferentFileExtensions()
{
$this->mockCurrentPage('foo/bar');
$this->assertEquals('../foo.png', Hyde::relativeLink('foo.png'));
$this->assertEquals('../foo.css', Hyde::relativeLink('foo.css'));
$this->assertEquals('../foo.js', Hyde::relativeLink('foo.js'));
}

public function test_helper_returns_pretty_url_if_enabled_and_destination_is_a_html_file()
public function testHelperReturnsPrettyUrlIfEnabledAndDestinationIsAHtmlFile()
{
self::mockConfig(['hyde.pretty_urls' => true]);
$this->mockCurrentPage('foo/bar.html');
$this->assertEquals('../foo', Hyde::relativeLink('foo.html'));
}

public function test_helper_method_does_not_require_current_path_to_be_html_to_use_pretty_urls()
public function testHelperMethodDoesNotRequireCurrentPathToBeHtmlToUsePrettyUrls()
{
self::mockConfig(['hyde.pretty_urls' => true]);
$this->mockCurrentPage('foo/bar');
$this->assertEquals('../foo', Hyde::relativeLink('foo.html'));
}

public function test_helper_returns_does_not_return_pretty_url_if_when_enabled_but_and_destination_is_not_a_html_file()
public function testHelperReturnsDoesNotReturnPrettyUrlIfWhenEnabledButAndDestinationIsNotAHtmlFile()
{
self::mockConfig(['hyde.pretty_urls' => true]);
$this->mockCurrentPage('foo/bar.html');
$this->assertEquals('../foo.png', Hyde::relativeLink('foo.png'));
}

public function test_helper_rewrites_index_when_using_pretty_urls()
public function testHelperRewritesIndexWhenUsingPrettyUrls()
{
self::mockConfig(['hyde.pretty_urls' => true]);
$this->mockCurrentPage('foo.html');
Expand All @@ -112,7 +112,7 @@ public function test_helper_rewrites_index_when_using_pretty_urls()
$this->assertEquals('../../', Hyde::relativeLink('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->mockCurrentPage('foo.html');
Expand All @@ -123,7 +123,7 @@ public function test_helper_does_not_rewrite_index_when_not_using_pretty_urls()
$this->assertEquals('../../index.html', Hyde::relativeLink('index.html'));
}

public function test_helper_rewrites_documentation_page_index_when_using_pretty_urls()
public function testHelperRewritesDocumentationPageIndexWhenUsingPrettyUrls()
{
self::mockConfig(['hyde.pretty_urls' => true]);
$this->mockCurrentPage('foo.html');
Expand All @@ -136,7 +136,7 @@ public function test_helper_rewrites_documentation_page_index_when_using_pretty_
$this->assertEquals('../docs/', Hyde::relativeLink('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->mockCurrentPage('foo.html');
Expand All @@ -149,7 +149,7 @@ public function test_helper_does_not_rewrite_documentation_page_index_when_not_u
$this->assertEquals('../docs/index.html', Hyde::relativeLink('docs/index.html'));
}

public function test_helper_does_not_rewrite_already_processed_links()
public function testHelperDoesNotRewriteAlreadyProcessedLinks()
{
$this->assertEquals('../foo', Hyde::relativeLink('../foo'));
}
Expand Down

0 comments on commit 2b8c026

Please sign in to comment.