Rename the tests to pass phpcs checks

This commit is contained in:
Jonny Barnes 2021-03-17 18:38:18 +00:00
parent 3946e9aac4
commit d5bbed1eac
52 changed files with 1329 additions and 1062 deletions

View file

@ -1,16 +1,19 @@
<?php
declare(strict_types=1);
namespace Tests\Unit;
use Tests\TestCase;
use App\Models\Article;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class ArticlesTest extends TestCase
{
use DatabaseTransactions;
public function test_sluggable_method()
/** @test */
public function titleSlugIsGeneratedAutomatically(): void
{
$article = new Article();
$article->title = 'My Title';
@ -20,15 +23,17 @@ class ArticlesTest extends TestCase
$this->assertEquals('my-title', $article->titleurl);
}
public function test_markdown_conversion()
/** @test */
public function markdownContentIsConverted(): void
{
$article = new Article();
$article->main = 'Some *markdown*';
$this->assertEquals('<p>Some <em>markdown</em></p>'.PHP_EOL, $article->html);
$this->assertEquals('<p>Some <em>markdown</em></p>' . PHP_EOL, $article->html);
}
public function test_time_attributes()
/** @test */
public function weGenerateTheDifferentTimeAttributes(): void
{
$article = Article::create([
'title' => 'Test',
@ -41,7 +46,8 @@ class ArticlesTest extends TestCase
$this->assertEquals($article->pubdate, $article->updated_at->toRSSString());
}
public function test_link_accessor()
/** @test */
public function weGenerateTheArticleLinkFromTheSlug(): void
{
$article = Article::create([
'title' => 'Test',
@ -55,7 +61,8 @@ class ArticlesTest extends TestCase
);
}
public function test_date_scope()
/** @test */
public function dateScopeReturnsExpectedArticles(): void
{
$yearAndMonth = Article::date(date('Y'), date('m'))->get();
$this->assertTrue(count($yearAndMonth) === 1);