/**
  * Return a Currency Select Instance
  * @return SelectCurrency
  */
 public function createService(ServiceLocatorInterface $formElementManager)
 {
     if (!$formElementManager instanceof FormElementManager) {
         throw new \UnexpectedValueException('Expected an instance of the Form Element Manager. Received ' . get_class($formElementManager));
     }
     $appServices = $formElementManager->getServiceLocator();
     $list = $appServices->get('NetglueMoney\\Service\\CurrencyList');
     $select = new SelectCurrency();
     $select->setCurrencyList($list);
     $validatorManager = $appServices->get('ValidatorManager');
     $select->setValidator($validatorManager->get('NetglueMoney\\Validator\\CurrencyCode'));
     return $select;
 }
 public function testGetSetValidator()
 {
     $element = new SelectCurrency('myName');
     $v = $element->getValidator();
     $this->assertInstanceOf('NetglueMoney\\Validator\\CurrencyCode', $v);
     $this->assertSame($v, $element->getValidator());
     $new = new \NetglueMoney\Validator\CurrencyCode();
     $this->assertSame($element, $element->setValidator($new));
     $this->assertSame($new, $element->getValidator());
 }