diff --git a/src/Form/UserCreateType.php b/src/Form/UserCreateType.php index 4cd1f23f..425cf1a2 100644 --- a/src/Form/UserCreateType.php +++ b/src/Form/UserCreateType.php @@ -56,7 +56,7 @@ class UserCreateType extends UserEditType parent::configureOptions($resolver); $resolver->setDefaults([ - 'validation_groups' => ['UserCreate'], + 'validation_groups' => ['UserCreate', 'Registration'], 'include_add_more' => false, ]); } diff --git a/tests/Controller/UserControllerTest.php b/tests/Controller/UserControllerTest.php index e9af6c66..904bdc7b 100644 --- a/tests/Controller/UserControllerTest.php +++ b/tests/Controller/UserControllerTest.php @@ -239,9 +239,11 @@ class UserControllerTest extends ControllerBaseTest ] ], [ + '#user_create_username', '#user_create_username', '#user_create_plainPassword_first', '#user_create_email', + '#user_create_email', ] ], // invalid fields: username, password, email, enabled @@ -257,9 +259,11 @@ class UserControllerTest extends ControllerBaseTest ] ], [ + '#user_create_username', '#user_create_username', '#user_create_plainPassword_first', '#user_create_email', + '#user_create_email', ] ], // invalid fields: password (too short) diff --git a/tests/Timesheet/DateTimeFactoryTest.php b/tests/Timesheet/DateTimeFactoryTest.php index 1cc97540..ed7aad22 100644 --- a/tests/Timesheet/DateTimeFactoryTest.php +++ b/tests/Timesheet/DateTimeFactoryTest.php @@ -113,11 +113,10 @@ class DateTimeFactoryTest extends TestCase $this->assertEquals(29, $dateTime->format('d')); $this->assertEquals(7, $dateTime->format('N')); $this->assertEquals('Sunday', $dateTime->format('l')); - $this->assertEquals($expected->format('m'), $dateTime->format('m')); - $this->assertEquals($expected->format('Y'), $dateTime->format('Y')); + $this->assertEquals('07', $dateTime->format('m')); + $this->assertEquals('2018', $dateTime->format('Y')); $this->assertEquals(self::TEST_TIMEZONE, $dateTime->getTimezone()->getName()); - $expected = new DateTime('now', new DateTimeZone(self::TEST_TIMEZONE)); $dateTime = $sut->getEndOfWeek(); $this->assertEquals(23, $dateTime->format('H')); @@ -125,8 +124,7 @@ class DateTimeFactoryTest extends TestCase $this->assertEquals(59, $dateTime->format('s')); $this->assertEquals(7, $dateTime->format('N')); $this->assertEquals('Sunday', $dateTime->format('l')); - $this->assertEquals($expected->format('m'), $dateTime->format('m')); - $this->assertEquals($expected->format('Y'), $dateTime->format('Y')); + // month and year can be different when the week started at the end of the month $this->assertEquals(self::TEST_TIMEZONE, $dateTime->getTimezone()->getName()); }