8000 feature #1518 [make:registration] add `bool` type to User::isVerified · symfony/maker-bundle@e209117 · GitHub
[go: up one dir, main page]

Skip to content

Commit e209117

Browse files
authored
feature #1518 [make:registration] add bool type to User::isVerified
1 parent ee9ead4 commit e209117

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Maker/MakeRegistrationForm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
392392
$userManipulator->addProperty(
393393
name: 'isVerified',
394394
defaultValue: false,
395-
attributes: [$userManipulator->buildAttributeNode(Column::class, ['type' => 'boolean'], 'ORM')]
395+
attributes: [$userManipulator->buildAttributeNode(attributeClass: Column::class, options: [], attributePrefix: 'ORM')],
396+
propertyType: 'bool'
396397
);
397398
$userManipulator->addAccessorMethod('isVerified', 'isVerified', 'bool', false);
398399
$userManipulator->addSetter('isVerified', 'bool', false);

tests/Maker/MakeRegistrationFormTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ public function getTestDetails(): \Generator
192192
$this->assertFileExists($runner->getPath($file));
193193
}
194194

195+
$userContents = file_get_contents($runner->getPath('src/Entity/User.php'));
196+
197+
$this->assertStringContainsString('private bool $isVerified = false', $userContents);
198+
195199
$this->runRegistrationTest($runner, 'it_generates_registration_form_with_verification.php');
196200
}),
197201
];

0 commit comments

Comments
 (0)
0