-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding unit tests for the
createList
path function.
- Loading branch information
Showing
2 changed files
with
69 additions
and
16 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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
component extends="mxunit.framework.TestCase" { | ||
public void function setup() { | ||
variables.path = createObject('component', 'plugins.content.inc.resource.utility.path').init(); | ||
} | ||
|
||
public void function testReturnWithEmptyKeys_WithRootPath() { | ||
assertEquals('/', variables.path.createList('/', [])); | ||
} | ||
|
||
public void function testReturnWithEmptyKeys_WithMultiLevelPath() { | ||
assertEquals('/,/one,/one/two', variables.path.createList('/one/two', [])); | ||
} | ||
|
||
public void function testReturnWithEmptyKeys_WithSingleLevelPath() { | ||
assertEquals('/,/one', variables.path.createList('/one', [])); | ||
} | ||
|
||
public void function testReturnWithMultipleKeys_WithRootPath() { | ||
assertEquals('/~,/^', variables.path.createList('/', ['~', '^'])); | ||
} | ||
|
||
public void function testReturnWithMultipleKeys_WithMultiLevelPath() { | ||
assertEquals('/~,/^,/one/~,/one/^,/one/two/~,/one/two/^', variables.path.createList('/one/two', ['~', '^'])); | ||
} | ||
|
||
public void function testReturnWithMultipleKeys_WithSingleLevelPath() { | ||
assertEquals('/~,/^,/one/~,/one/^', variables.path.createList('/one', ['~', '^'])); | ||
} | ||
|
||
public void function testReturnWithoutKeys_WithRootPath() { | ||
assertEquals('/', variables.path.createList('/')); | ||
} | ||
|
||
public void function testReturnWithoutKeys_WithMultiLevelPath() { | ||
assertEquals('/,/one,/one/two', variables.path.createList('/one/two')); | ||
} | ||
|
||
public void function testReturnWithoutKeys_WithSingleLevelPath() { | ||
assertEquals('/,/one', variables.path.createList('/one')); | ||
} | ||
|
||
public void function testReturnWithSingleKey_WithRootPath() { | ||
assertEquals('/~', variables.path.createList('/', ['~'])); | ||
} | ||
|
||
public void function testReturnWithSimpleKey_WithMultiLevelPath() { | ||
assertEquals('/~,/one/~,/one/two/~', variables.path.createList('/one/two', ['~'])); | ||
} | ||
|
||
public void function testReturnWithSimpleKey_WithSingleLevelPath() { | ||
assertEquals('/~,/one/~', variables.path.createList('/one', ['~'])); | ||
} | ||
} |