mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
c6a8ad67fa
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65028 467b73ca-7a2a-4603-9d3b-597d59a354a9
41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
|
|
class SecurityAdminTest extends FunctionalTest {
|
|
static $fixture_file = 'cms/tests/CMSMainTest.yml';
|
|
|
|
function testGroupExport() {
|
|
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
|
|
|
|
/* First, open the applicable group */
|
|
$this->get('admin/security/getitem?ID=' . $this->idFromFixture('Group','admin'));
|
|
$this->assertRegExp('/<input[^>]+id="Form_EditForm_Title"[^>]+value="Administrators"[^>]*>/',$this->content());
|
|
|
|
/* Then load the export page */
|
|
$this->get('admin/security//EditForm/field/Members/export');
|
|
|
|
$this->assertRegExp(
|
|
'/"' . _t('MemberTableField.FIRSTNAME') . '","' . _t('MemberTableField.SURNAME') . '","' . _t('MemberTableField.EMAIL') . '"/',
|
|
$this->content()
|
|
);
|
|
$this->assertRegExp('/"","","admin@example.com"/', $this->content());
|
|
}
|
|
|
|
function testEmptyGroupExport() {
|
|
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
|
|
|
|
/* First, open the applicable group */
|
|
$this->get('admin/security/getitem?ID=' . $this->idFromFixture('Group','empty'));
|
|
$this->assertRegExp('/<input[^>]+id="Form_EditForm_Title"[^>]+value="Empty Group"[^>]*>/',$this->content());
|
|
|
|
/* Then load the export page */
|
|
$this->get('admin/security//EditForm/field/Members/export');
|
|
|
|
$this->assertRegExp(
|
|
'/"' . _t('MemberTableField.FIRSTNAME') . '","' . _t('MemberTableField.SURNAME') . '","' . _t('MemberTableField.EMAIL') . '"/',
|
|
$this->content()
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
?>
|