function it_inserts_the_generated_method(CodeEditor $codeEditor, File $file, FileModel $fileModel, FullyQualifiedNameModel $fullyQualifiedNameModel, MethodModel $methodModel, ObjectModel $objectModel)
 {
     $insertUseStatements = Argument::type(InsertUseStatements::class);
     $insertMethod = Argument::type(InsertMethod::class);
     $generatedMethod = new GeneratedMethod($fileModel->getWrappedObject());
     $fileModel->allFullyQualifiedNames()->willReturn([$fullyQualifiedNameModel]);
     $fileModel->getFilename()->willReturn(self::FILE_NAME);
     $fileModel->getStructure()->willReturn($objectModel);
     $objectModel->allMethods()->willReturn([$methodModel]);
     $codeEditor->open(self::FILE_NAME)->willReturn($file);
     $codeEditor->handle($insertUseStatements)->shouldBeCalled();
     $codeEditor->handle($insertMethod)->shouldBeCalled();
     $codeEditor->save($file)->shouldBeCalled();
     $this->onGeneratedMethod($generatedMethod);
 }
 function it_needs_line_after_fully_qualified_names_if_file_has_fully_qualified_names(File $file)
 {
     $file->allFullyQualifiedNames()->willReturn(array(1));
     $this->needsLineAfter($file, self::IMPORT_BLOCK)->shouldBe(true);
 }