Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Changed getParent to BaseEntityAutocompleteType instead of depre… #1650

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

alessandro-podo
Copy link

Q A
Bug fix? no
New feature? no
Issues
License MIT

if you create a new class with the make:autocomplete command, it still use the deprecated class "ParentEntityAutocompleteType" for getParent() return.
It was deprecated in 9335587

This pull request changes it to the new class "BaseEntityAutocompleteType" in the template

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Mar 24, 2024
@smnandre
Copy link
Collaborator

Could you add a minimal test ? Or is it too complex ?

(i remember i started this exact PR and wonder if i did stop for this exact reason 😶‍🌫️ )

@alessandro-podo
Copy link
Author

I'm not sure what exactly you want a test for? @smnandre
So far I can't find a test for the Commando.

I can't find any tests for the make commandos in the whole repo.
If the whole commando is to be tested, wouldn't a new pull request be better?

@smnandre
Copy link
Collaborator

It's not because something was not tested that it can never be, fortunately!

But i can understand how it feels when you see no other test .. :)

@smnandre
Copy link
Collaborator

You need to change the content of the template, as the options exposed are not the same in the new class.

@alessandro-podo
Copy link
Author

That's true. I try to create a test, but i have a problem the with the interactive Question.
I tried to create the test like here described.

But i get the error Symfony\Component\Console\Exception\MissingInputException: Aborted.

        self::bootKernel();
        $application = new Application(self::$kernel);
        $command = $application->find('make:autocomplete-field');

        self::assertSame('Generates an Ajax-autocomplete form field class for symfony/ux-autocomplete.', $command->getDescription());

        $commandTester = new CommandTester($command);
        $commandTester->setInputs(['Category', 'CategoryAutocompleteField']);

        $commandTester->execute([],['interactive'=>true]);

Sorry, but I am not sure how to solve this. :(

@smnandre
Copy link
Collaborator

Nevermind the test, but if you could update the generated code to follow the new usage of the class (you may look at the doc for reference, or even the class source code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants