TAC is a complex module that offer configuration possibilities. A simpletest test suite would help prevent and resolve "edge-case" bugs.

CommentFileSizeAuthor
#5 tac_test_d7.txt5.06 KBxjm
#1 tac_test.txt4.99 KBxjm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

FileSize
4.99 KB

This script I wrote (designed to be used with drush) sets up a testing environment for TAC. It doesn't use simpletest; it configures the existing drupal site. (Don't use it on anything but a 100% disposable test site. Really. It will delete all your data.) However, it could be used as a starting point for creating a simpletest environment.

  • The library does not use API functions for now (a deliberate choice).
  • It currently only includes one operation, the setup of the test environment.
  • It's only designed to test node access grants for now (and not create/list).
  • It creates:
    • Three roles.
    • Four vocabularies.
    • Twenty terms in each vocabulary.
  • It configures TAC for each role, term, and vocabulary:
    • Each role receives a different configuration for the global default (one allow, one ignore, and one deny).
    • All three roles receive the same configuration for the four vocabularies and eighty terms.
    • Each term and vocabulary default has a unique configuration. This is to allow every possible combination of term grants (again, for V/U/D only).
xjm’s picture

Er... the original post should say "that offers many configuration possibilities" or something.

xjm’s picture

Version: master » 7.x-1.x-dev
Status: Postponed » Active

This should be included before a 7.x-1.0 release, because the module has about 30 different query patterns that could all introduce bugs when ported to the new DB API.

xjm’s picture

Issue tags: +d7 release

Adding tag.

xjm’s picture

FileSize
5.06 KB

D7 version of the same script that I'm using at the moment.

xjm’s picture

Status: Active » Needs work

The basic test environment setup has been committed, including creating our three role types and four vocabularies. It does not yet configure TAC itself, nor actually test anything, but it's ready for tests to be added.
http://drupalcode.org/project/taxonomy_access.git/commit/6a78496

xjm’s picture

Adding the grant configuration to tests depends on #1213792: Refactor and improve grant update API -- at a minimum, the functions need to be moved from the admin file into the module.

xjm’s picture

Retagging according to standard.

xjm’s picture

Status: Needs work » Fixed

A number of tests have been added in http://drupal.org/commitlog/commit/364/46eca0ca67b6e785c92f10c6f0058d365.... Marking fixed. I'll open separate issues for additional tests (or just write them). :)

Status: Fixed » Closed (fixed)
Issue tags: -D7 stable release blocker

Automatically closed -- issue fixed for 2 weeks with no activity.