/**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->entity = $this->getMockBuilder('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountUser')->disableOriginalConstructor()->getMock();
     $this->userManager = $this->getMockBuilder('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountUserManager')->disableOriginalConstructor()->getMock();
     $this->handler = new FrontendAccountUserHandler($this->form, $this->request, $this->userManager);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->entity = new RFPRequest();
     $this->templating = $this->getMock('Symfony\\Bundle\\FrameworkBundle\\Templating\\EngineInterface');
     $this->handler = new RequestChangeStatusHandler($this->form, $this->request, $this->manager, $this->templating);
 }
Esempio n. 3
0
 /**
  * @dataProvider supportedMethods
  * @param string $method
  * @param boolean $isValid
  * @param boolean $isProcessed
  */
 public function testProcessSupportedRequest($method, $isValid, $isProcessed)
 {
     if ($isValid) {
         $this->slugManager->expects($this->once())->method('makeUrlUnique')->with($this->entity->getCurrentSlug());
     } else {
         $this->slugManager->expects($this->never())->method('makeUrlUnique')->with($this->entity->getCurrentSlug());
     }
     parent::testProcessSupportedRequest($method, $isValid, $isProcessed);
 }
 /**
  * @dataProvider supportedMethods
  * @param string $method
  * @param boolean $isValid
  * @param boolean $isProcessed
  */
 public function testProcessSupportedRequest($method, $isValid, $isProcessed)
 {
     $reflection = new \ReflectionProperty(get_class($this->entity), 'id');
     $reflection->setAccessible(true);
     $reflection->setValue($this->entity, 1);
     $this->manager->expects($this->once())->method('refresh')->with($this->entity);
     parent::testProcessSupportedRequest($method, $isValid, $isProcessed);
     $this->assertEquals(self::DEFAULT_LOCALE, $this->entity->getLocale());
 }
 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->entity = new AccountUser();
     $this->userManager = $this->getMockBuilder('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountUserManager')->disableOriginalConstructor()->getMock();
     $this->passwordGenerateForm = $this->getMockBuilder('Symfony\\Component\\Form\\FormInterface')->disableOriginalConstructor()->getMock();
     $this->sendEmailForm = $this->getMockBuilder('Symfony\\Component\\Form\\FormInterface')->disableOriginalConstructor()->getMock();
     $this->securityFacade = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\SecurityFacade')->disableOriginalConstructor()->getMock();
     $this->handler = new AccountUserHandler($this->form, $this->request, $this->userManager, $this->securityFacade);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->entity = new Request();
     $this->handler = new RequestCreateQuoteHandler($this->form, $this->request, $this->manager, $this->getUser());
 }
 protected function setUp()
 {
     parent::setUp();
     $this->entity = new Category();
     $this->handler = new CategoryHandler($this->form, $this->request, $this->manager);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->entity = new ShoppingList();
     $this->handler = new ShoppingListCreateRfpHandler($this->form, $this->request, $this->manager, $this->getUser(), (new RequestStatus())->setName(RequestStatus::DRAFT));
 }