Exemplo n.º 1
0
 public function testExecuteResultForward()
 {
     $this->forwardMock->expects($this->once())->method('setController')->with('index')->will($this->returnSelf());
     $this->forwardMock->expects($this->once())->method('forward')->with('defaultNoRoute')->will($this->returnSelf());
     $this->_cmsHelperMock->expects($this->once())->method('prepareResultPage')->will($this->returnValue(false));
     $this->assertSame($this->forwardMock, $this->_controller->execute());
 }
Exemplo n.º 2
0
 public function testExecuteWithoutWishlist()
 {
     $this->formKeyValidator->expects($this->once())->method('validate')->with($this->request)->will($this->returnValue(true));
     $this->wishlistProvider->expects($this->once())->method('getWishlist')->will($this->returnValue(null));
     $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturnSelf();
     $this->assertSame($this->resultForwardMock, $this->getController()->execute());
 }
Exemplo n.º 3
0
    public function testExecuteWithNoWishlist()
    {
        $this->wishlistProviderMock->expects($this->once())
            ->method('getWishlist')
            ->willReturn(false);
        $this->resultForwardMock->expects($this->once())
            ->method('forward')
            ->with('noroute')
            ->willReturnSelf();

        $this->assertSame($this->resultForwardMock, $this->allcartController->executeInternal());
    }
 public function testExecuteBadSecretKey()
 {
     $this->itemOptionMock->expects($this->once())->method('load')->willReturnSelf();
     $this->itemOptionMock->expects($this->once())->method('getId')->willReturn(self::OPTION_ID);
     $this->itemOptionMock->expects($this->any())->method('getCode')->willReturn(self::OPTION_CODE);
     $this->itemOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID);
     $this->itemOptionMock->expects($this->any())->method('getValue')->willReturn(self::OPTION_VALUE);
     $this->productOptionMock->expects($this->once())->method('load')->willReturnSelf();
     $this->productOptionMock->expects($this->any())->method('getId')->willReturn(self::OPTION_ID);
     $this->productOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID);
     $this->productOptionMock->expects($this->any())->method('getType')->willReturn(self::OPTION_TYPE);
     $this->unserializeMock->expects($this->once())->method('unserialize')->with(self::OPTION_VALUE)->willReturn([self::SECRET_KEY => 'bad_test_secret_key']);
     $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturn(true);
     $this->objectMock->execute();
 }
Exemplo n.º 5
0
 public function testExecuteResultForward()
 {
     $this->requestMock->expects($this->atLeastOnce())->method('getParam')->willReturnMap([['page_id', $this->pageId, $this->pageId], ['id', false, $this->pageId]]);
     $this->forwardMock->expects($this->once())->method('forward')->with('noroute')->willReturnSelf();
     $this->assertSame($this->forwardMock, $this->controller->execute());
 }
Exemplo n.º 6
0
 public function testExecuteResultForward()
 {
     $this->forwardMock->expects($this->once())->method('forward')->with('defaultIndex')->willReturnSelf();
     $this->assertSame($this->forwardMock, $this->controller->executeInternal());
 }