Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function testAllPublicFunctionsTested()
- {
- $called= "App".substr( get_called_class(), 4, -4 );
- $class = new \ReflectionClass( $called );
- $traits = $class->getTraits();
- foreach( $class->getMethods( ReflectionMethod::IS_PUBLIC ) as $methodObj )
- {
- foreach( $traits as $trait)
- {
- if( $trait->hasMethod( $methodObj->getName() ) )
- {
- continue 2;
- }
- }
- if( $methodObj->class == $called )
- {
- $this->assertFalse(
- strpos( $methodObj->getName(), 'scope') === false &&
- !method_exists( $this, 'test'.ucfirst( $methodObj->getName() ) ),
- "\nNo Test for public method ".$methodObj->class."::".$methodObj->getName()." in class ".get_called_class()."\n"
- );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement