summaryrefslogtreecommitdiff
path: root/modules/syslog/syslog.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-04-20 18:24:07 +0000
committerDries Buytaert <dries@buytaert.net>2008-04-20 18:24:07 +0000
commitaf474609e3e80db9ba1d16b9ad2eae89775f51c8 (patch)
treee525479dd6381b94d21943c3d2decf1c749c028c /modules/syslog/syslog.test
parentfe7b9baff62379f5a0c901d27cbb677345791bd0 (diff)
downloadbrdo-af474609e3e80db9ba1d16b9ad2eae89775f51c8.tar.gz
brdo-af474609e3e80db9ba1d16b9ad2eae89775f51c8.tar.bz2
- Added a test framework to Drupal along with a first batch of tests for
Drupal core! This is an important milestone for the project so enable the module and check it out ... :) Thanks to Rok Žlender, Károly Négyesi, Jimmy Berry, Kevin Bridges, Charlie Gordon, Douglas Hubler, Miglius Alaburda, Andy Kirkham, Dimitri13, Kieran Lal, Moshe Weitzman, and the many other people that helped with testing over the past years and that drove this home. It all works but it is still rough around the edges (i.e. documentation is still being written, the coding style is not 100% yet, a number of tests still fail) but we spent the entire weekend working on it in Paris and made a ton of progress. The best way to help and to get up to speed, is to start writing and contributing some tests ... as well as fixing some of the failures. For those willing to help with improving the test framework, here are some next steps and issues to resolve: - How to best approach unit tests and mock functions? - How to test drupal_mail() and drupal_http_request()? - How to improve the admin UI so we have a nice progress bar? - How best to do code coverage? - See http://g.d.o/node/10099 for more ...
Diffstat (limited to 'modules/syslog/syslog.test')
-rw-r--r--modules/syslog/syslog.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/modules/syslog/syslog.test b/modules/syslog/syslog.test
new file mode 100644
index 000000000..1fec48c93
--- /dev/null
+++ b/modules/syslog/syslog.test
@@ -0,0 +1,41 @@
+<?php
+// $Id$
+
+class SyslogTestCase extends DrupalWebTestCase {
+ /**
+ * Implementation of getInfo().
+ */
+ function getInfo() {
+ return array(
+ 'name' => t('Syslog functionality'),
+ 'description' => t('Test syslog settings.'),
+ 'group' => t('Syslog')
+ );
+ }
+
+ /**
+ * Implementation of setUp().
+ */
+ function setUp() {
+ parent::setUp('syslog');
+ }
+
+ /**
+ * Test the syslog settings page.
+ */
+ function testSettings() {
+ $admin_user = $this->drupalCreateUser(array('administer site configuration'));
+ $this->drupalLogin($admin_user);
+
+ $edit = array();
+ $edit['syslog_facility'] = 176; // LOG_LOCAL6 - Local 6.
+ $this->drupalPost('admin/settings/logging/syslog', $edit, t('Save configuration'));
+ $this->assertText(t('The configuration options have been saved.'));
+
+ $this->drupalGet('admin/settings/logging/syslog');
+ if ($this->parse()) {
+ $field = $this->elements->xpath('//option[@value="'. $edit['syslog_facility'] .'"]'); // Should be one field.
+ $this->assertTrue($field[0]['selected'] == 'selected', t('Facility value saved.'));
+ }
+ }
+}