Skip to content

Commit

Permalink
Add some test to JURITest.
Browse files Browse the repository at this point in the history
  • Loading branch information
realityking committed May 22, 2011
1 parent 06b20b5 commit 7b68d99
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions tests/suite/joomla/environment/JURITest.php
Expand Up @@ -71,8 +71,25 @@ public function test__toString()
*/
public function testGetInstance()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
$return = JURI::getInstance('http://someuser:somepass@www.example.com:80/path/file.html?var=value#fragment');
$this->object->parse('http://someuser:somepass@www.example.com:80/path/file.html?var=value#fragment');

$this->assertThat(
$return,
$this->equalTo($this->object)
);

$this->object->parse('http://www.example.com:80/joomla/index.php?var=value 10');
$_SERVER['HTTP_HOST'] = 'www.example.com:80';
$_SERVER['SCRIPT_NAME'] = '/joomla/index.php';
$_SERVER['PHP_SELF'] = '/joomla/index.php';
$_SERVER['REQUEST_URI'] = '/joomla/index.php?var=value 10';

$return = JURI::getInstance();
$this->assertThat(
$return,
$this->equalTo($this->object)
);
}

/**
Expand All @@ -97,8 +114,10 @@ public function testBase()
*/
public function testRoot()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
$this->assertThat(
JURI::root(FALSE, '/administrator'),
$this->equalTo('http://www.example.com:80/administrator/')
);
}

/**
Expand All @@ -110,8 +129,10 @@ public function testRoot()
*/
public function testCurrent()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
$this->assertThat(
JURI::current(),
$this->equalTo('http://www.example.com:80/joomla/index.php')
);
}

/**
Expand Down

0 comments on commit 7b68d99

Please sign in to comment.