本文整理汇总了PHP中Currency::getCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::getCount方法的具体用法?PHP Currency::getCount怎么用?PHP Currency::getCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Currency
的用法示例。
在下文中一共展示了Currency::getCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLoad
public function testLoad()
{
$customFieldData = CustomFieldData::getByName('Titles');
$this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('AccountTypes');
$this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('LeadSources');
$this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('Industries');
$this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('MeetingCategories');
$this->assertEquals(0, count(unserialize($customFieldData->serializedData)));
$this->assertEquals(0, ContactState::getCount());
// do a getAll to ensure we create base currency
$baseCurrency = Currency::getAll();
$this->assertCount(1, $baseCurrency);
$this->assertEquals(1, Currency::getCount());
$messageLogger = new MessageLogger();
DefaultDataUtil::load($messageLogger);
$customFieldData = CustomFieldData::getByName('Titles');
$this->assertEquals(4, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('AccountTypes');
$this->assertEquals(3, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('LeadSources');
$this->assertEquals(4, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('Industries');
$this->assertEquals(9, count(unserialize($customFieldData->serializedData)));
$customFieldData = CustomFieldData::getByName('MeetingCategories');
$this->assertEquals(2, count(unserialize($customFieldData->serializedData)));
$this->assertEquals(6, ContactState::getCount());
$this->assertEquals(1, Currency::getCount());
}
示例2: testGetAllMakesBaseCurrency
public function testGetAllMakesBaseCurrency()
{
$this->assertEquals(0, count(Currency::getAll(null, false, null, false)));
$currency = Yii::app()->currencyHelper;
$this->assertEquals('USD', $currency->getBaseCode());
$this->assertEquals(0, Currency::getCount());
$this->assertEquals(1, count(Currency::getAll()));
$this->assertEquals(1, Currency::getCount());
}
示例3: testGetAllMakesBaseCurrency
public function testGetAllMakesBaseCurrency()
{
$this->assertEquals(0, count(Currency::getAll(null, false, null, false)));
$currency = Yii::app()->currencyHelper;
$this->assertEquals('USD', $currency->getBaseCode());
$this->assertEquals(0, Currency::getCount());
// do a getAll to ensure we create base currency
$baseCurrency = Currency::getAll();
$this->assertCount(1, $baseCurrency);
$this->assertEquals(1, Currency::getCount());
}
示例4: _new
public function _new()
{
$flash = Flash::Instance();
$errors = array();
$currency = new Currency();
if ($currency->getCount() == 0) {
$errors[] = 'No Currencies defined';
}
if (count($errors) > 0) {
$flash->addErrors($errors);
sendback();
}
parent::_new();
}
示例5: testGetAndSetCurrencyValue
public function testGetAndSetCurrencyValue()
{
$currencyHelper = Yii::app()->currencyHelper;
$this->assertEquals('USD', $currencyHelper->getBaseCode());
$this->assertEquals(0, Currency::getCount());
// do a getAll to ensure we create base currency
$baseCurrency = Currency::getAll();
$this->assertCount(1, $baseCurrency);
$this->assertEquals(1, Currency::getCount());
//create a currency value and confirm the rateToBase populates correctly.
$opportunity = new Opportunity();
$opportunity->name = 'Tyfe';
$opportunity->stage->value = 'Starting Up';
$opportunity->closeDate = '2008-10-05';
$opportunity->amount->value = 456.78;
//Setting the amount currency should not increase the currency table with a blank currency.
$this->assertEquals(1, Currency::getCount());
$opportunity->amount->currency = Currency::getByCode('USD');
$this->assertEquals(1, Currency::getCount());
$this->assertTrue($opportunity->save());
$this->assertEquals(1, $opportunity->amount->rateToBase);
$this->assertEquals(Currency::getByCode('USD'), $opportunity->amount->currency);
}