本文整理汇总了PHP中Oro\Bundle\UserBundle\Entity\User::setEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP User::setEmail方法的具体用法?PHP User::setEmail怎么用?PHP User::setEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\UserBundle\Entity\User
的用法示例。
在下文中一共展示了User::setEmail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
$this->user = new User();
$this->user->setEmail('email_to@example.com')->setPlainPassword('TestPassword');
$this->mailProcessor = new Processor($this->managerRegistry, $this->configManager, $this->renderer, $this->emailHolderHelper, $this->mailer);
}
示例2: setUp
protected function setUp()
{
parent::setUp();
$this->request = new Request();
$this->user = new User();
$this->user->setEmail('user@example.com');
$this->mailProcessor = new Processor($this->managerRegistry, $this->configManager, $this->renderer, $this->emailHolderHelper, $this->mailer);
}
示例3: load
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
/** @var UserManager $userManager */
$userManager = $this->container->get('oro_user.manager');
$role = $manager->getRepository('OroUserBundle:Role')->findOneByRole('ROLE_ADMINISTRATOR');
$group = $manager->getRepository('OroUserBundle:Group')->findOneByName('Administrators');
$unit = $manager->getRepository('OroOrganizationBundle:BusinessUnit')->findOneByName('Main');
$organization = $manager->getRepository('OroOrganizationBundle:Organization')->getFirst();
$user = new User();
$user->setUsername('owner_User');
$user->addGroup($group);
$user->addRole($role);
$user->addBusinessUnit($unit);
$user->setFirstname('Test Owner FirstName');
$user->setLastname('Test Owner LastName');
$user->setEmail('owner@example.com');
$user->setOwner($unit);
$user->addGroup($group);
$user->setPlainPassword('test password');
$user->setSalt(md5(mt_rand(1, 222)));
$user->setOrganization($organization);
$userManager->updateUser($user);
$this->setReference('owner_user', $user);
$manager->flush();
}
示例4: testEmail
public function testEmail()
{
$user = new User();
$mail = 'tony@mail.org';
$this->assertNull($user->getEmail());
$user->setEmail($mail);
$this->assertEquals($mail, $user->getEmail());
}
示例5: testNewItem
public function testNewItem()
{
$user = new User();
$user->setEmail('some@email.com');
$this->factory->expects($this->once())->method('createItem')->will($this->returnValue($this->item));
$repository = $this->getDefaultRepositoryMock(null);
$em = $this->getEntityManager($repository);
$listener = $this->getListener($this->factory, $this->securityContext, $em);
$response = $this->getResponse();
$listener->onResponse($this->getEventMock($this->getRequest(), $response));
}
示例6: createUser
/**
* @param string $firstName
* @param string $lastName
*
* @return User
*/
protected function createUser($firstName, $lastName)
{
$user = new User();
$user->setOrganization($this->organization);
$user->setFirstName($firstName);
$user->setLastName($lastName);
$user->setUsername(strtolower($firstName . '.' . $lastName));
$user->setPassword(strtolower($firstName . '.' . $lastName));
$user->setEmail(strtolower($firstName . '_' . $lastName . '@example.com'));
$user->addEmail($this->email);
$this->em->persist($user);
return $user;
}
示例7: testNavigationHistoryItemEntity
public function testNavigationHistoryItemEntity()
{
$user = new User();
$user->setEmail('some@email.com');
$values = array('title' => 'Some Title', 'url' => 'Some Url', 'user' => $user);
$item = new NavigationHistoryItem($values);
$this->assertEquals($values['title'], $item->getTitle());
$this->assertEquals($values['url'], $item->getUrl());
$this->assertEquals($values['user'], $item->getUser());
$dateTime = new \DateTime();
$item->setVisitedAt($dateTime);
$this->assertEquals($dateTime, $item->getVisitedAt());
$visitCount = rand(0, 100);
$item->setVisitCount($visitCount);
$this->assertEquals($visitCount, $item->getVisitCount());
$this->assertEquals(null, $item->getId());
}
示例8: testNavigationItemEntity
public function testNavigationItemEntity()
{
$user = new User();
$user->setEmail('some@email.com');
$values = array('title' => 'Some Title', 'url' => 'Some Url', 'position' => 'Some position', 'user' => $user);
$item = new NavigationItem($values);
$item->setType('test');
$this->assertEquals($values['title'], $item->getTitle());
$this->assertEquals($values['url'], $item->getUrl());
$this->assertEquals($values['position'], $item->getPosition());
$this->assertEquals($values['user'], $item->getUser());
$this->assertEquals('test', $item->getType());
$dateTime = new \DateTime();
$item->setUpdatedAt($dateTime);
$this->assertEquals($dateTime, $item->getUpdatedAt());
$dateTime = new \DateTime();
$item->setCreatedAt($dateTime);
$this->assertEquals($dateTime, $item->getCreatedAt());
}
示例9: testNavigationHistoryItemEntity
public function testNavigationHistoryItemEntity()
{
$organization = new Organization();
$user = new User();
$user->setEmail('some@email.com');
$values = array('title' => 'Some Title', 'url' => 'Some Url', 'user' => $user, 'organization' => $organization, 'route' => 'test_route', 'routeParameters' => array('key' => 'value'), 'entityId' => 1);
$item = new NavigationHistoryItem($values);
$this->assertEquals($values['title'], $item->getTitle());
$this->assertEquals($values['url'], $item->getUrl());
$this->assertEquals($values['user'], $item->getUser());
$this->assertEquals($values['organization'], $item->getOrganization());
$this->assertEquals($values['route'], $item->getRoute());
$this->assertEquals($values['routeParameters'], $item->getRouteParameters());
$this->assertEquals($values['entityId'], $item->getEntityId());
$dateTime = new \DateTime();
$item->setVisitedAt($dateTime);
$this->assertEquals($dateTime, $item->getVisitedAt());
$visitCount = rand(0, 100);
$item->setVisitCount($visitCount);
$this->assertEquals($visitCount, $item->getVisitCount());
$this->assertEquals(null, $item->getId());
}
示例10: createNotification
/**
* @param bool $hasReminder
* @param bool $hasConfig
* @param bool $hasRecipient
* @param bool $hasSender
* @param array $templates
* @return EmailNotification
*/
protected function createNotification($hasReminder = true, $hasConfig = false, $hasRecipient = false, $hasSender = false, $templates = null)
{
$repository = $this->getMock('Doctrine\\Common\\Persistence\\ObjectRepository');
$repository->expects($this->any())->method('find')->will($this->returnValue(new CalendarEvent()));
$templates = is_array($templates) ? $templates : [$this->createTemplate()];
$repository->expects($this->any())->method('findBy')->will($this->returnValue($templates));
$this->em->expects($this->any())->method('getRepository')->will($this->returnValue($repository));
$this->provider = $this->getMockBuilder('\\Oro\\Bundle\\EntityConfigBundle\\Provider\\ConfigProvider')->disableOriginalConstructor()->getMock();
$config = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Config\\ConfigInterface')->disableOriginalConstructor()->getMock();
$config->expects($this->any())->method('has')->will($this->returnValue($hasConfig));
$config->expects($this->any())->method('get')->will($this->returnValue(self::TEMPLATE));
$this->provider->expects($this->any())->method('getConfig')->will($this->returnValue($config));
$notification = new EmailNotification($this->em, $this->provider, $this->entityNameResolver);
if ($hasReminder) {
$reminder = new Reminder();
if (!$hasConfig) {
$reminder->setRelatedEntityClassName(self::ENTITY)->setRelatedEntityId(1);
}
if ($hasRecipient) {
$user = new User();
$user->setEmail(self::EMAIL);
$reminder->setRecipient($user);
}
if ($hasSender) {
$reminder->setSender($this->sender);
}
$notification->setReminder($reminder);
}
return $notification;
}
示例11: getTestUser
protected function getTestUser()
{
$user = new User();
$user->setId(1);
$user->setEmail('test_user@test.com');
$user->setSalt('1fqvkjskgry8s8cs400840c0ok8ggck');
return $user;
}
示例12: testNotifyWithEmptyAuthor
public function testNotifyWithEmptyAuthor()
{
$ticketUniqueId = UniqueId::generate();
$reporter = new UserAdapter(1, UserAdapter::TYPE_DIAMANTE);
$assignee = new User();
$assignee->setId(2);
$assignee->setEmail('assignee@host.com');
$author = null;
$branch = new Branch('KEY', 'Name', 'Description');
$ticket = new Ticket($ticketUniqueId, new TicketSequenceNumber(1), 'Subject', 'Description', $branch, $reporter, $assignee, new Source(Source::WEB), new Priority(Priority::PRIORITY_MEDIUM), new Status(Status::NEW_ONE));
$notification = new TicketNotification((string) $ticketUniqueId, $author, 'Header', 'Subject', new \ArrayIterator(array('key' => 'value')), array('file.ext'));
$message = new \Swift_Message();
$this->watchersService->expects($this->once())->method('getWatchers')->will($this->returnValue([new WatcherList($ticket, 'diamante_1')]));
$this->diamanteUserRepository->expects($this->exactly(2))->method('get')->with(1)->will($this->returnValue($this->diamanteUser));
$this->configManager->expects($this->once())->method('get')->will($this->returnValue('test@gmail.com'));
$this->nameFormatter->expects($this->once())->method('format')->with($this->diamanteUser)->will($this->returnValue('First Last'));
$this->mailer->expects($this->once())->method('createMessage')->will($this->returnValue($message));
$this->ticketRepository->expects($this->once())->method('getByUniqueId')->with($ticketUniqueId)->will($this->returnValue($ticket));
$this->templateResolver->expects($this->any())->method('resolve')->will($this->returnValueMap(array(array($notification, TemplateResolver::TYPE_TXT, 'txt.template.html'), array($notification, TemplateResolver::TYPE_HTML, 'html.template.html'))));
$optionsConstraint = $this->logicalAnd($this->arrayHasKey('changes'), $this->arrayHasKey('attachments'), $this->arrayHasKey('user'), $this->arrayHasKey('header'), $this->contains($notification->getChangeList()), $this->contains($notification->getAttachments()), $this->contains('First Last'), $this->contains($notification->getHeaderText()));
$this->twig->expects($this->at(0))->method('render')->with('txt.template.html', $optionsConstraint)->will($this->returnValue('Rendered TXT template'));
$this->twig->expects($this->at(1))->method('render')->with('html.template.html', $optionsConstraint)->will($this->returnValue('Rendered HTML template'));
$this->mailer->expects($this->once())->method('send')->with($this->logicalAnd($this->isInstanceOf('\\Swift_Message'), $this->callback(function (\Swift_Message $other) use($notification) {
$to = $other->getTo();
return false !== strpos($other->getSubject(), $notification->getSubject()) && false !== strpos($other->getSubject(), 'KEY-1') && false !== strpos($other->getBody(), 'Rendered TXT template') && array_key_exists('reporter@host.com', $to) && $other->getHeaders()->has('References') && false !== strpos($other->getHeaders()->get('References'), 'id_1@host.com') && false !== strpos($other->getHeaders()->get('References'), 'id_2@host.com');
})));
$this->messageReferenceRepository->expects($this->once())->method('findAllByTicket')->with($ticket)->will($this->returnValue(array(new MessageReference('id_1@host.com', $ticket), new MessageReference('id_2@host.com', $ticket))));
$this->messageReferenceRepository->expects($this->once())->method('store')->with($this->logicalAnd($this->isInstanceOf('\\Diamante\\DeskBundle\\Model\\Ticket\\EmailProcessing\\MessageReference')));
$notifier = new EmailNotifier($this->container, $this->twig, $this->mailer, $this->templateResolver, $this->ticketRepository, $this->messageReferenceRepository, $this->userService, $this->nameFormatter, $this->diamanteUserRepository, $this->configManager, $this->oroUserManager, $this->watchersService, $this->senderHost);
$notifier->notify($notification);
}
示例13: sendEmailResultProvider
/**
* @return array
*/
public function sendEmailResultProvider()
{
$user = new User();
$user->setEmail('email_to@example.com');
return [['user' => $user, 'emailType' => 'txt', 'expectedEmailType' => 'text/plain'], ['user' => $user, 'emailType' => 'html', 'expectedEmailType' => 'text/html']];
}
示例14: setUpEvent
protected function setUpEvent(CalendarEvent $event, $id, $email)
{
$user = new User();
$user->setEmail($email);
$calendar = new Calendar();
$calendar->setOwner($user);
$event->setCalendar($calendar);
ReflectionUtil::setPrivateProperty($event, 'id', $id);
$event->setReminded(false);
}
示例15: getOroUsersCollection
/**
* @param int $size
* @param string $specificData
* @return array
*/
protected function getOroUsersCollection($size = 2, $specificData = '')
{
$result = array();
for ($i = 0; $i < $size; $i++) {
$user = new OroUser();
$user->setUsername("username_{$i}");
$user->setFirstName("First {$specificData}");
$user->setLastName("Last {$specificData}");
$user->setEmail("some@host{$i}.com");
$result[] = $user;
}
return $result;
}