Definition at line 8 of file InfoTest.php.
◆ setUp()
Definition at line 30 of file InfoTest.php.
32 $this->customerUrl = $this->getMockBuilder(
33 \
Magento\Customer\Model\Url::class
34 )->disableOriginalConstructor()->setMethods(
37 $this->checkoutData = $this->getMockBuilder(
38 \
Magento\Checkout\Helper\Data::class
39 )->disableOriginalConstructor()->setMethods(
42 $this->coreUrl = $this->getMockBuilder(
43 \
Magento\Framework\Url\Helper\Data::class
44 )->disableOriginalConstructor()->setMethods(
48 $this->block = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject(
49 \
Magento\Customer\Block\Form\Login\Info::class,
51 'customerUrl' => $this->customerUrl,
52 'checkoutData' => $this->checkoutData,
53 'coreUrl' => $this->coreUrl
◆ testGetCreateAccountUrl()
testGetCreateAccountUrl |
( |
| ) |
|
Definition at line 87 of file InfoTest.php.
89 $expectedUrl =
'Custom Url';
91 $this->customerUrl->expects($this->any())->method(
'getRegisterUrl')->will($this->returnValue($expectedUrl));
92 $this->checkoutData->expects($this->any())->method(
'isContextCheckout')->will($this->returnValue(
false));
93 $this->assertEquals($expectedUrl, $this->block->getCreateAccountUrl());
◆ testGetCreateAccountUrlWithContext()
testGetCreateAccountUrlWithContext |
( |
| ) |
|
Definition at line 67 of file InfoTest.php.
70 $expectedUrl =
'Custom Url with context';
71 $this->block->setCreateAccountUrl(
$url);
73 $this->checkoutData->expects($this->any())->method(
'isContextCheckout')->will($this->returnValue(
true));
74 $this->coreUrl->expects(
80 [
'context' =>
'checkout']
82 $this->returnValue($expectedUrl)
84 $this->assertEquals($expectedUrl, $this->block->getCreateAccountUrl());
◆ testGetExistingCreateAccountUrl()
testGetExistingCreateAccountUrl |
( |
| ) |
|
Definition at line 58 of file InfoTest.php.
60 $expectedUrl =
'Custom Url';
62 $this->block->setCreateAccountUrl($expectedUrl);
63 $this->checkoutData->expects($this->any())->method(
'isContextCheckout')->will($this->returnValue(
false));
64 $this->assertEquals($expectedUrl, $this->block->getCreateAccountUrl());
◆ $block
◆ $checkoutData
◆ $coreUrl
◆ $customerUrl
The documentation for this class was generated from the following file:
- vendor/magento/module-customer/Test/Unit/Block/Form/Login/InfoTest.php