/** * Validates VAT. * * @param oxCompanyVatIn $oVatIn Company VAT identification number object. * * @return bool */ public function validate(oxCompanyVatIn $oVatIn) { $oCheckVat = new stdClass(); $oCheckVat->countryCode = $oVatIn->getCountryCode(); $oCheckVat->vatNumber = $oVatIn->getNumbers(); $blResult = $this->_checkOnline($oCheckVat); if (!$blResult) { $this->setError('ID_NOT_VALID'); } return $blResult; }
/** * @dataProvider vatInProviderForNumbers */ public function testGetVatInNumbers($sVatIn, $sExpectCode) { $oVatIn = new oxCompanyVatIn($sVatIn); $this->assertSame($sExpectCode, $oVatIn->getNumbers()); }