# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: contributions/docs/developer/examples/node_example.test
--- contributions/docs/developer/examples/node_example.test No Base Revision
+++ contributions/docs/developer/examples/node_example.test Locally New
@@ -0,0 +1,79 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Test case for Testing the example module.
+ *
+ * This file contains the test cases to check if module is performing as
+ * expected.
+ *
+ */
+class NodeExampleTestCase extends DrupalWebTestCase {
+  protected $web_user;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Node example functionality',
+      'description' => 'Create, view, edit, delete, and change example entries and verify its consistency in the database.',
+      'group' => 'Node Example',
+    );
+  }
+
+  /**
+   * Enable modules and create user with specific permissions.
+   */
+  function setUp() {
+    parent::setUp('node_example');
+    // Create user.
+    $this->web_user = $this->drupalCreateUser(array('create node_example content', 'edit own node_example content'));
+  }
+
+  /**
+   * Login user, create an example node, and test blog functionality through the admin and user interfaces.
+   */
+  function testNodeExampleBasic() {
+    // Login the admin user.
+    $this->drupalLogin($this->web_user);
+
+    // Create an example node
+    $langcode = FIELD_LANGUAGE_NONE;
+    $edit = array(
+      "title[$langcode][0][value]" => $this->randomName(),
+      'quantity' => 10,
+      'color' => $this->randomName(),
+    );
+    $this->drupalPost('node/add/node-example', $edit, t('Save'));
+    $this->assertResponse(200);
+
+    // Check if example attributes are present when viewing the node
+    $raw = t('The order is for %quantity %color items.', array('%quantity' => check_plain($edit['quantity']), '%color' => check_plain($edit['color'])));
+    $this->assertRaw($raw, t('Color and quantity successfully verified.'));
+
+    // Go to edit the example node
+    $this->clickLink(t('Edit'));
+    $this->assertResponse(200);
+    $this->assertFieldByName('color', $edit['color'], t('Color value verified successfully.'));
+    $this->assertFieldByName('quantity', $edit['quantity'], t('quantity value verified successfully.'));
+
+    // Save current link location as the node/x/edit URL
+    $edit_url = $this->getUrl();
+
+    // Check that quantity is validated for integer values
+    $edit['quantity'] = 'string';
+    $result = $this->drupalPost($edit_url, $edit, t('Save'));
+    $this->assertRaw(t('The quantity must be a number.'));
+    // Check that node was not saved
+    $raw = t('The order is for %quantity %color items.', array('%quantity' => check_plain($edit['quantity']), '%color' => check_plain($edit['color'])));
+    $this->assertNoRaw($raw, t('Color and quantity successfully verified. Node was not saved.'));
+
+    // Save the node again with different values
+    $edit['color'] = $this->randomName();
+    $edit['quantity'] = 20;
+    $this->drupalPost($edit_url, $edit, t('Save'));
+    $this->assertResponse(200);
+    // Check if example attributes are present when viewing the node
+    $raw = t('The order is for %quantity %color items.', array('%quantity' => check_plain($edit['quantity']), '%color' => check_plain($edit['color'])));
+    $this->assertRaw($raw, t('Color and quantity successfully verified.'));
+  }
+}
