/** * Unfortunately we need to do an Integrated test for this particular use-case. */ public function testSlugRetrieval() { $account = Account::create([]); App::make(AccountRepositoryInterface::class)->save($account); $this->assertNotEmpty($account->slug); $this->assertInstanceOf(Slug::class, $account->slug); }
public function testCount() { $account = Account::create([]); $this->repository->save($account); $account->delete(); $this->assertSame(2, $this->repository->getCount()); }
/** * Configures the database for the default account. */ public function setupAccount() { $accountRepository = App::make(AccountRepositoryInterface::class); $this->account = Account::create([]); $accountRepository->save($this->account); CurrentAccount::set($this->account); $this->account->addTranslation('en', 'name', 'Account'); }
/** * Creates a new account record, assigns * * @param $command */ public function handle($command) { // Create account $account = Account::create([]); $this->accountRepository->save($account); $language = $this->languageRepository->getByCode($command->defaultLanguageCode); $account->addLanguage($language); $account->addTranslation($language->code, 'name', $command->name); $account->addDomain($command->domain); $this->dispatcher->dispatch($account->releaseEvents()); }