2008-10-03 04:26:23 +02:00
|
|
|
<?php
|
2009-03-22 23:58:18 +01:00
|
|
|
/**
|
|
|
|
* @package cms
|
|
|
|
* @subpackage tests
|
|
|
|
*/
|
2008-10-03 04:26:23 +02:00
|
|
|
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');
|
|
|
|
|
2008-11-01 14:55:47 +01:00
|
|
|
$this->assertRegExp(
|
|
|
|
'/"' . _t('MemberTableField.FIRSTNAME') . '","' . _t('MemberTableField.SURNAME') . '","' . _t('MemberTableField.EMAIL') . '"/',
|
|
|
|
$this->content()
|
|
|
|
);
|
2008-10-03 04:26:23 +02:00
|
|
|
$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');
|
|
|
|
|
2008-11-01 14:55:47 +01:00
|
|
|
$this->assertRegExp(
|
|
|
|
'/"' . _t('MemberTableField.FIRSTNAME') . '","' . _t('MemberTableField.SURNAME') . '","' . _t('MemberTableField.EMAIL') . '"/',
|
|
|
|
$this->content()
|
|
|
|
);
|
2008-10-03 04:26:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|