Skip to content

Commit

Permalink
feature #1518 [make:registration] add bool type to User::isVerified
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow committed Apr 21, 2024
1 parent ee9ead4 commit e209117
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Maker/MakeRegistrationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
$userManipulator->addProperty(
name: 'isVerified',
defaultValue: false,
attributes: [$userManipulator->buildAttributeNode(Column::class, ['type' => 'boolean'], 'ORM')]
attributes: [$userManipulator->buildAttributeNode(attributeClass: Column::class, options: [], attributePrefix: 'ORM')],
propertyType: 'bool'
);
$userManipulator->addAccessorMethod('isVerified', 'isVerified', 'bool', false);
$userManipulator->addSetter('isVerified', 'bool', false);
Expand Down
4 changes: 4 additions & 0 deletions tests/Maker/MakeRegistrationFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ public function getTestDetails(): \Generator
$this->assertFileExists($runner->getPath($file));
}

$userContents = file_get_contents($runner->getPath('src/Entity/User.php'));

$this->assertStringContainsString('private bool $isVerified = false', $userContents);

$this->runRegistrationTest($runner, 'it_generates_registration_form_with_verification.php');
}),
];
Expand Down

0 comments on commit e209117

Please sign in to comment.