Created
December 24, 2013 09:44
-
-
Save adamcameron/8110951 to your computer and use it in GitHub Desktop.
Demonstrating issue with makePublic()
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
// Application.cfc | |
component { | |
this.mappings = { | |
"/testbox" = expandPath("/frameworks/testbox/"), | |
"/mxunit" = expandPath("/frameworks/testbox/system/testing/compat"), | |
"/unittests" = expandPath("/shared/git/blogExamples/unittests") | |
}; | |
} |
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
// somepackage/ComponentInDifferentPackage.cfc | |
component { | |
package string function aPackageMethod(){ | |
return "test for this value"; | |
} | |
} |
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
<!--- runTests.cfm ---> | |
<cfoutput> | |
#createObject("mxunit.runner.DirectoryTestSuite").run( | |
directory = getDirectoryFromPath(getCurrentTemplatePath()), | |
componentPath = "unittests.testbox.makepublic", | |
recurse = false | |
).getResultsOutput("simple")# | |
</cfoutput> |
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
// TestMakePublic.cfc | |
component extends="mxunit.framework.TestCase" { | |
public void function testMakePublic(){ | |
variables.test = new somepackage.ComponentInDifferentPackage(); | |
makepublic(variables.test, "aPackageMethod"); | |
assertEquals("test for this value", variables.test.aPackageMethod()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment