You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
815 B
36 lines
815 B
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Tests\TestCase;
|
|
|
|
use App\Models\Company;
|
|
|
|
class CompanyValidationTest extends TestCase
|
|
{
|
|
public function testCompanyWithEmptyName(): void
|
|
{
|
|
$json = Company::validateWithName('');
|
|
|
|
$this->assertEquals($json['error'], 'The company name is empty, please, write the name!!!');
|
|
}
|
|
|
|
public function testNotExistingCompanyWithName(): void
|
|
{
|
|
$name = '404 Company';
|
|
|
|
$json = Company::validateWithName($name);
|
|
|
|
$this->assertEquals($json['error'], 'A company with the name does not exist!!!');
|
|
}
|
|
|
|
public function testValidCompanyWithName(): void
|
|
{
|
|
$name = 'testCompany';
|
|
|
|
$json = Company::validateWithName($name);
|
|
|
|
$this->assertEquals($json['ok'], 'A company with the name is valid.');
|
|
}
|
|
}
|