1 simpletest_example.test public SimpleTestExampleMockModuleTestCase::testSimpleTestExampleMockModule()

Test modifications made by our mock module.

We create a simpletest_example node and then see if our submodule operated on it.


modules/examples/simpletest_example/simpletest_example.test, line 200
An example of simpletest tests to accompany the tutorial at http://DOCUMENTATION_PENDING/node/890654.


SimpleTestExampleMockModuleTestCase allows us to demonstrate how you can use a mock module to aid in functional testing in Backdrop.


public function testSimpleTestExampleMockModule() {
  // Create a user.
  $test_user = $this->backdropCreateUser(array('access content'));
  // Log them in.
  // Set up some content.
  $settings = array(
    'type' => 'simpletest_example',
    'title' => $this->randomName(32),
    'body' => array(LANGUAGE_NONE => array(array($this->randomName(64)))),
  // Create the content node.
  $node = $this->backdropCreateNode($settings);
  // View the node.
  // Check that our module did it's thing.
  $this->assertText(t('The test module did its thing.'), "Found evidence of test module.");