Skip to content

Commit

Permalink
Adding more url_for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Luraine committed Mar 11, 2010
1 parent edcd6c4 commit 0cc37b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/main.php
Expand Up @@ -179,7 +179,7 @@ function test_main_url_for()
assert_equal(url_for(''), '/');
assert_equal(url_for('/'), '/');
assert_equal(url_for('test'), '/test');
assert_equal(url_for('mañana'), '/'.rawurlencode(mañana));
assert_equal(url_for('mañana'), '/'.rawurlencode("mañana"));
assert_equal(url_for('test', 1, 2), '/test/1/2');
assert_equal(url_for('one', 'two', 'three'), '/one/two/three');
assert_equal(url_for('my/hash#test'), '/my/hash#test');
Expand All @@ -190,8 +190,11 @@ function test_main_url_for()
assert_equal(url_for($ssite_url), $ssite_url);

$url = url_for('test', array('p1' => 'lorem', 'p2' => 'ipsum'));
var_dump($url);
assert_equal($url,'/test&p1=lorem&p2=ipsum');
assert_equal($url,'/test&p1=lorem&p2=ipsum');
$url = url_for('test', array(0 => 'lorem', 'p2' => 1));
assert_equal($url,'/test&0=lorem&p2=1');
$url = url_for('test', array('p1' => 'mañana'));
assert_equal($url,'/test&p1='.rawurlencode("mañana"));
}

end_test_case();

0 comments on commit 0cc37b2

Please sign in to comment.