Add MessageFactory, MessageByNameFactory.

This commit is contained in:
2023-09-01 12:22:08 +03:00
parent 2b37a4c2e7
commit 02cdb1f792
3 changed files with 69 additions and 0 deletions
@@ -0,0 +1,25 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use App\Models\Validation\Messages\Factories\MessageByNameFactory;
class MessageByNameFactoryTest extends TestCase
{
public function testCreate(): void
{
$name = 'company';
$expected_messages = [
'found' => "A company with the name is valid.",
'not_found' => "A company with the name does not exist!!!",
'invalid_name' => "The company name is empty, please, write the name!!!",
];
$factory = new MessageByNameFactory($name);
$this->assertEquals($factory->create(), $expected_messages);
}
}