Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Testsuite failing on PHP 7.3/7.4 #644

Closed
@ckrack

Description

@ckrack

I'm having problems with the testsuite and it seems that it fails for the latest changes, too.
Actually there seems to be several problems.

I've encountered the "Aborted." errors in my tests for make:dto and was able to avoid them when using setArgumentsString().

This fails:

        yield 'dto_no_mutator' => [MakerTestDetails::createTest(
            $this->getMakerInstance(MakeDto::class),
            [
                'TaskData',
                'Task',
                // Mutable public (for simplicity)
                2,
                // Add no mutator to Entity
                'no',
            ])
            ->addExtraDependencies('doctrine')
            ->addExtraDependencies('validator')
            ->setFixtureFilesPath(__DIR__.'/../fixtures/MakeDtoNoMutator')
            ->assert(function (string $output) {
                $this->assertContains('created: src/Dto/TaskData.php', $output);
                $this->assertContains('updated: src/Dto/TaskData.php', $output);
            }),
        ];

while this succeeds:

        yield 'dto_no_mutator' => [MakerTestDetails::createTest(
            $this->getMakerInstance(MakeDto::class),
            [
-               'TaskData',
-               'Task',
                // Mutable public (for simplicity)
                2,
                // Add no mutator to Entity
                'no',
            ])
+           ->setArgumentsString('TaskData Task')
            ->addExtraDependencies('doctrine')
            ->addExtraDependencies('validator')
            ->setFixtureFilesPath(__DIR__.'/../fixtures/MakeDtoNoMutator')
            ->assert(function (string $output) {
                $this->assertContains('created: src/Dto/TaskData.php', $output);
                $this->assertContains('updated: src/Dto/TaskData.php', $output);
            }),
        ];

I think this is related to command arguments being added outside of configureCommand (#626), but could not completely track it down.
Maybe it's also related to #633 and #629

I'm having another bug in the test above, the 'no' input for the ChoiceQuestion always comes out as a boolean.
It's passed correctly in MakerTestEnvironment::runMaker().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions