I need to check if a variable is an object of the User type. User is my class $user my object
$user
$this->assertInstanceOf($user,User);
http://apigen.juzna.cz/doc/sebastianbergmann/phpunit/function-assertInstanceOf.html
I think you are using this function wrong. Try:
$this->assertInstanceOf('User', $user);