File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
dev/tests/integration/testsuite/Magento/Customer/Block Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \Customer \Block ;
9
9
10
+ use Magento \Customer \Model \Session ;
10
11
use Magento \Framework \ObjectManagerInterface ;
11
12
use Magento \Framework \View \LayoutInterface ;
12
13
use Magento \TestFramework \Helper \Bootstrap ;
19
20
* @see \Magento\Customer\Block\Newsletter
20
21
* @magentoAppArea frontend
21
22
* @magentoDbIsolation enabled
23
+ * @magentoDataFixture Magento/Customer/_files/customer.php
22
24
*/
23
25
class NewsletterTest extends TestCase
24
26
{
@@ -40,6 +42,9 @@ class NewsletterTest extends TestCase
40
42
/** @var Newsletter */
41
43
private $ block ;
42
44
45
+ /** @var Session */
46
+ private $ customerSession ;
47
+
43
48
/**
44
49
* @inheritdoc
45
50
*/
@@ -50,13 +55,15 @@ protected function setUp()
50
55
$ this ->objectManager = Bootstrap::getObjectManager ();
51
56
$ this ->layout = $ this ->objectManager ->get (LayoutInterface::class);
52
57
$ this ->block = $ this ->layout ->createBlock (Newsletter::class);
58
+ $ this ->customerSession = $ this ->objectManager ->get (Session::class);
53
59
}
54
60
55
61
/**
56
62
* @return void
57
63
*/
58
64
public function testSubscriptionCheckbox (): void
59
65
{
66
+ $ this ->customerSession ->loginById (1 );
60
67
$ html = $ this ->block ->toHtml ();
61
68
$ this ->assertEquals (
62
69
1 ,
You can’t perform that action at this time.
0 commit comments