|
Whitebeam Template Reference Documentation
|
System Template
test()
Determine whether the page is being run in a test instance.
Syntax
bool = rb.debug.test()
Parameters
The 'test' method takes no parameters
Results
The 'test' method returns bool:
Type/Value | Range/Length | Description |
bool |
  |
Returns 'true' if this page is being executed as part of a test instance, 'false' otherwise.
|
Remarks Generally speaking the a presentation page should not be aware of whether it
is running as part of a live site or as part of a test site. Conceptually it
is desirable to have the pages in the test instance as close as possible to those
that wil be moved to the live instance. Any differences between the pages
increases the risks of a bug in the live site. That said, there are occassions when it can be useful to know whether
the page is running in a test instance. One example is where a client has two
closely coupled sites and there are hot-links between the sites. In this case
it can be desirable to have the test instance of one site reference the test instance
of the other. To make this possible differernt URLs must be specified depending on the
site being executed. This method returns the 'true' if the page is currently running in a test instance of the site. Use this facility with care. If your pages are unaware they are running on the test instance
there is more likelyhood that its behaviour on the live site will be identical to that on the
test site - and therefore that your testing on the test site is more likely
to find problems before the site is made live! By adding in knowledge ofthe executing instance you are increasing the risk that your
site will run fine on the test instance and break on the lice site. |
|
(loadtime : 73ms) |