Class stockmaniac_webtestcase

Description

WebTestCase interface for StockManiac

This class provides connectivity between the SimpleTest framework and StockManiac and overloads/extends the framework with StockManiac specifics.

Located in /lib/stockmaniac_webtestcase.class.php (line 42)

WebTestCase
   |
   --stockmaniac_webtestcase
Direct descendents
Class Description
 class webtest_coretests generic tests of infrastructure surrounding the plugins
 class webtest_asset userinterface tests for Asset plugin
 class webtest_chartdisplay userinterface tests for ChartDisplay plugin
 class webtest_positionnews userinterface tests for PositionNews plugin
 class webtest_portfolio userinterface tests for Portfolio plugin
 class webtest_portfoliomanager userinterface tests for ObjectManager plugin
 class webtest_comment userinterface tests for Comment plugin
 class webtest_positionmaintenance userinterface tests for PositionMaintenance plugin
 class webtest_figures userinterface tests for Figures plugin
 class webtest_usermanager userinterface tests for NewsReader plugin
 class webtest_settings userinterface tests for NewsReader plugin
 class webtest_order userinterface tests for Order plugin
 class webtest_positionrisk userinterface tests for PositionRisk plugin
 class webtest_objectmanager userinterface tests for ObjectManager plugin
 class webtest_quoterecords userinterface tests for QuoteRecords plugin
 class webtest_newsreader userinterface tests for NewsReader plugin
 class webtest_dividend userinterface tests for Dividend plugin
 class webtest_documents userinterface tests for Documents plugin
 class webtest_infodisplay userinterface tests for InfoDisplay plugin
 class webtest_charges userinterface tests for Charges plugin
Variable Summary
Method Summary
 void __construct ()
 string get_randomized_string (string $base)
 void init_dbc ()
 void setUP ()
 void set_auto_clicklink (string $content)
 void tearDown ()
Variables
object $dbc (line 93)

dbc instance to talk directly to the database during webtests

  • sometimes necessary, ie to get a specific id
  • it remains uninitialized by default to safe resources, call init_dbc() if you need this

string $_auto_clicklink = false (line 82)
string $_pass = 'kj87Ju' (line 60)

password to login with (used by all tests)

bool $_skip_autologin = false (line 68)
bool $_skip_backtomainpage = true (line 75)
string $_user = 'admin' (line 51)

username to login with (used by all tests)

  • access: protected
Methods
get_randomized_string (line 169)

appends a random number to string $base

  • access: public
string get_randomized_string (string $base)
  • string $base
init_dbc (line 116)

initialize $this->dbc object

void init_dbc ()
setUP (line 194)

overload SimpleTests' setUP() routine with code to automatically login to StockManiac.

SimpleTest will call this code before each test_* function is called making this code run many many times. The more webtests we have the more this is becomming a real stresstest.

We look for Call Stack reports as generated by the Xdebug extension. Make sure to have that installed. In Fedora the package is called"php-pecl-xdebug".

The login test will get TEST_BASEURL and expects a user/pass form there.

void setUP ()
set_auto_clicklink (line 158)

make setUP() automatically click a link right after login

void set_auto_clicklink (string $content)
  • string $content
tearDown (line 229)

overload SimpleTests' tearDown() routine with code to automatically logout from StockManiac.

This test assumes that the browser session is on a page that is providing a 'logout' link. Since most pages do not have this, test cases should finish on the Main Page.

void tearDown ()
toggle_autologin (line 128)

toggles autologin behavior

make setUP() and tearDown() do not auto-login/logout when called

void toggle_autologin ()
toggle_backtomainpage (line 143)

make tearDown() look for a 'back to main page' link right before

trying to logout

void toggle_backtomainpage ()

Documentation generated on Sun, 22 Aug 2010 11:20:27 +0200 by phpDocumentor 1.4.3