public function testAddMethod()
{
$php = '<?php
class Foo {
}
';
$reflection = (new ClassReflector(new StringSourceLocator($php)))->reflect('Foo');
$this->assertFalse($reflection->hasMethod('bar'));
$reflection->addMethod('bar');
$this->assertTrue($reflection->hasMethod('bar'));
}