function testDescription() { $this->assertNotEmpty(geoip_detect2_get_current_source_description()); $record = geoip_detect2_get_info_from_ip(GEOIP_DETECT_TEST_IP); $this->assertNotEmpty(geoip_detect2_get_current_source_description($record)); $desc = do_shortcode('[geoip_detect2_get_current_source_description]'); $this->assertNotSame('[geoip_detect2_get_current_source_description]', $desc, 'Shortcode was not executed.'); $this->assertNotEmpty($desc, 'Shortcode returned empty string'); }
public function testEachSourceForFormalValidity() { $sources = $this->registry->getAllSources(); foreach ($sources as $source) { $id = $source->getId(); $this->assertRegExp('/^[-_a-z0-9]+$/i', $id, 'Invalid chars in id name'); $label = $source->getLabel(); $this->assertNotEmpty($label, 'Label of "' . $id . '" missing.'); $desc = geoip_detect2_get_current_source_description($id); $this->assertNotEmpty($desc, 'Description of "' . $id . '" missing.'); } }
">Test IP Detection Lookup</a></p> <?php if (!empty($message)) { ?> <p class="geoip_detect_error"> <?php echo $message; ?> </p> <?php } ?> <p> <?php printf(__('<b>Selected data source:</b> %s', 'geoip-detect'), geoip_detect2_get_current_source_description()); ?> </p> <p> <?php echo $currentSource->getStatusInformationHTML(); ?> </p> <?php if ($options) { ?> <h3>Options for this data source</h3> <p> <form method="post" action="#"> <input type="hidden" name="action" value="options-source" /> <?php
function geoip_detect2_shortcode_get_current_source_description($attr) { $external_ip = geoip_detect2_get_current_source_description(); return $external_ip; }