From f778940aaee4495398a68e839bb4d298769771d7 Mon Sep 17 00:00:00 2001 From: Florent Torregrosa Date: Sat, 8 Aug 2015 12:30:52 +0200 Subject: [PATCH] Debug bulk actions tests. --- tests/protected_node.bulk.test | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/protected_node.bulk.test b/tests/protected_node.bulk.test index 630ce06..c706134 100644 --- a/tests/protected_node.bulk.test +++ b/tests/protected_node.bulk.test @@ -86,6 +86,17 @@ class ProtectedNodeBulkPassword extends ProtectedNodeBaseTestCase { $password = $this->randomName(10); // Create a new page node. $node = $this->createByNodeProtectedNode($password); + + $stored_node_password = db_select('protected_nodes') + ->fields('protected_nodes', array('protected_node_passwd')) + ->condition('nid', $node->nid) + ->execute() + ->fetchField(); + + debug($password, 'original password'); + debug(hash('sha256', $password), 'hashed password'); + debug($stored_node_password, 'stored password before'); + // Reset passwords. $new_password = $this->randomName(15); $form = array( @@ -93,6 +104,16 @@ class ProtectedNodeBulkPassword extends ProtectedNodeBaseTestCase { 'protected_node_reset_passwords_password[pass2]' => $new_password, ); $this->drupalPost('admin/config/content/protected_node', $form, t('Reset all existing passwords')); + + $stored_node_password = db_select('protected_nodes') + ->fields('protected_nodes', array('protected_node_passwd')) + ->condition('nid', $node->nid) + ->execute() + ->fetchField(); + debug($new_password, 'new password'); + debug(hash('sha256', $new_password), 'hashed new password'); + debug($stored_node_password, 'stored password after'); + // Once the node created logout the user. $this->drupalLogout(); @@ -105,7 +126,6 @@ class ProtectedNodeBulkPassword extends ProtectedNodeBaseTestCase { $this->assertNoText($text, "User with right permission can't access a protected node with the node's password", $this->group); // An authenticated user can see the node with the new password. - $this->drupalLogin($this->normalAccessAllowedUser); $form = array('password' => $new_password); $this->drupalPost('node/' . $node->nid, $form, t('OK')); -- 2.1.4