/** * Get customer id if customer is present in database * * @param string $email * @param string $websiteCode * @return bool|int */ protected function _getCustomerId($email, $websiteCode) { $email = strtolower(trim($email)); if (isset($this->_websiteCodeToId[$websiteCode])) { $websiteId = $this->_websiteCodeToId[$websiteCode]; return $this->_customerStorage->getCustomerId($email, $websiteId); } return false; }
public function testGetCustomerId() { $customer = $this->_addCustomerToStorage(); $this->assertEquals($customer->getId(), $this->_model->getCustomerId($customer->getEmail(), $customer->getWebsiteId())); $this->assertFalse($this->_model->getCustomerId('*****@*****.**', $customer->getWebsiteId())); }