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->_model->bindCustomerLogin($observer);
     $this->assertTrue($this->_model->getDoCustomerLogin());
     $this->assertEquals($customer->getId(), $this->_model->getCustomerId());
     $this->_model->unsetData();
     $this->_model->setCustomerId('2');
     $this->_model->bindCustomerLogin($observer);
     $this->assertNull($this->_model->getDoCustomerLogin());
     $this->assertEquals('2', $this->_model->getCustomerId());
 }