mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Compare commits
1 Commits
06cd3eecd9
...
dc84a231b9
Author | SHA1 | Date | |
---|---|---|---|
|
dc84a231b9 |
6
_config.php
Normal file
6
_config.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use SilverStripe\Admin\CMSMenu;
|
||||||
|
use SilverStripe\UserForms\Control\UserDefinedFormAdmin;
|
||||||
|
|
||||||
|
CMSMenu::remove_menu_class(UserDefinedFormAdmin::class);
|
@ -47,8 +47,6 @@ class UserDefinedFormAdmin extends LeftAndMain
|
|||||||
|
|
||||||
private static $url_segment = 'user-forms';
|
private static $url_segment = 'user-forms';
|
||||||
|
|
||||||
private static $ignore_menuitem = true;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The name of the folder where form submissions will be placed by default
|
* @var string The name of the folder where form submissions will be placed by default
|
||||||
*/
|
*/
|
||||||
|
@ -584,41 +584,16 @@ class UserDefinedFormControllerTest extends FunctionalTest
|
|||||||
public static function provideValidEmailsToArray()
|
public static function provideValidEmailsToArray()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
[[], [null]],
|
||||||
|
[[], [' , , ']],
|
||||||
|
[[], ['broken.email, broken@.email, broken2.@email']],
|
||||||
[
|
[
|
||||||
'input' => [
|
['broken@email', 'correctemail@email.com'],
|
||||||
null
|
[', broken@email, email@-email.com,correctemail@email.com,']
|
||||||
],
|
|
||||||
'expected' => [],
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'input' => [
|
['correctemail1@email.com', 'correctemail2@email.com', 'correctemail3@email.com'],
|
||||||
' , , '
|
['correctemail1@email.com, correctemail2@email.com, correctemail3@email.com']
|
||||||
],
|
|
||||||
'expected' => [],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'input' => [
|
|
||||||
'broken.email, broken@.email, broken2.@email'
|
|
||||||
],
|
|
||||||
'expected' => [],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'input' => [
|
|
||||||
', broken@email, email@-email.com,correctemail@email.com,'
|
|
||||||
],
|
|
||||||
'expected' => [
|
|
||||||
'correctemail@email.com'
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'input' => [
|
|
||||||
'correctemail1@email.com, correctemail2@email.com, correctemail3@email.com'
|
|
||||||
],
|
|
||||||
'expected' => [
|
|
||||||
'correctemail1@email.com',
|
|
||||||
'correctemail2@email.com',
|
|
||||||
'correctemail3@email.com'
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -627,7 +602,7 @@ class UserDefinedFormControllerTest extends FunctionalTest
|
|||||||
* Test that provided email is valid
|
* Test that provided email is valid
|
||||||
*/
|
*/
|
||||||
#[DataProvider('provideValidEmailsToArray')]
|
#[DataProvider('provideValidEmailsToArray')]
|
||||||
public function testValidEmailsToArray(array $input, array $expected)
|
public function testValidEmailsToArray(array $expectedOutput, array $input)
|
||||||
{
|
{
|
||||||
$class = new ReflectionClass(UserDefinedFormController::class);
|
$class = new ReflectionClass(UserDefinedFormController::class);
|
||||||
$method = $class->getMethod('validEmailsToArray');
|
$method = $class->getMethod('validEmailsToArray');
|
||||||
@ -635,6 +610,6 @@ class UserDefinedFormControllerTest extends FunctionalTest
|
|||||||
|
|
||||||
$controller = new UserDefinedFormController();
|
$controller = new UserDefinedFormController();
|
||||||
|
|
||||||
$this->assertEquals($expected, $method->invokeArgs($controller, $input));
|
$this->assertEquals($expectedOutput, $method->invokeArgs($controller, $input));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user