Example #1
0
 public function testBindCustomerLogin()
 {
     $customer = new \Magento\Framework\Object(['id' => '1']);
     $observer = new \Magento\Framework\Object(['event' => new \Magento\Framework\Object(['customer' => $customer])]);
     $this->visitor->bindCustomerLogin($observer);
     $this->assertTrue($this->visitor->getDoCustomerLogin());
     $this->assertEquals($customer->getId(), $this->visitor->getCustomerId());
     $this->visitor->unsetData();
     $this->visitor->setCustomerId('2');
     $this->visitor->bindCustomerLogin($observer);
     $this->assertNull($this->visitor->getDoCustomerLogin());
     $this->assertEquals('2', $this->visitor->getCustomerId());
 }