本文整理汇总了PHP中CMTest_TH::createDefaultCurrency方法的典型用法代码示例。如果您正苦于以下问题:PHP CMTest_TH::createDefaultCurrency方法的具体用法?PHP CMTest_TH::createDefaultCurrency怎么用?PHP CMTest_TH::createDefaultCurrency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMTest_TH
的用法示例。
在下文中一共展示了CMTest_TH::createDefaultCurrency方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateAllData
public function testCreateAllData()
{
CMTest_TH::createDefaultCurrency();
$site = $this->getMockSite();
$language = CM_Model_Language::create('English', 'en', true);
$currency = CM_Model_Currency::create('978', 'EUR');
$user = CM_Model_User::createStatic(['site' => $site, 'language' => $language, 'currency' => $currency]);
$this->assertInternalType('int', $user->getCreated());
$this->assertEquals(time(), $user->getCreated());
$this->assertEquals(time(), $user->getLatestActivity());
$this->assertEquals($site, $user->getSite());
$this->assertEquals($language, $user->getLanguage());
$this->assertEquals($currency, $user->getCurrency());
}
示例2: testGetters
public function testGetters()
{
$site = CM_Site_Abstract::factory();
$user = CM_Model_User::createStatic();
$language = CM_Model_Language::create('English', 'en', true);
$timezone = new DateTimeZone('Europe/London');
$debug = true;
$location = CM_Model_Location::createCountry('United Kingdom', 'UK');
$currency = CMTest_TH::createDefaultCurrency();
$environment = new CM_Frontend_Environment($site, $user, $language, $timezone, $debug, $location, $currency);
$this->assertSame($site, $environment->getSite());
$this->assertSame($user, $environment->getViewer(true));
$this->assertSame($language, $environment->getLanguage());
$this->assertSame($language->getAbbreviation(), $environment->getLocale());
$this->assertSame($timezone, $environment->getTimeZone());
$this->assertSame($debug, $environment->isDebug());
$this->assertSame($location, $environment->getLocation());
$this->assertSame($currency, $environment->getCurrency());
}
示例3: testDelete
public function testDelete()
{
$currencyDefault = CMTest_TH::createDefaultCurrency();
$currencyEUR = CM_Model_Currency::create('978', 'EUR');
$paging = new CM_Paging_Currency_All();
$this->assertCount(2, $paging);
$this->assertContainsAll([$currencyDefault, $currencyEUR], $paging->getItems());
$currencyEUR->delete();
$paging = new CM_Paging_Currency_All();
$this->assertCount(1, $paging);
$this->assertContains($currencyDefault, $paging->getItems());
$this->assertNotContains($currencyEUR, $paging->getItems());
}