-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\Unit\Domain\OrgMng\Org; | ||
|
||
use App\Domain\Common\Exceptions\BusinessException; | ||
use App\Domain\OrgMng\Org\DTO\OrgDomainDTO; | ||
use App\Domain\OrgMng\Org\OrgBuilder; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class OrgBuilderTest extends TestCase | ||
{ | ||
public function test_org_name_should_not_empty() | ||
{ | ||
$this->expectException(BusinessException::class); | ||
$this->expectExceptionMessage('组织名不能为空'); | ||
|
||
$orgDomainDTO = (new OrgDomainDTO()) | ||
->tenantId(1) | ||
->superiorId(1) | ||
->orgTypeCode('foo') | ||
->name(''); | ||
|
||
/** @var OrgBuilder $orgBuilder */ | ||
$orgBuilder = app(OrgBuilder::class); | ||
|
||
return $orgBuilder | ||
->orgDomainDTO($orgDomainDTO) | ||
->build(); | ||
} | ||
|
||
} |