예제 #1
0
 /**
  * @param string      $name
  * @param string      $mainActivityCode
  * @param string      $legalCode
  * @param string|null $companyId
  *
  * @return Company
  */
 public static function build($name, $mainActivityCode, $legalCode, $companyId = null)
 {
     $mainActivity = new MainActivityRepository();
     return new Company(new CompanyId($companyId), $name, $mainActivity->findBy($mainActivityCode), $legalCode);
 }
 /**
  * @test
  */
 public function invalidCodeReturnsMainActivityCodeException()
 {
     $this->setExpectedException(MainActivityCodeException::class);
     $this->mainActivityRepository->findBy('INVALID');
 }