/**
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return
  */
 public function createService(ServiceLocatorInterface $validatorManager)
 {
     $serviceLocator = $validatorManager->getServiceLocator();
     $list = $serviceLocator->get('NetglueMoney\\Service\\CurrencyList');
     $validator = new CurrencyCode();
     $validator->setCurrencyList($list);
     return $validator;
 }
예제 #2
0
 /**
  * @depends testSetGetCurrencyList
  */
 public function testBasic(CurrencyCode $v)
 {
     $this->assertFalse($v->isValid('123'));
     $this->assertFalse($v->isValid(array()));
     $this->assertTrue($v->isValid('GBP'));
     $this->assertTrue($v->isValid('USD'));
     $v->getCurrencyList()->add('GBP');
     $this->assertTrue($v->isValid('GBP'));
     $this->assertFalse($v->isValid('USD'));
 }