/** * Refactored from SecurityTest, as we will be using * this functionality in our fixtures. */ public function testGenerateMethodMakesRandomNumber() { $number1 = $this->_testFix->generate(); $this->assertNotNull($number1); $number2 = $this->_testFix->generate(); $this->assertNotNull($number2); $this->assertEquals(8, strlen($number2)); $this->assertNotEquals($number1, $number2); }
/** * Constructs our Dynamic DB settings, basically sets up our configurations * & constructs our parents functionality. * * @access public * */ public function __construct($env = null) { parent::__construct(); $this->_schemas = array(); if (null !== $env) { $this->_fixMan = new FixturesManager($env); } else { $this->_fixMan = new FixturesManager(); } Zend_ConfigSettings::setUpConfig(); $this->_general = Zend_Registry::get('general'); }
/** * Checks to see if we have a datetype type, if we do * we generate the current date & time. * * @access public * @param String $dataType The fixtures type * @param int $field The field we want to check. * @param PHPUnit_Fixture $obj The object of which we want to assign to. * */ static function aDateTime($dateType, $field, $obj) { if ('datetime' === $dateType) { $obj->setResult($field, date(DATE_RFC822)); } }