get() public method

Get the customer.
public get ( ) : Sonata\Component\Customer\CustomerInterface
return Sonata\Component\Customer\CustomerInterface
 public function testNonExistingCustomerInSession()
 {
     $customer = $this->getMock('Sonata\\Component\\Customer\\CustomerInterface');
     $customerManager = $this->getMock('Sonata\\Component\\Customer\\CustomerManagerInterface');
     $customerManager->expects($this->once())->method('findOneBy')->will($this->returnValue(false));
     $basket = $this->getMock('Sonata\\Component\\Basket\\BasketInterface');
     $basket->expects($this->exactly(2))->method('getCustomer')->will($this->returnValue($customer));
     $session = new Session(new MockArraySessionStorage());
     $session->set('sonata/basket/factory/customer/new', $basket);
     $user = new ValidUser();
     $token = $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface');
     $token->expects($this->once())->method('getUser')->will($this->returnValue($user));
     $securityContext = $this->getMock('Symfony\\Component\\Security\\Core\\SecurityContextInterface');
     $securityContext->expects($this->once())->method('isGranted')->will($this->returnValue(true));
     $securityContext->expects($this->once())->method('getToken')->will($this->returnValue($token));
     $localeDetector = $this->getMock('Sonata\\IntlBundle\\Locale\\LocaleDetectorInterface');
     $localeDetector->expects($this->once())->method('getLocale')->will($this->returnValue('en'));
     $customerSelector = new CustomerSelector($customerManager, $session, $securityContext, $localeDetector);
     $customer = $customerSelector->get();
     $this->assertInstanceOf('Sonata\\Component\\Customer\\CustomerInterface', $customer);
 }