chore: code refactor via rector
This commit is contained in:
@@ -8,7 +8,7 @@ use Tests\TestCase;
|
||||
class MetaTest extends TestCase
|
||||
{
|
||||
/** @test */
|
||||
public function it_can_create_a_meta_with_factory()
|
||||
public function it_can_create_a_meta_with_factory(): void
|
||||
{
|
||||
$meta = Meta::factory()->create();
|
||||
|
||||
@@ -18,14 +18,14 @@ class MetaTest extends TestCase
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_has_correct_fillable_attributes()
|
||||
public function it_has_correct_fillable_attributes(): void
|
||||
{
|
||||
$metaData = [
|
||||
'key' => 'total_emails_created',
|
||||
'value' => '1500',
|
||||
];
|
||||
|
||||
$meta = Meta::create($metaData);
|
||||
$meta = Meta::query()->create($metaData);
|
||||
|
||||
foreach ($metaData as $key => $value) {
|
||||
$this->assertEquals($value, $meta->$key);
|
||||
@@ -33,7 +33,7 @@ class MetaTest extends TestCase
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_stores_key_value_pairs_correctly()
|
||||
public function it_stores_key_value_pairs_correctly(): void
|
||||
{
|
||||
$meta = Meta::factory()->create([
|
||||
'key' => 'app_version',
|
||||
@@ -45,13 +45,13 @@ class MetaTest extends TestCase
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_can_retrieve_value_by_key()
|
||||
public function it_can_retrieve_value_by_key(): void
|
||||
{
|
||||
Meta::factory()->create(['key' => 'site_name', 'value' => 'ZEmailnator']);
|
||||
Meta::factory()->create(['key' => 'max_emails', 'value' => '100']);
|
||||
|
||||
$siteName = Meta::where('key', 'site_name')->first();
|
||||
$maxEmails = Meta::where('key', 'max_emails')->first();
|
||||
$siteName = Meta::query()->where('key', 'site_name')->first();
|
||||
$maxEmails = Meta::query()->where('key', 'max_emails')->first();
|
||||
|
||||
$this->assertEquals('ZEmailnator', $siteName->value);
|
||||
$this->assertEquals('100', $maxEmails->value);
|
||||
|
||||
Reference in New Issue
Block a user