本文整理汇总了PHP中Magento\Customer\Test\Fixture\Customer::getFirstname方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::getFirstname方法的具体用法?PHP Customer::getFirstname怎么用?PHP Customer::getFirstname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Customer\Test\Fixture\Customer
的用法示例。
在下文中一共展示了Customer::getFirstname方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareBillingAddress
/**
* Prepare billing address data.
*
* @param array $data
* @return array
*/
protected function prepareBillingAddress(array $data)
{
$result = $data;
$result['firstname'] = $this->customer->getFirstname();
$result['lastname'] = $this->customer->getLastname();
return $result;
}
示例2: processAssert
/**
* Asserts that customer name in Contact information block and Account info tab matches name in fixture.
*
* @param CustomerAccountIndex $customerAccountIndex
* @param CustomerAccountEdit $customerAccountEdit
* @param Customer $customer
* @return void
*/
public function processAssert(CustomerAccountIndex $customerAccountIndex, CustomerAccountEdit $customerAccountEdit, Customer $customer)
{
$customerName = $customer->getFirstname() . " " . $customer->getLastname();
$customerAccountIndex->open();
$infoBlock = $customerAccountIndex->getInfoBlock()->getContactInfoContent();
$infoBlock = explode(PHP_EOL, $infoBlock);
$nameInDashboard = $infoBlock[0];
\PHPUnit_Framework_Assert::assertTrue($nameInDashboard == $customerName, 'Customer name in Contact info block is not matching the fixture.');
$customerAccountIndex->getInfoBlock()->openEditContactInfo();
$nameInEdit = $customerAccountEdit->getAccountInfoForm()->getFirstName() . " " . $customerAccountEdit->getAccountInfoForm()->getLastName();
\PHPUnit_Framework_Assert::assertTrue($nameInEdit == $customerName, 'Customer name on Account info tab is not matching the fixture.');
}
示例3: authorize
/**
* Authorize customer on frontend.
*
* @param Customer $customer
* @throws \Exception
* @return void
*/
protected function authorize(Customer $customer)
{
$url = $_ENV['app_frontend_url'] . 'customer/account/login/';
$this->transport->write($url);
$this->read();
$url = $_ENV['app_frontend_url'] . 'customer/account/loginPost/';
$data = ['login[username]' => $customer->getEmail(), 'login[password]' => $customer->getPassword(), 'form_key' => $this->formKey];
$this->transport->write($url, $data, CurlInterface::POST, ['Set-Cookie:' . $this->cookies]);
$response = $this->read();
if (strpos($response, 'customer/account/login')) {
throw new \Exception($customer->getFirstname() . ', cannot be logged in by curl handler!');
}
}
示例4: processAssert
/**
* Assert customer info in Abandoned Carts report (Reports > Abandoned carts):
* – name and email
* – products and qty
* – created and updated date
*
* @param AbandonedCarts $abandonedCarts
* @param array $products
* @param Customer $customer
* @return void
*/
public function processAssert(AbandonedCarts $abandonedCarts, $products, Customer $customer)
{
$abandonedCarts->open();
$qty = 0;
foreach ($products as $product) {
$qty += $product->getCheckoutData()['qty'];
}
$filter = ['customer_name' => $customer->getFirstname() . " " . $customer->getLastname(), 'email' => $customer->getEmail(), 'items_count' => count($products), 'items_qty' => $qty, 'created_at' => date('m/j/Y'), 'updated_at' => date('m/j/Y')];
$abandonedCarts->getGridBlock()->search($filter);
$filter['created_at'] = date('M j, Y');
$filter['updated_at'] = date('M j, Y');
\PHPUnit_Framework_Assert::assertTrue($abandonedCarts->getGridBlock()->isRowVisible($filter, false, false), 'Expected customer info is absent in Abandoned Carts report grid.');
}
示例5: prepareFilter
/**
* Prepare filter
*
* @param Customer $customer
* @param array $columns
* @param array $report
* @return array
*/
public function prepareFilter(Customer $customer, array $columns, array $report)
{
$format = '';
switch ($report['report_period']) {
case 'Day':
$format = 'M j, Y';
break;
case 'Month':
$format = 'j/Y';
break;
case 'Year':
$format = 'Y';
break;
}
return ['date' => date($format), 'customer' => $customer->getFirstname() . ' ' . $customer->getLastname(), 'orders' => $columns['orders'], 'average' => number_format($columns['average'], 2), 'total' => number_format($columns['total'], 2)];
}
示例6: processAssert
/**
* Assert customer is subscribed to newsletter
*
* @param Customer $customer
* @param SubscriberIndex $subscriberIndex
* @return void
*/
public function processAssert(Customer $customer, SubscriberIndex $subscriberIndex)
{
$filter = ['email' => $customer->getEmail(), 'firstname' => $customer->getFirstname(), 'lastname' => $customer->getLastname(), 'status' => 'Subscribed'];
$subscriberIndex->open();
\PHPUnit_Framework_Assert::assertTrue($subscriberIndex->getSubscriberGrid()->isRowVisible($filter), 'Customer with email \'' . $customer->getEmail() . '\' is absent in Newsletter Subscribers grid.');
}
示例7: openReview
/**
* Open customer review report
*
* @param Customer $customer
* @return void
*/
public function openReview(Customer $customer)
{
$customerName = $customer->getFirstname() . ' ' . $customer->getLastname();
$this->_rootElement->find(sprintf($this->searchRow, $customerName), Locator::SELECTOR_XPATH)->click();
}
示例8: processAssert
/**
* Assert that edit page of customer account contains correct title.
*
* @param CustomerAccountIndex $pageCustomerIndex
* @param Customer $customer
* @return void
*/
public function processAssert(CustomerAccountIndex $pageCustomerIndex, Customer $customer)
{
\PHPUnit_Framework_Assert::assertEquals($customer->getFirstname() . ' ' . $customer->getLastname(), $pageCustomerIndex->getTitleBlock()->getTitle(), 'Wrong page title is displayed.');
}
示例9: processAssert
/**
* Assert product reviews qty column in Review Report by Customer grid
*
* @param CustomerReportReview $customerReportReview
* @param Customer $customer
* @param int $reviewsCount
* @return void
*/
public function processAssert(CustomerReportReview $customerReportReview, Customer $customer, $reviewsCount)
{
$customerName = $customer->getFirstname() . ' ' . $customer->getLastname();
$customerReportReview->open();
\PHPUnit_Framework_Assert::assertEquals($reviewsCount, $customerReportReview->getGridBlock()->getQtyReview($customerName), 'Wrong qty review in Customer Reviews Report grid.');
}