public function setup() { /** @var ContainerInterface $container */ $container = (require 'config/container.php'); $this->app = $container->get('Zend\\Expressive\\Application'); $this->request = new ServerRequest([], [], 'http://localhost/', 'GET', 'php://memory'); $this->repository = $container->get(UserRepositoryInterface::class); $this->repository->register(new User(new Uuid('112d2ed6-25b8-4e8b-a7e5-4f9a3f445314'), new Username('johndoe'), new Email('*****@*****.**'), new Password('password'))); $this->repository->register(new User(new Uuid('eb0fdcad-1ad5-42fb-8da6-4a2db08c6941'), new Username('batman'), new Email('*****@*****.**'), new Password('badcave'))); }
/** * @expectedException \App\Repository\Exception\UserExistsException */ public function testShouldThrowExceptionWhenRegisteringUsedId() { $user = new User(new Uuid('eb0fdcad-1ad5-42fb-8da6-4a2db08c6941'), new Username('joker'), new Email('*****@*****.**'), new Password('rofl')); $this->repository->register($user); }