Issue 126: assertIsTypeOf doesn't consider parents
Status:  Fixed
Owner:
Closed:  Jul 2008
Cc:
Project Member Reported by marc.es...@gmail.com, Jul 8, 2008
drop this into any test case:

<cffunction name="testistypeof" returntype="void" hint="">
		<cfset assertIsTypeOf(this,"mxunit.framework.TestCase")>	
	</cffunction>

this should work because my current cfc extends mxunit.framework.testcase,
but i get an error that it's not.
Jul 8, 2008
Project Member #1 virtix
I'll take a gander now ... I know we can easily look at both the current object and
it's "immediate" parent, but what about walking up the whole tree? And what about the
polymorphic implications (did I just say that?) using cfinterface or
implements="...". In Java there is the concept of expected and actual types, which
can vary at runtime. CF is getting there. So, the question, then, is what type can a
CFC be? For now, let's just look at the immediate parent, too? Another example is
that TestCase extends Assert, so every test that extends TestCase is a type of
itself, TestCase, and Assert ...
Jul 8, 2008
Project Member #2 marc.es...@gmail.com
yeah, i'd say that is correct. unless you add a "strict" argument where it only
considers its immediate type and not its inheritance tree.

but i'd think that any test case would, indeed, be of type assert, too.  that
inheritance tree sure is funky though!
Jul 8, 2008
Project Member #3 virtix
Ok. That was fun, really. Used a little recursive function to walk up the 
inheritance tree in the meta data struct. So, mxunit.tests.bug. bug126  works as 
expected in typical and atypical scenarios.
Status: Fixed