diff --git a/tests/question.test b/tests/question.test index 58535b9e1a91b8a00a34802f036f82303b9cdc8d..2b28f581814560f2819e271aede07cc4a5cb1e07 100644 --- a/tests/question.test +++ b/tests/question.test @@ -34,7 +34,7 @@ class QuestionTestCase extends DrupalWebTestCase { * Verify the functionality of the Question module. */ function testQuestionWorkflow() { - + // Check that unauthorised users cannot ask questions $this->drupalGet('question'); $this->assertResponse(403, t('Make sure unauthorised users cannot access question form.')); @@ -45,22 +45,24 @@ class QuestionTestCase extends DrupalWebTestCase { $this->drupalPost( 'question', array( - 'questioner' => 'Bobby Test', - 'question' => 'This is the test question asked by Bobby'), - t('Submit Question') - ); + 'questioner' => 'Bobby Test', + 'question' => 'This is the test question asked by Bobby' + ), + t('Submit Question') + ); // Ask another question $this->drupalPost( 'question', array( 'questioner' => 'Benny Test', - 'question' => 'This is another test question, this time asked by Benny'), - t('Submit Question') - ); + 'question' => 'This is another test question, this time asked by Benny' + ), + t('Submit Question') + ); // Check that there are two questions in the database $count = db_result(db_query('SELECT COUNT(*) FROM {question_queue}')); $this->assertEqual($count, 2, t("There are two questions in the database.")); - + // Check that an unauthorised user cannot access the question queue $this->drupalGet('admin/content/question'); $this->assertResponse(403, t('Make sure unauthorised users cannot access question queue.')); @@ -70,7 +72,7 @@ class QuestionTestCase extends DrupalWebTestCase { // Login as an admin user $this->drupalLogin($this->question_admin_user); - + // Check that the questions appear on the queue page $this->drupalGet('admin/content/question'); $this->assertText("Bobby Test", t("Text 'Bobby Test' found in the question queue")); @@ -100,7 +102,7 @@ class QuestionTestCase extends DrupalWebTestCase { // Check that the question has been removed from the queue $this->drupalGet('admin/content/question'); $this->assertNoText("Bobby Test", t("Text 'Bobby Test' does not appear in the question queue")); - + // Check that the row has been removed from the database $count = db_result(db_query('SELECT COUNT(*) FROM {question_queue}')); $this->assertEqual($count, 1, t("There is one question in the question queue.")); @@ -110,9 +112,9 @@ class QuestionTestCase extends DrupalWebTestCase { // Check that the question has been deleted $this->assertRaw(t('!type deleted.', array('!type' => 'Question')), t('Question deleted.')); - + // Check that the question queue is now empty $count = db_result(db_query('SELECT COUNT(*) FROM {question_queue}')); $this->assertEqual($count, 0, t("The question queue is empty.")); - } + } }