function testGetCountryByHost() { $hu = new Country("HU"); $this->assertEquals(array("hu" => "Magyarország"), $hu->getNativeName()); $this->assertEquals(array("hu" => "Magyarország"), $hu->getNativeShortName()); $this->assertEquals(array("hu" => "Magyarország"), $hu->getNativeOfficialName()); $this->assertEquals("Hungary (Magyarország)", $hu->getDisplayName("en")); $this->assertEquals("Europe/Budapest", $hu->getMainTimezone()); $this->assertEquals(true, $hu->isEUMember()); $hu = new Country("PT"); $this->assertEquals(array("pt" => "Portugal"), $hu->getNativeName()); $this->assertEquals(array("pt" => "Portugal"), $hu->getNativeShortName()); $this->assertEquals(array("pt" => "República Portuguesa"), $hu->getNativeOfficialName()); $this->assertEquals("Portugal", $hu->getDisplayName("en")); $this->assertEquals("Atlantic/Azores", $hu->getMainTimezone()); $this->assertEquals(true, $hu->isEUMember()); $countries = $hu->getAllCountries(); foreach ($countries as $country) { $this->assertNotNull($country->getShortNameByLocale('hu')); $this->assertNotNull($country->getShortNameByLocale('en')); $this->assertNotNull($country->getNativeShortName()); } foreach ($this->countries as $countryCode) { $this->assertTrue(array_key_exists($countryCode, $countries), $countryCode . ' not found'); } }
echo $form->textFieldRow($model->event, 'city', array('class' => 'span12', 'maxlength' => 20)); ?> <?php echo $form->textFieldRow($model->event, 'province', array('class' => 'span12', 'maxlength' => 20)); ?> <?php echo $form->textFieldRow($model->event, 'postal_code', array('class' => 'span12', 'maxlength' => 7)); ?> <?php echo $form->dropDownListRow($model->event, 'country_id', CHtml::listData(Country::getAllCountries(), 'country_id', 'country_name'), array('prompt' => Yii::t('model', 'country_id_empty'))); ?> <div class="control-group"> <?php echo $form->labelEx($model->event, 'phone', array('class' => 'control-label')); ?> <div class="controls"> <?php $this->widget('CMaskedTextField', array('model' => $model->event, 'attribute' => 'phone', 'mask' => '(999) 999-9999')); ?> </div>
echo $form->textFieldRow($model->workshop, 'city', array('class' => 'span12', 'maxlength' => 20)); ?> <?php echo $form->textFieldRow($model->workshop, 'province', array('class' => 'span12', 'maxlength' => 20)); ?> <?php echo $form->textFieldRow($model->workshop, 'postal_code', array('class' => 'span12', 'maxlength' => 7)); ?> <?php echo $form->dropDownListRow($model->workshop, 'country_id', CHtml::listData(Country::getAllCountries(), 'country_id', 'country_name'), array('prompt' => Yii::t('model', 'country_id_empty'), 'class' => 'span12')); ?> <div class="control-group"> <?php echo $form->labelEx($model->workshop, 'phone', array('class' => 'control-label')); ?> <div class="controls"> <?php $this->widget('CMaskedTextField', array('model' => $model->workshop, 'attribute' => 'phone', 'mask' => '(999) 999-9999', 'htmlOptions' => array('class' => 'span12'))); ?> </div>