public function testSetBodyFromStringWithInvalidArgumentThrowsException() { $php = '<?php function foo() {}'; $reflector = new FunctionReflector(new StringSourceLocator($php)); $function = $reflector->reflect('foo'); $this->expectException(\InvalidArgumentException::class); $function->setBodyFromString(['foo' => 'bar']); }