This repository has been archived by the owner on Nov 26, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing #1220. This should also resolve the old JoomlaCode tracker item:
- Loading branch information
1 parent
7983df6
commit 9b9462c
Showing
2 changed files
with
88 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,110 +1,112 @@ | |||
<?php | <?php | ||
/** | /** | ||
* @package Joomla.UnitTest | * @package Joomla.UnitTest | ||
* @subpackage Filesystem | |||
* | * | ||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. | * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE | * @license GNU General Public License version 2 or later; see LICENSE | ||
*/ | */ | ||
|
|
||
include_once JPATH_PLATFORM . '/joomla/filesystem/path.php'; | JLoader::register('JPath', JPATH_PLATFORM . '/joomla/filesystem/path.php'); | ||
|
|
||
/** | /** | ||
* Test class for JPath. | * Tests for the JPath class. | ||
* Generated by PHPUnit on 2011-10-26 at 19:32:34. | * | ||
* @package Joomla.UnitTest | |||
* @subpackage Filesystem | |||
* @since 12.2 | |||
*/ | */ | ||
class JPathTest extends PHPUnit_Framework_TestCase { | class JPathTest extends TestCase | ||
|
{ | ||
/** | /** | ||
* @var JPath | * Data provider for testClean() method. | ||
*/ | * | ||
protected $object; | * @return array | ||
|
* | ||
/** | * @since 12.2 | ||
* Sets up the fixture, for example, opens a network connection. | */ | ||
* This method is called before a test is executed. | public function getCleanData() | ||
*/ | { | ||
protected function setUp() { | return array( | ||
$this->object = new JPath; | // Input Path, Directory Separator, Expected Output | ||
} | 'Nothing to do.' => array('/var/www/foo/bar/baz', '/', '/var/www/foo/bar/baz'), | ||
'One backslash.' => array('/var/www/foo\\bar/baz', '/', '/var/www/foo/bar/baz'), | |||
'Two and one backslashes.' => array('/var/www\\\\foo\\bar/baz', '/', '/var/www/foo/bar/baz'), | |||
'Mixed backslashes and double forward slashes.' => array('/var\\/www//foo\\bar/baz', '/', '/var/www/foo/bar/baz'), | |||
'UNC path.' => array('\\\\www\\docroot', '\\', '\\\\www\\docroot'), | |||
'UNC path with forward slash.' => array('\\\\www/docroot', '\\', '\\\\www\\docroot'), | |||
'UNC path with UNIX directory separator.' => array('\\\\www/docroot', '/', '/www/docroot'), | |||
); | |||
} | |||
|
|
||
/** | /** | ||
* Tears down the fixture, for example, closes a network connection. | |||
* This method is called after a test is executed. | |||
*/ | |||
protected function tearDown() { | |||
|
|||
} | |||
|
|||
/** | |||
* @todo Implement testCanChmod(). | * @todo Implement testCanChmod(). | ||
*/ | */ | ||
public function testCanChmod() { | public function testCanChmod() | ||
// Remove the following lines when you implement this test. | { | ||
$this->markTestIncomplete( | // Remove the following lines when you implement this test. | ||
'This test has not been implemented yet.' | $this->markTestIncomplete('This test has not been implemented yet.'); | ||
); | } | ||
} | |||
|
|
||
/** | /** | ||
* @todo Implement testSetPermissions(). | * @todo Implement testSetPermissions(). | ||
*/ | */ | ||
public function testSetPermissions() { | public function testSetPermissions() | ||
// Remove the following lines when you implement this test. | { | ||
$this->markTestIncomplete( | // Remove the following lines when you implement this test. | ||
'This test has not been implemented yet.' | $this->markTestIncomplete('This test has not been implemented yet.'); | ||
); | } | ||
} | |||
|
|
||
/** | /** | ||
* @todo Implement testGetPermissions(). | * @todo Implement testGetPermissions(). | ||
*/ | */ | ||
public function testGetPermissions() { | public function testGetPermissions() | ||
// Remove the following lines when you implement this test. | { | ||
$this->markTestIncomplete( | // Remove the following lines when you implement this test. | ||
'This test has not been implemented yet.' | $this->markTestIncomplete('This test has not been implemented yet.'); | ||
); | } | ||
} | |||
|
|
||
/** | /** | ||
* @todo Implement testCheck(). | * @todo Implement testCheck(). | ||
*/ | */ | ||
public function testCheck() { | public function testCheck() | ||
// Remove the following lines when you implement this test. | { | ||
$this->markTestIncomplete( | // Remove the following lines when you implement this test. | ||
'This test has not been implemented yet.' | $this->markTestIncomplete('This test has not been implemented yet.'); | ||
); | } | ||
} | |||
|
|
||
/** | /** | ||
* @todo Implement testClean(). | * Tests the clean method. | ||
*/ | * | ||
public function testClean() { | * @return void | ||
// Remove the following lines when you implement this test. | * | ||
$this->markTestIncomplete( | * @covers JPath::clean | ||
'This test has not been implemented yet.' | * @dataProvider getCleanData | ||
); | * @since 12.2 | ||
} | */ | ||
public function testClean($input, $ds, $expected) | |||
{ | |||
$this->assertEquals( | |||
$expected, | |||
JPath::clean($input, $ds) | |||
); | |||
} | |||
|
|
||
/** | /** | ||
* @todo Implement testIsOwner(). | * @todo Implement testIsOwner(). | ||
*/ | */ | ||
public function testIsOwner() { | public function testIsOwner() | ||
// Remove the following lines when you implement this test. | { | ||
$this->markTestIncomplete( | // Remove the following lines when you implement this test. | ||
'This test has not been implemented yet.' | $this->markTestIncomplete('This test has not been implemented yet.'); | ||
); | } | ||
} | |||
|
|
||
/** | /** | ||
* @todo Implement testFind(). | * @todo Implement testFind(). | ||
*/ | */ | ||
public function testFind() { | public function testFind() | ||
// Remove the following lines when you implement this test. | { | ||
$this->markTestIncomplete( | // Remove the following lines when you implement this test. | ||
'This test has not been implemented yet.' | $this->markTestIncomplete('This test has not been implemented yet.'); | ||
); | } | ||
} | |||
|
|||
} | } | ||
|
|||
?> |