Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

details url changes with tests! #63

Merged
merged 1 commit into from

2 participants

@ryandoherty

Here's my code for issue #53. Hope I got everything, let me know what I've missed.

I also added tests :)

@sergeychernyshev

Awesome! I'll try to look at it today and merge it! And thanks for starting a tradition of testing in this project ;)

@sergeychernyshev sergeychernyshev merged commit 222d3c6 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 3, 2012
  1. @ryandoherty
This page is out of date. Refresh to see the latest.
View
1  .htaccess
@@ -21,6 +21,7 @@ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip
SetEnv mod_rewrite On
RewriteEngine On
RewriteRule . - [E=URLVERSIONREWRITE:YES]
+RewriteRule ^details/([0-9]+)/(.*)$ details/index.php?urlid=$1&url=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.(\d+)(_m_\d+)?\.([^\.]+)$ $1.$4 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
View
5 all.php
@@ -2,6 +2,7 @@
require_once(dirname(__FILE__).'/global.php');
require_once(dirname(__FILE__).'/users/users.php');
require_once(dirname(__FILE__).'/paginator.class.php');
+require_once(dirname(__FILE__).'/functions.php');
$searchstring = null;
if (array_key_exists('search', $_GET) && trim($_GET['search']) != '') {
@@ -43,7 +44,7 @@
$paramsstring = '';
?>
<ul>
-<?php
+<?php
if ($current_group == '__show_all__') {
?>
<li><b>All URLs</b></li>
@@ -258,7 +259,7 @@
<td title="Current dynaTrace score: <?php echo prettyScore($row['dt_o'])?> (<?php echo $row['dt_o']?>)"><div class="gbox"><div style="width: <?php echo $row['dt_o']+1?>px" class="bar c<?php echo scoreColorStep($row['dt_o'])?>"/></div></td>
<?php }?>
- <td class="url"><a href="details/?urlid=<?php echo urlencode($row['url_id'])?>&url=<?php echo urlencode($row['url'])?>"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></a></td>
+ <td class="url"><a href="<?= detailsUrl($row['url_id'], $row['url']);?>"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></a></td>
</tr><?php
}
View
8 details/compare.js
@@ -2,7 +2,7 @@
/*global Timeplot, YAHOO*/
var timeplot;
-YAHOO.util.Event.onDOMReady(function() {
+YAHOO.util.Event.onDOMReady(function() {
var timeGeometry = new Timeplot.DefaultTimeGeometry({
gridColor: "#000000",
axisLabelsPlacement: "bottom"
@@ -39,11 +39,11 @@ YAHOO.util.Event.onDOMReady(function() {
for (var url in data) {
if (ranker == 'pagespeed') {
- timeplot.loadText('data_pagespeed.php?smooth&subset=graph&urlid=' + encodeURIComponent(data[url].id) + '&ver=' + data[url].version, ",", data[url].eventsource);
+ timeplot.loadText(SHOWSLOW.base_url+'details/data_pagespeed.php?smooth&subset=graph&urlid=' + encodeURIComponent(data[url].id) + '&ver=' + data[url].version, ",", data[url].eventsource);
} else if (ranker == 'dynatrace') {
- timeplot.loadText('data_dynatrace.php?smooth&subset=graph&urlid=' + encodeURIComponent(data[url].id) + '&ver=' + data[url].version, ",", data[url].eventsource);
+ timeplot.loadText(SHOWSLOW.base_url+'details/data_dynatrace.php?smooth&subset=graph&urlid=' + encodeURIComponent(data[url].id) + '&ver=' + data[url].version, ",", data[url].eventsource);
} else {
- timeplot.loadText('data.php?smooth&subset=graph&profile=ydefault&urlid=' + encodeURIComponent(data[url].id) + '&ver=' + data[url].version, ",", data[url].eventsource);
+ timeplot.loadText(SHOWSLOW.base_url+'details/data.php?smooth&subset=graph&profile=ydefault&urlid=' + encodeURIComponent(data[url].id) + '&ver=' + data[url].version, ",", data[url].eventsource);
}
}
View
16 details/details.js
@@ -1,7 +1,7 @@
/*jslint browser: true*/
/*global YAHOO*/
-YAHOO.util.Event.onDOMReady(function() {
+YAHOO.util.Event.onDOMReady(function() {
var loader = new YAHOO.util.YUILoader({
require: ["dom", "container", "datatable", "datasource"],
@@ -20,7 +20,7 @@ YAHOO.util.Event.onDOMReady(function() {
el.innerHTML='<div class="moreinfo"></div>';
- new YAHOO.widget.Tooltip("tt_"+name,
+ new YAHOO.widget.Tooltip("tt_"+name,
{
context: el,
text: decodeURIComponent(details[name].join('<br/>'))
@@ -52,28 +52,28 @@ YAHOO.util.Event.onDOMReady(function() {
{key:"rank", label:"Overall Rank (0-100)", sortable:true},
{key:"timetoimp", label:"Time to First Impression (ms)", sortable:true},
];
- var yDataSource = new YAHOO.util.DataSource("data.php?subset=table&");
+ var yDataSource = new YAHOO.util.DataSource(SHOWSLOW.base_url+"details/data.php?subset=table&");
yDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
yDataSource.responseSchema = {
- recordDelim : "\n",
+ recordDelim : "\n",
fieldDelim : "," ,
resultsList: "records",
fields: ["timestamp", "w", "o", "r", "lt", "profile"]
};
- var psDataSource = new YAHOO.util.DataSource("data_pagespeed.php?subset=table&");
+ var psDataSource = new YAHOO.util.DataSource(SHOWSLOW.base_url+"details/data_pagespeed.php?subset=table&");
psDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
psDataSource.responseSchema = {
- recordDelim : "\n",
+ recordDelim : "\n",
fieldDelim : "," ,
resultsList: "records",
fields: ["timestamp", "w", "o", "l", "r"]
};
- var dtDataSource = new YAHOO.util.DataSource("data_dynatrace.php?subset=table&");
+ var dtDataSource = new YAHOO.util.DataSource(SHOWSLOW.base_url+"details/data_dynatrace.php?subset=table&");
dtDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
dtDataSource.responseSchema = {
- recordDelim : "\n",
+ recordDelim : "\n",
fieldDelim : "," ,
resultsList: "records",
fields: ["timestamp", "size", "numreq", "rank", "timetoimp"]
View
39 details/index.php
@@ -1,6 +1,7 @@
-<?php
+<?php
require_once(dirname(dirname(__FILE__)).'/global.php');
require_once(dirname(dirname(__FILE__)).'/users/users.php');
+require_once(dirname(dirname(__FILE__)).'/functions.php');
$urlid = array_key_exists('urlid', $_GET) ? filter_var($_GET['urlid'], FILTER_VALIDATE_INT) : null;
$url = array_key_exists('url', $_GET) ? filter_var($_GET['url'], FILTER_VALIDATE_URL) : null;
@@ -19,10 +20,18 @@ function not_found() {
exit;
}
-if (!$urlid && !$url) {
+if(strpos($_SERVER['REQUEST_URI'], $url) === false) {
+ //If we don't see the url in the request string, apache stripped out one of the '/' in http://
+ $matches = array();
+ preg_match("#^/+details/+([0-9]+)/+(.*)$#", $_SERVER["REQUEST_URI"], $matches);
+ $url = $matches[2];
+}
+
+if (!$url) {
not_found();
}
+
if (!$urlid && $url) {
# building a query to select all beacon data in one swoop
$query = "SELECT id FROM urls WHERE urls.url_md5 = UNHEX(MD5('".mysql_real_escape_string($url)."'))";
@@ -43,8 +52,12 @@ function not_found() {
not_found();
}
- header('Location: ?urlid='.$urlid.'&url='.urlencode($url));
- exit;
+ if(getenv("URLVERSIONREWRITE") == "YES") {
+ header("Location: ".detailsUrl($urlid, $url));
+ } else {
+ header("Location: ".detailsUrl($urlid, $url));
+ exit;
+ }
}
}
@@ -174,7 +187,7 @@ function not_found() {
foreach ($all_metrics as $provider_name => $provider) {
if ($enabledMetrics[$provider_name] && !is_null($row[$provider_name.'_timestamp']))
{
- $flot_versions[$provider_name] = $row[$provider_name.'_timestamp'];
+ $flot_versions[$provider_name] = $row[$provider_name.'_timestamp'];
foreach ($provider['metrics'] as $section_name => $section) {
foreach ($section as $metric) {
@@ -556,7 +569,7 @@ function not_found() {
}
if ($metric['type'] == BYTES) {
- ?><span title="<?php echo $value ?> bytes"><?php echo floor($value/1000) ?>KB</span><?php
+ ?><span title="<?php echo $value ?> bytes"><?php echo floor($value/1000) ?>KB</span><?php
} else {
echo $value.$metric_types[$metric['type']]['units'];
}
@@ -599,7 +612,7 @@ function not_found() {
?><tr><td colspan="8" class="sectionname"><b><?php echo $section_name ?></b></td></tr><?php
$odd = true;
-
+
foreach ($metrics as $metric) {
if ($odd) { ?><tr><?php }
@@ -621,7 +634,7 @@ function not_found() {
$value = $row[$provider_name.'_'.$metric[1]];
if (is_null($value)) {
- ?><td colspan="3" class="na">n/a</td><?php
+ ?><td colspan="3" class="na">n/a</td><?php
} else {
if ($metric[2] == PERCENT_GRADE){
$pretty_score = prettyScore($value);
@@ -656,7 +669,7 @@ function not_found() {
}
if ($metric[2] == BYTES) {
- ?><span title="<?php echo $value ?> bytes"><?php echo floor($value/1000) ?>KB</span><?php
+ ?><span title="<?php echo $value ?> bytes"><?php echo floor($value/1000) ?>KB</span><?php
} else {
echo $value.$metric_types[$metric[2]]['units'];
}
@@ -677,7 +690,7 @@ function not_found() {
</table>
</div>
</fieldset>
- <?php
+ <?php
}
}
}
@@ -686,21 +699,21 @@ function not_found() {
?>
<a name="yslow-table"/><h2>YSlow measurements history (<a href="data.php?ver=<?php echo urlencode($row['yslow_timestamp'])?>&urlid=<?php echo urlencode($urlid)?>">csv</a>)</h2>
<div id="measurementstable" class="measurementstable"></div>
- <?php
+ <?php
}
if ($enabledMetrics['pagespeed'] && !is_null($row['pagespeed_timestamp'])) {
?>
<a name="pagespeed-table"/><h2>Page Speed measurements history (<a href="data_pagespeed.php?ver=<?php echo urlencode($row['pagespeed_timestamp'])?>&urlid=<?php echo urlencode($urlid)?>">csv</a>)</h2>
<div id="ps_measurementstable" class="measurementstable"></div>
-<?php
+<?php
}
if ($enabledMetrics['dynatrace'] && !is_null($row['dynatrace_timestamp'])) {
?>
<a name="dynatrace-table"/><h2>dynaTrace measurements history (<a href="data_dynatrace.php?ver=<?php echo urlencode($row['dynatrace_timestamp'])?>&urlid=<?php echo urlencode($urlid)?>">csv</a>)</h2>
<div id="dt_measurementstable" class="measurementstable"></div>
-<?php
+<?php
}
if (count($pagetest) > 0) {
View
4 details/showslow.flot.js
@@ -156,7 +156,7 @@ var SS = (function ($) {
// populate event lines
function _getEvents() {
$.ajax({
- url: 'events2.php',
+ url: SHOWSLOW.base_url+'details/events2.php',
data: 'url=' + encodeURIComponent(url) + '&ver=' + encodeURIComponent(eventversion),
dataType: 'json',
cache: true,
@@ -175,7 +175,7 @@ var SS = (function ($) {
if (typeof(callback) !== 'function') { callback = false; }
$.ajax({
- url: 'data2.php',
+ url: SHOWSLOW.base_url+'details/data2.php',
dataType: 'json',
cache: true,
data: 'urlid=' + encodeURIComponent(options.urlid) + '&provider=' + encodeURIComponent(options.provider) + '&metrics=' + encodeURIComponent(options.metrics) + '&format=json&ver=' + encodeURIComponent(flot_versions[options.provider]),
View
14 details/timeplot.js
@@ -2,7 +2,7 @@
/*global Timeplot, YAHOO*/
var timeplot;
-YAHOO.util.Event.onDOMReady(function() {
+YAHOO.util.Event.onDOMReady(function() {
var eventSource2 = new Timeplot.DefaultEventSource(); // YSlow2 measurements
var pagespeed = new Timeplot.DefaultEventSource(); // Page Speed measurements
var dynatrace = new Timeplot.DefaultEventSource(); // dynaTrace measurements
@@ -102,7 +102,7 @@ YAHOO.util.Event.onDOMReady(function() {
valueGeometry: valueGeometryRequests,
lineColor: "#75CF74",
showValues: true
- }),
+ }),
Timeplot.createPlotInfo({
id: "showslowevents",
timeGeometry: timeGeometry,
@@ -136,21 +136,21 @@ YAHOO.util.Event.onDOMReady(function() {
}
timeplot = Timeplot.create(document.getElementById("my-timeplot"), plotInfo);
- timeplot.loadXML('events.php?url=' + encodeURIComponent(url) + '&ver=' + eventversion, showslowevents);
+ timeplot.loadXML(SHOWSLOW.base_url+'details/events.php?url=' + encodeURIComponent(url) + '&ver=' + eventversion, showslowevents);
if (ydataversion) {
- timeplot.loadText('data.php?smooth=yes&subset=graph&profile=ydefault&url=' + encodeURIComponent(url) + '&ver=' + ydataversion, ",", eventSource2);
+ timeplot.loadText(SHOWSLOW.base_url+'details/data.php?smooth=yes&subset=graph&profile=ydefault&url=' + encodeURIComponent(url) + '&ver=' + ydataversion, ",", eventSource2);
}
if (psdataversion) {
- timeplot.loadText('data_pagespeed.php?smooth=yes&subset=graph&url=' + encodeURIComponent(url) + '&ver=' + psdataversion, ",", pagespeed);
+ timeplot.loadText(SHOWSLOW.base_url+'details/data_pagespeed.php?smooth=yes&subset=graph&url=' + encodeURIComponent(url) + '&ver=' + psdataversion, ",", pagespeed);
}
if (dtdataversion) {
- timeplot.loadText('data_dynatrace.php?smooth=yes&subset=graph&url=' + encodeURIComponent(url) + '&ver=' + dtdataversion, ",", dynatrace);
+ timeplot.loadText(SHOWSLOW.base_url+'details/data_dynatrace.php?smooth=yes&subset=graph&url=' + encodeURIComponent(url) + '&ver=' + dtdataversion, ",", dynatrace);
}
for (var name in metrics) {
- timeplot.loadText('data_metric.php?smooth=yes&metric=' + name + '&url=' + encodeURIComponent(url), ",", metrics[name].source);
+ timeplot.loadText(SHOWSLOW.base_url+'details/data_metric.php?smooth=yes&metric=' + name + '&url=' + encodeURIComponent(url), ",", metrics[name].source);
}
})
View
10 functions.php
@@ -0,0 +1,10 @@
+<?php
+
+ function detailsUrl($urlId, $url) {
+ global $showslow_base;
+ if(getenv('URLVERSIONREWRITE') == 'YES') {
+ return $showslow_base."details/".$urlId."/".$url;
+ } else {
+ return $showslow_base."details/?urlid=".$urlId."&url=".$url;
+ }
+ }
View
17 header.php
@@ -35,7 +35,10 @@
<link rel="stylesheet" media="all" type="text/css" href="<?php echo assetURL('css/stacklayout_lte_ie7.css')?>" />
<![endif]-->
<link rel="stylesheet" type="text/css" media="screen, projection" href="<?php echo assetURL('css/common.css')?>" />
-
+<script>
+ var SHOWSLOW = SHOWSLOW || {};
+ SHOWSLOW.base_url = '<?= $showslow_base;?>';
+</script>
<?php
if (isset($STYLES)) {
foreach ($STYLES as $_style) {
@@ -76,12 +79,12 @@ function _kms(u){
var uservoiceOptions = {
/* required */
key: 'showslow',
- host: 'showslow.uservoice.com',
+ host: 'showslow.uservoice.com',
forum: '18807',
- showTab: true,
+ showTab: true,
/* optional */
alignment: 'right',
- background_color:'#f00',
+ background_color:'#f00',
text_color: 'white',
hover_color: '#06C',
lang: 'en'
@@ -169,7 +172,7 @@ function _loadUserVoice() {
<div id="header">
<div class="stackContent">
<h1><a href="<?php echo $showslow_base ?>"><img src="<?php echo assetURL('img/logo-shadow.png')?>" alt="Show Slow" /></a> Is your website <b>getting faster</b>?
-<?php if ($enableMyURLs && is_null($current_user)) {?><a href="<?php echo $showslow_base.'/users/register.php' ?>">Sign up now</a><?php } ?>
+<?php if ($enableMyURLs && is_null($current_user)) {?><a href="<?php echo $showslow_base.'/users/register.php' ?>">Sign up now</a><?php } ?>
</h1>
<?php if ($enableMyURLs) {?>
@@ -200,7 +203,7 @@ function _loadUserVoice() {
$first = true;
foreach ($defaultURLsToCompare as $_url) {
if ($first) {
- $first = false;
+ $first = false;
}
else {
$compareParams.= '&';
@@ -210,7 +213,7 @@ function _loadUserVoice() {
}
?>
<li><a <?php if ($SECTION == 'compare') {?>class="current" <?php } ?>href="<?php echo $showslow_base ?>details/compare.php<?php echo $compareParams?>">Compare rankings</a></li>
-<?php
+<?php
foreach ($customLists as $list_id => $list) {
if (array_key_exists('hidden', $list) && $list['hidden']) {
continue;
View
9 index.php
@@ -1,12 +1,13 @@
-<?php
+<?php
require_once(dirname(__FILE__).'/global.php');
require_once(dirname(__FILE__).'/users/users.php');
+require_once(dirname(__FILE__).'/functions.php');
$SECTION = 'home';
require_once(dirname(__FILE__).'/header.php');
?>
<div style="width: 100%; overflow: hidden">
-<?php
+<?php
$query = sprintf("SELECT url, urls.id as url_id, last_update,
yslow2.o as o,
pagespeed.o as ps_o,
@@ -83,8 +84,8 @@
<td title="Current dynaTrace score: <?php echo prettyScore($row['dt_o'])?> (<?php echo $row['dt_o']?>)"><div class="gbox"><div style="width: <?php echo $row['dt_o']+1?>px" class="bar c<?php echo scoreColorStep($row['dt_o'])?>"/></div></td>
<?php }?>
- <td class="url"><a href="details/?urlid=<?php echo urlencode($row['url_id'])?>&url=<?php echo urlencode($row['url'])?>"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></a></td>
- </tr><?php
+ <td class="url"><a href="<?=detailsUrl($row['url_id'], $row['url']);?>"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></a></td>
+ </tr><?php
}
mysql_free_result($result);
View
10 list.php
@@ -11,7 +11,7 @@
<h1>404 No list found</h1>
<p>List with such ID is not defined</p>
</body></html>
-<?php
+<?php
exit;
}
@@ -25,7 +25,7 @@
$list .= ', ';
}
- $list .= "'".mysql_real_escape_string($url)."'";
+ $list .= "'".mysql_real_escape_string($url)."'";
}
$query = sprintf("SELECT url, urls.id as url_id, last_update,
@@ -115,7 +115,7 @@
}
?><tr>
<?php if ($row['last_update']) { ?>
- <td style="text-align: right; padding-right: 1em"><a title="Time of last check for this URL" href="details/?urlid=<?php echo urlencode($row['url_id']); ?>&url=<?php echo urlencode($row['url']); ?>"><?php echo htmlentities($row['last_update']); ?></a></td>
+ <td style="text-align: right; padding-right: 1em"><a title="Time of last check for this URL" href="<?= detailsUrl($row['url_id'], $row['url']);?>"><?php echo htmlentities($row['last_update']); ?></a></td>
<?php if (!$yslow) {?>
<?php }else if (is_null($row['o'])) {?>
@@ -144,7 +144,7 @@
<td title="Current dynaTrace score: <?php echo prettyScore($row['dt_o'])?> (<?php echo $row['dt_o']?>)"><div class="gbox"><div style="width: <?php echo $row['dt_o']+1?>px" class="bar c<?php echo scoreColorStep($row['dt_o'])?>"/></div></td>
<?php }?>
- <td style="padding-left: 1em; overflow: hidden; white-space: nowrap;"><a href="details/?urlid=<?php echo urlencode($row['url_id']); ?>&url=<?php echo urlencode($row['url'])?>"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></a></td>
+ <td style="padding-left: 1em; overflow: hidden; white-space: nowrap;"><a href="<?= detailsUrl($row['url_id'], $row['url'];?>"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></a></td>
<?php } else { ?>
<td style="text-align: right; padding-right: 1em"><i title="added to the testing queue">queued</i></td>
<td colspan="4"/>
@@ -156,7 +156,7 @@
mysql_free_result($result);
?>
</table>
-<?php
+<?php
}
require_once(dirname(__FILE__).'/footer.php');
View
5 my.php
@@ -185,7 +185,7 @@
<td style="color: red; text-align: right; padding-right: 1em"><i title="This URL is ignored by this instance of Show Slow">ignored</i></td>
<td colspan="<?php echo $cols*2 ?>"/>
<?php } else if (!is_null($row['o']) || !is_null($row['ps_o']) || !is_null($row['dt_o'])) { ?>
- <td style="text-align: right; padding-right: 1em"><a title="Time of last check for this URL" href="details/?urlid=<?php echo urlencode($row['id']); ?>&url=<?php echo urlencode($row['url']); ?>"><?php echo htmlentities($row['last_update']); ?></a></td>
+ <td style="text-align: right; padding-right: 1em"><a title="Time of last check for this URL" href="<?= detailsUrl($row['id'], $row['url'];?>"><?php echo htmlentities($row['last_update']); ?></a></td>
<?php if (!$yslow) {?>
<?php } else if (!is_null($row['o'])) {?>
<td class="score" title="Current YSlow grade: <?php echo prettyScore($row['o'])?> (<?php echo $row['o']?>)"><?php echo prettyScore($row['o'])?> (<?php echo $row['o']?>)</td>
@@ -222,7 +222,6 @@
<td style="text-align: center"><input type="submit" name="delete[<?php echo htmlentities($row['id'])?>]" value="X" style="font-size: xx-small" title="Stop monitoring this URL" onclick="return confirm('Are you sure you want to remove this URL?')"/></td>
<?php if ($link) {?>
- <td style="padding-left: 1em; overflow: hidden; white-space: nowrap;"><a href="details/?urlid=<?php echo urlencode($row['id']); ?>&url=<?php echo urlencode($row['url'])?>"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></a></td>
<?php } else { ?>
<td style="padding-left: 1em; overflow: hidden; white-space: nowrap;"><i title="Time of last check for this URL"><?php echo htmlentities(substr($row['url'], 0, 100))?><?php if (strlen($row['url']) > 100) { ?>...<?php } ?></i></td>
<?php } ?>
@@ -233,7 +232,7 @@
?>
</table>
</form>
-<?php
+<?php
}
require_once(dirname(__FILE__).'/footer.php');
View
17 tests/UrlTest.php
@@ -0,0 +1,17 @@
+<?php
+ include('../global.php');
+ include('../functions.php');
+ class UrlTest extends PHPUnit_Framework_TestCase
+ {
+ public function testDetailsUrl() {
+ global $showslow_base;
+ putenv("URLVERSIONREWRITE=YES");
+ $url = 'http://www.foo.com';
+ $urlId = 2345;
+ $this->assertEquals(detailsUrl($urlId, $url), $showslow_base.'details/'.$urlId.'/'.$url);
+
+ putenv("URLVERSIONREWRITE=NO");
+ $this->assertEquals(detailsUrl($urlId, $url), $showslow_base.'details/?urlid='.$urlId.'&url='.$url);
+ }
+ }
+?>
Something went wrong with that request. Please try again.