* @license PHP License * @package WB * @subpackage unittest */ require_once dirname(__FILE__) . '/../rule.php'; /** * Unit Test * * * @todo improve test * @version 0.1.0 * @package WB * @subpackage unittest */ class TestCasePat_Forms_Rule_userlogin extends TestCasePat_Forms_Rule { protected $formDef = array( 'user' => array( 'type' => 'String', 'attributes' => array( 'title' => 'folder', 'required' => 'no', 'minlenght' => 1, 'maxlength' => 250 ) ) ); /** * constructor * * - start objects * - source SQL * */ public function __construct() { parent::__construct(); //WBClass::load('WBUnitTest_SQLUte'); //WBUnitTest_SQLUte::source(__FILE__, 'construct'); } /** * destruct * * Remove testing tables */ public function __destruct() { //WBUnitTest_SQLUte::source( __FILE__, 'destruct' ); parent::__destruct(); } public function testLoad() { WBClass::load('patForms'); $rule = patForms::createRule('UserLogin'); /** @var $rule WBPAT_Forms_Rule */ $this->assertIsA($rule, 'WBPAT_Forms_Rule'); $this->assertIsA($rule, 'patForms_Rule'); $this->assertIsA($rule, 'patForms_Rule_UserLogin'); $config = array( 'user' => '42', ); $rule->setConfig($config); } } ?>