SimpleTest is Drupal's custom testing framework.

learn more… | top users | synonyms

0
votes
1answer
10 views

module_load_include fails on WebTestCase post

I am writing test cases for my website using SimpleTest module. One of my test cases uses the following sequence $this->drupalGet( "myurl" array('query' => $params)); ...
1
vote
1answer
10 views

How do I run Drupal SimpleTest example from Examples for Developers from the CLI?

I've been running tests from a helper_module_preprocess_html function that I trigger on reload. I think I need to level up with testing. I have a vanilla installation of Drupal, downloaded and enabled ...
0
votes
0answers
14 views

Different page appear when testing

What I want to do is checking whether a link is exist on frontpage. I've set up a content with with node id 5 as my frontpage. But when testing it, and see the verbose message ...
0
votes
0answers
30 views

Can you execute Simpletest on a specific folder (i.e. a folder of custom modules)?

Is there a way to execute Simpletest on a specific folder (i.e. a folder of custom modules)? or are you forced to either execute all of them or specify all of the "groups"? I noticed that in there ...
0
votes
1answer
37 views

How do I debug a the output errors on SimpleTest when I'm not sure where in the script the error occurred?

I'm trying to build a simple test. I'm having trouble submitting webforms. With help form a previous question I've cobbled together these functions within the larger class. They completely work in ...
0
votes
1answer
35 views

Asserting a failed login attempt on Simpletest

I want to test a module that adds an additional login validation clause. Only users whitelisted somewhere else are allowed to log in to the system. In order to test this behaviour with Simpletest, I ...
1
vote
3answers
282 views

Creating webform submissions programatically in order to use with SimpleTest

I'm trying to build out a SimpleTest to test out functionality on submitted webforms. I need to simulate loading a drupal webform node, applying fake data, and submitting the form (triggering a ...
0
votes
1answer
45 views

Simpletest fatal error without message

locally my unit tests run just fine. On my online dev server, they fail and I don't get any error message despite "The test did not complete due to a fatal error." in the test messages and "An ...
0
votes
0answers
63 views

SimpleTest resulting in AJAX error

I wrote a simpletest for one of my module. The module allows users to create customers and add them to a list. If it is tested manually the user navigates to the "create list" page and they would see ...
0
votes
0answers
27 views

How to create a field in tests in Drupal 8

I am writing a test in drupal 8, in this test(simpletest) i create a content type(using drupalCreateContentType). I need in this content type create some fields. Now i need a taxonomy field, but will ...
0
votes
0answers
35 views

Simpletest: working with sessions and custom function

I need to add a simpletest case to my custom module. Module functionality: The module has a function to store data on $_SESSION, on the next page load if $_SESSION has a custom value a javascript ...
1
vote
2answers
68 views

Writing functional tests for a controller that makes call to external service?

I'm working on the D8 version of the CAS module. To integrate with a single sign on CAS server, this module will have to redirect the user to the CAS server often, and occasionally make cURL requests ...
1
vote
0answers
18 views

Views not working with Simpletest

I have just started using the Simpletest module for Drupal 7. I am trying to use the drupalGet function to pull a URL. The URL is a views module URL. I am able to pull other pages using the ...
1
vote
0answers
24 views

How to non-destructively test file-detection functionality

I am writing tests for a module that is dependant on an external library, located in: sites/all/libraries/mylib I have written a hook_requirements to check for the presence of this library and ...
0
votes
0answers
19 views

I've a problem trying to create users with roles

