/**
  * Generates random value as a string|text|email $type, with specified $length.<br>
  * Can be used $modifier:
  * <li>if $type = string - alnum|alpha|digit|lower|upper|punct
  * <li>if $type = text - alnum|alpha|digit|lower|upper|punct
  * <li>if $type = email - valid|invalid
  *
  * @param string $type Available types are 'string', 'text', 'email' (by default = 'string')
  * @param integer $length Generated value length (by default = 100)
  * @param string|array|null $modifier Value modifier, e.g. PCRE class (by default = NULL)
  * @param string|null $prefix Prefix to prepend the generated value (by default = NULL)
  *
  * @return mixed
  */
 public function generate($type = 'string', $length = 100, $modifier = null, $prefix = null)
 {
     $result = $this->_dataGenerator->generate($type, $length, $modifier, $prefix);
     return $result;
 }
Пример #2
0
 /**
  * @covers Mage_Selenium_Helper_DataGenerator::generateException
  * @depends test__construct
  *
  * @expectedException Mage_Selenium_Exception
  */
 public function testGenerateException()
 {
     $dataGenerator = new Mage_Selenium_Helper_DataGenerator($this->_config);
     $this->assertNull($dataGenerator->generate('some_string'));
 }