diff --git a/app/Models/Validation/Messages/Factories/MessageByNameFactory.php b/app/Models/Validation/Messages/Factories/MessageByNameFactory.php new file mode 100644 index 0000000..6c80c54 --- /dev/null +++ b/app/Models/Validation/Messages/Factories/MessageByNameFactory.php @@ -0,0 +1,35 @@ +setName($name); + } + + public function setName(string $name): void + { + $this->name = $name; + } + + public function getName(): string + { + return $this->name; + } + + public function create(): array + { + return [ + 'found' => "A $this->name with the name is valid.", + 'not_found' => "A $this->name with the name does not exist!!!", + 'invalid_name' => "The $this->name name is empty, please, write the name!!!", + ]; + } +} + diff --git a/app/Models/Validation/Messages/Factories/MessageFactory.php b/app/Models/Validation/Messages/Factories/MessageFactory.php new file mode 100644 index 0000000..176be0e --- /dev/null +++ b/app/Models/Validation/Messages/Factories/MessageFactory.php @@ -0,0 +1,9 @@ + "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); + } +} +