public function testGetCreateAccountUrl() { $expectedUrl = 'Custom Url'; $this->block->setCreateAccountUrl($expectedUrl); $this->checkoutData->expects($this->any())->method('isContextCheckout')->will($this->returnValue(false)); $this->assertEquals($expectedUrl, $this->block->getCreateAccountUrl()); $this->checkoutData->expects($this->any())->method('isContextCheckout')->will($this->returnValue(true)); $this->coreUrl->expects($this->any())->method('addRequestParam')->with($expectedUrl, ['context' => 'checkout'])->will($this->returnValue($expectedUrl)); $this->assertEquals($expectedUrl, $this->block->getCreateAccountUrl()); $this->block->unsCreateAccountUrl(); $this->customerUrl->expects($this->any())->method('getRegisterUrl')->will($this->returnValue($expectedUrl)); $this->checkoutData->expects($this->any())->method('isContextCheckout')->will($this->returnValue(false)); $this->assertEquals($expectedUrl, $this->block->getCreateAccountUrl()); $this->customerUrl->expects($this->any())->method('getRegisterUrl')->will($this->returnValue($expectedUrl)); $this->checkoutData->expects($this->any())->method('isContextCheckout')->will($this->returnValue(true)); $this->coreUrl->expects($this->any())->method('addRequestParam')->with($expectedUrl, ['context' => 'checkout'])->will($this->returnValue($expectedUrl)); $this->assertEquals($expectedUrl, $this->block->getCreateAccountUrl()); }
protected function _toHtml() { $this->setModuleName($this->extractModuleName('Magento\\Customer\\Block\\Form\\Login')); return parent::_toHtml(); }