I'm using simpletest_clone to do my tests. what i want now is just to create an user for every existing role i've created (I dont need just the list of permissions, i need the user to have the exact ...
0
votes
2answers
653 views

Getting image SRC with xpath - Simpletest (WebTestBase) [closed]

I am developing a Drupal 8 test which will check for a image's existence. The image will not be loaded while running the test and I want to catch that using xpath(). The HTML I am trying to search ...
2
votes
1answer
76 views

Ways to speed up a simpletest?

I'm trying to speed up my test. I have to use simpletest_clone. I've read something like "copy the database to memory" but i did some research and didn't found how. Aaand if i want to do more than ...
1
vote
2answers
49 views

Is there a way to load the content types using DrupalWebTestCase?

I'm trying to learn how to do testing in Drupal. I'm pretty new with it so maybe i didn't got it right. well, I'm trying to test some views of content types, but to test those views i need to have ...
2
votes
1answer
104 views

Check for double escaped string - Simpletest

I am trying to create a test case against a patch which will be used for automated testing in D8 release. However, I am trying to do it to check if the page I am on it, has any multiple escaped HTML ...
2
votes
1answer
51 views

What's the best practice way to test block Views with SImpleTest?

I've created a block view, which I've positioned on the page using the admin UI. I've exported my view using Features and fe_block for its block. I'd like to write a SimpleTest to verify that ...
0
votes
1answer
108 views

Always expanded menu items not showing up expanded in custom menu

I have a custom menu profile-menu and have configured a block to display that menu. It has four menu items with 'expanded' => TRUE. However, during test runs these expanded menu items do not show ...
0
votes
1answer
82 views

Simpletest: database exception during setUp

I'm writing lots and lots of test cases for different modules and have come across a rather strange error about which I'm hoping others may have more insight. In my setUp function override, the first ...
0
votes
1answer
43 views

Custom simpltest does not run successfully

I have written an automated test to create a node of a specific content type. Here is the code: class GlueTestingBuySystemTestCase extends DrupalWebTestCase { protected $privileged_user; ...
0
votes
1answer
176 views

Test doesn't show up [closed]

I have created a test orb.test for my module and placed it within the module directory. Installed the Simple Test module. When I visit the /admin/config/development/testing my test orb.test its not ...
2
votes
2answers
90 views

How do I post a node that has its created field set to the past in a test class?

I am creating a test class using the framework of the core Testing module for a module that is supposed to autoexpire nodes some time after they've been created. Nodes have two timestamp fields: ...
-1
votes
1answer
29 views

Why are no tests shown on testing overview? [closed]

I want to run DrupalWebTestCases on my custom Drupal 7 module. Following the Tutorial at https://drupal.org/simpletest-tutorial-drupal7 i'm stuck at running the tests: also after cache deletion no ...
0
votes
1answer
121 views

How do I speed up `drush test-run` (compared to the SimpleTest UI)?

I have a number of Feature modules for which I've written tests to assure they work as expected. For performance reasons, I've overridden the parent's setUp() method in each test case so that it ...
2
votes
0answers
66 views

Running simpletest tests with clean urls on nginx

Having Drupal 7 on nginx with enabled clean urls. nginx config: location @drupal { rewrite ^/(.*)$ /index.php?q=$1 last; } When trying to run tests getting message: You are not authorized to ...
2
votes
1answer
122 views

Which test cases/tests should I run?

I'm a bit confused about best practices for testing in Drupal 7. When I'm going to deploy, should I run the entire test suite—including all Drupal core tests—every time? This seems like a bit of ...
0
votes
1answer
57 views

Core Testing vs SimpleTest

I have a query concerning the core Testing module and the SimpleTest module. When I install a new site, the Testing module is available but disabled. When enabled, a list of tests are available for a ...
1
vote
1answer
207 views

How do I enable a features module in the setup of a simpletest testcase

I'm trying to test some permissions that are related to custom node types and Organic Groups that I've built and packaged as a feature using the features module. I'm trying to enable the feature (and ...
3
votes
2answers
1k views

Simpletest on select field loaded by ajax

I have searched through Google and haven't found an answer. Stack Exchange is my last resort. In my form, I have two select fields: $form['system']['foo'] = array( ... '#type' => 'select', ...
1
vote
0answers
57 views

Simpletest and examples module

I've enabled SimpleTest module and simpletest_example module in the Examples module I've cleared all caches and i do not see anything about simpletest_example in this page : ...
1
vote
1answer
24 views

How do I block a user/cancel a user account in Simpletest?

I'm trying to write some tests for a module for situations in which a user is blocked. I know I can use drupalCreateUser() to make new users, but how do I block a user I have created in Simpletest?
3
votes
1answer
35 views

Why are comments enabled on my content types in Simpletests?

When I run Simpletest, it's showing comment forms at the bottom of all the nodes, even though I don't even have the comment module enabled, nor permissions assigned for it. These comment forms showing ...
2
votes
0answers
79 views

How to test AJAX Callback with simpletest on Drupal 6

I know there is drupalPostAJAX() available on Drupal 7 to do this, but I want to use it on Drupal 6. So I found on this link : http://tiger-fish.com/blog/drupal-6-posting-ajax-callbacks-simpletest a ...
1
vote
1answer
106 views

How to SAVE a webform in Simpletest?

I am able to save a sample webform in Simpletest if I only use title and body: $edit = array(); $edit['title'] = 'Sample webform'; $edit["body[$langcode][0][value]"] = $this->randomName(); ...
1
vote
1answer
94 views

EFQ propertyCondition Doesn't work in Simpletest

This Entity Field Query works as expected outside of simpletest: $query->entityCondition('entity_type', 'node') ->fieldCondition('field_exhibition_window_start', 'value', $date, '<=') ...
1
vote
0answers
27 views

How to reuse custom methods in a simpletest class?

I have created several test methods that I find useful in a lot of other situations. All I need is to define an include file of higher visibility which contains an utility class which is autoloaded ...
0
votes
1answer
312 views

How do I run unit tests against datasets? (DrupalWebTestCase and DrupalTestCase)

I am testing a module that I am writing against the Unit Testing framework that comes with Drupal 7. All makes sense, and everything asserts as it should. My question though, is it possible to run ...
1
vote
2answers
105 views

What is the most robust way to assert for a validation error?

I want to test the validation function in my custom module, and so I've written a simpletest that inputs an illegal value in a field and then attempts to save the node. Currently I'm using ...
1
vote
0answers
58 views

Press 'continue' button in simpletest

I am trying to enable modules via POSTing to /admin/modules in a simpletest. It works fine, except that there are dependencies (the whole reason I want to do it this way) and when it requires then ...
2
votes
3answers
432 views

Simpletest fails to create the field_config table

I'm only just getting into TDD with Drupal and unfortunately run into trouble right away. For some reason the simpletest####field_config table isn't being created, and I don't get why; many other ...
3
votes
1answer
431 views

Why do PAreview/codesniffer gripe about missing “scope modifier”?

I am writing a simpletest file for my Drupal module. It works OK, but when I use PAreview (automatic tool based upon PHP codesniffer to check correctness of Drupal code), I get the following error ...
0
votes
2answers
468 views

Impossible to enable modules in SimpleTest

I am building SimpleTests for my modules: It seems like the standard procedure for enabling modules it doesn't work for me: function setUp() { parent::setUp('mymodule'); } I constantly get a ...
6
votes
1answer
342 views

webTestCase->drupalPost() or drupal_http_request()?

I'm writing a simpletest for a module that posts XML directly to a URL (it's on a closed system so there's no user or auth or anything at this point). I've manually tested getting the response code ...
1
vote
1answer
163 views

drupal 7 entity and simple test

What I can't workout is what steps I need to see if the entity is loaded using simple test. Any direction will be greatly appreciated thanks. /** * @file * Definition of creation of a entity. */ ...
0
votes
1answer
39 views

testing a function

I have setup a file called mymodule.test and in the module I have file called mymodule.inc. Every is working but I am unsure about the following. Below is mymodule.test file. class MyModule extends ...
0
votes
2answers
298 views

Drupal registry table not populated with test class files

I tried to write tests for custom modules and I found that registry database table is not populated with .test files and thus admin/config/development/testing displays only one SimpleTest test. I ...
0
votes
1answer
151 views

Why is my alias “NULL” in a test?

I am using Drupal 7, I have Pathauto enabled, and my user has permissions to create new aliases. When I manually create a node, uncheck the checkbox for automatic alias generation, and enter a custom ...