Skip to content

Commit

Permalink
Merge pull request #417 from hydephp/analysis-4xdjOn
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
HydePHP authored May 19, 2022
2 parents 35674e6 + 0ac2ad0 commit 8704692
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions tests/Unit/MarkdownPostHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@
*/
class MarkdownPostHelpersTest extends TestCase
{
public function test_get_current_page_path_returns_local_uri_path_for_post_slug()
{
$post = new MarkdownPost([], '', '', 'foo-bar');
$this->assertEquals('posts/foo-bar', $post->getCurrentPagePath());
}
public function test_get_current_page_path_returns_local_uri_path_for_post_slug()
{
$post = new MarkdownPost([], '', '', 'foo-bar');
$this->assertEquals('posts/foo-bar', $post->getCurrentPagePath());
}

public function test_get_canonical_link_returns_canonical_uri_path_for_post_slug()
{
config(['hyde.site_url' => 'https://example.com']);
$post = new MarkdownPost([], '', '', 'foo-bar');
$this->assertEquals('https://example.com/posts/foo-bar.html', $post->getCanonicalLink());
}
public function test_get_canonical_link_returns_canonical_uri_path_for_post_slug()
{
config(['hyde.site_url' => 'https://example.com']);
$post = new MarkdownPost([], '', '', 'foo-bar');
$this->assertEquals('https://example.com/posts/foo-bar.html', $post->getCanonicalLink());
}

public function test_get_canonical_link_returns_pretty_url_when_enabled()
{
config(['hyde.site_url' => 'https://example.com', 'hyde.prettyUrls' => true]);
$post = new MarkdownPost([], '', '', 'foo-bar');
$this->assertEquals('https://example.com/posts/foo-bar', $post->getCanonicalLink());
}
public function test_get_canonical_link_returns_pretty_url_when_enabled()
{
config(['hyde.site_url' => 'https://example.com', 'hyde.prettyUrls' => true]);
$post = new MarkdownPost([], '', '', 'foo-bar');
$this->assertEquals('https://example.com/posts/foo-bar', $post->getCanonicalLink());
}

public function test_get_post_description_returns_post_description_when_set_in_front_matter()
{
$post = new MarkdownPost(['description' => 'This is a post description'], '', '', 'foo-bar');
$this->assertEquals('This is a post description', $post->getPostDescription());
}
public function test_get_post_description_returns_post_description_when_set_in_front_matter()
{
$post = new MarkdownPost(['description' => 'This is a post description'], '', '', 'foo-bar');
$this->assertEquals('This is a post description', $post->getPostDescription());
}

public function test_get_post_description_returns_truncated_post_body_when_no_description_set_in_front_matter()
{
$post = new MarkdownPost([], 'This is a post body', '', 'foo-bar');
$this->assertEquals('This is a post body...', $post->getPostDescription());
}
}
public function test_get_post_description_returns_truncated_post_body_when_no_description_set_in_front_matter()
{
$post = new MarkdownPost([], 'This is a post body', '', 'foo-bar');
$this->assertEquals('This is a post body...', $post->getPostDescription());
}
}

0 comments on commit 8704692

Please sign in to comment.