Needs review
Project:
Conditional text
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
5 Aug 2011 at 14:49 UTC
Updated:
20 Aug 2011 at 13:31 UTC
This module probably needs more tests. Not sure exactly what yet, but we can track it here on this issue.
Here is some sample node body text I have been using to test whether the filters are working, by the way. I have a filter set up with:
custom: "Level" = "Beginner", "Intermediate", "Advanced" (with lower-case machine names)
module: bogus-7.x-3.3
And I use this text to test whether everything is working (of course, it isn't checking all the operators, but at least it checks basic functionality) -- could be used as a starting point for tests, if you don't already have one:
This is a test page.
[condition installed views > 7.x-3.0]
<p>This part should only display if views is installed, which it isn't.</p>
[/condition]
[condition installed bogus > 7.x-3.0]
<p>This part should only display if the bogus module is said to be installed and after 7.x-3.0, which it is.</p>
[/condition]
[condition installed bogus]
<p>This part should only display if the bogus module is said to be installed, which it is.</p>
[/condition]
[condition installed notdefined]
<p>This part should only display if the notdefined module is said to be installed, which it is not.</p>
[/condition]
[condition installed block]
<p>This part should display if Block is enabled, which it is.</p>
[/condition]
[condition installed block >= 7.0]
<p>This part should display if Block is enabled and >= 7.0, which it is</p>
[/condition]
[condition installed block == 7.2]
<p>This part should display if Block is enabled and version 7.2 exactly.</p>
[/condition]
[condition custom level beginner]
<p>This is beginner-level text</p>
[/condition]
[condition custom level intermediate]
<p>This is intermediate-level text</p>
[/condition]
[condition custom level advanced]
<p>This is advanced-level text</p>
[/condition]
Comments
Comment #1
tamasd commentedPushed some tests in: ad7bd029b4f3982928ee53ced343aa94e59d8d21
Comment #2
jhodgdonThose tests look like a good start.
What I don't see in the test file is anything to test the functionality of the user interface. I would like to see:
1) Basic functionality
a) Create a conditional text format from the Text Formats page.
b) Create a node and give it this text format.
c) Verify that it produces the correct output (using both fieldsets and full filtering).
2) Ability to delete and add modules, custom groups, and custom values from the text formats page, and verify that the text is still filtered correctly.
Comment #3
tamasd commentedComment #4
tamasd commented1.) pushed: c8001224e4391b13a216c68fdd8f2576edfbb158
2.) working on
Comment #5
tamasd commented2.) 54c004630ecbfac5a88a6504745248ff98bc7bb6