This one time, when I was bored...
And now, for some Diamond/Pearl fun.
After hearing on a site that you could get Ditto to learn Dunsparce's move set, I thought "Dunsparce being useful, no wai!" paired with the fact that Transform is known to be a VERY buggy move, so when the opportunity struck, I just had to try out.
First I flew to route 208, or whatever the name of the route where you found dunsparce, then I proceeded as follows:
1.) Encounter a Dunsparce.
2.) Have Ditto transform and fight with it
.
3.) Make sure that Ditto uses up all it's moves as dunsparce, without KOing the dunsparce you're fighting against. (which is thankfully easy seeing that dunsparce only has one attack, rage.)
4.)Then, KO the enemy dunsparce with struggle.
5.)If Ditto didn't faint while fighting, then it should have Rage, Glare, Yawn, and some other fourth move I forgot about all at 0PP.
Restore it at a Pokemon center to regain the PP.
6.) Since Ditto forgets Transform in the process, you need to go to the move tutor in order for it to relearn the move.
And there you have it, though I don't know why you'd want a Ditto with dunsparce's move set, other then for the novelty of having a Ditto with yawn.
It's been reported that this technique can be used on other Pokemon for Ditto to learn even more moves, but my attempt with cubone bore no results.