mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-28 16:16:05 +03:00
66 lines
1.9 KiB
PHP
66 lines
1.9 KiB
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../../../' . getenv('TEST_SUITE') . '/TestCase.php';
|
|
|
|
class DataRepositoryAdminTest extends TestCase {
|
|
public function testGetCountryByIsoCode() {
|
|
$repository = new \retailcrm\repository\DataRepository(static::$registry);
|
|
|
|
$country = $repository->getCountryByIsoCode('RU');
|
|
|
|
$this->assertNotEmpty($country);
|
|
$this->assertNotEmpty($country['name']);
|
|
}
|
|
|
|
public function testGetZoneByName() {
|
|
$repository = new \retailcrm\repository\DataRepository(static::$registry);
|
|
|
|
$zone = $repository->getZoneByName('Rostov-na-Donu');
|
|
|
|
$this->assertNotEmpty($zone);
|
|
$this->assertNotEmpty($zone['zone_id']);
|
|
|
|
$repository->getZoneByName('Rostov-na-Do\'nu');
|
|
}
|
|
|
|
public function testGetCurrencyByCode() {
|
|
$repository = new \retailcrm\repository\DataRepository(static::$registry);
|
|
|
|
$currency = $repository->getCurrencyByCode('USD');
|
|
|
|
$this->assertNotEmpty($currency);
|
|
|
|
$currency = $repository->getCurrencyByCode('USD', 'title');
|
|
|
|
$this->assertNotEmpty($currency);
|
|
}
|
|
|
|
public function testGetLanguageByCode() {
|
|
$repository = new \retailcrm\repository\DataRepository(static::$registry);
|
|
|
|
$language = $repository->getLanguageByCode('en-gb');
|
|
|
|
$this->assertNotEmpty($language);
|
|
|
|
$language = $repository->getLanguageByCode('en-gb', 'name');
|
|
|
|
$this->assertNotEmpty($language);
|
|
}
|
|
|
|
public function testGetConfig() {
|
|
$repository = new \retailcrm\repository\DataRepository(static::$registry);
|
|
|
|
$value = $repository->getConfig('config_currency');
|
|
|
|
$this->assertNotEmpty($value);
|
|
}
|
|
|
|
public function testGetLanguage() {
|
|
$repository = new \retailcrm\repository\DataRepository(static::$registry);
|
|
|
|
$value = $repository->getLanguage('product_summ');
|
|
|
|
$this->assertNotEmpty($value);
|
|
}
|
|
}
|