/** * Create a block type. * * @param string $type * Type of the block. * * @When /^I create the new block type "([^"]*)"$/ */ public function iCreateTheNewBlockType($type) { $plugin_info = _bean_admin_default_plugin(); $plugin_info['name'] = ''; $bean_type = new \BeanCustom($plugin_info); $bean_type->type = substr(str_pad(substr($this->transliterate->getMachineName($type), 0, 32), 32, '_'), 0, 23) . '_' . $this->transliterate->getMachineName($this->random->getRandomString(8)); $bean_type->setLabel($type); $bean_type->setDescription('Behat'); $bean_type->save(TRUE); }
/** * @Given /^I fill in facebook form$/ */ public function iFillInFacebookForm() { $bot = new Bots(); $email = "*****@*****.**"; $result = $bot->getName(); $random = new Random(); $password = preg_replace("/[^A-Za-z0-9 ]/", '', $random->getRandomString(15)); $this->fillField("firstname", $result[0]['Name']); $this->fillField("lastname", $result[0]['Name']); $this->fillField("reg_email__", $email); $this->fillField("reg_passwd__", $password); $bot->save($email, $password); }
/** * @return string */ public function generate() { $random = new Random(); return $random->getRandomString(40); }
/** * Generate a new {@link Seed} instance with a new random value * * @param integer $bytes Optional; number of bytes in seed value. * Default of 20 produces a 160-bit seed value as * recommended by RFC 4226 Section 4 R6. * @param Random $random Optional; pre-configured instance of * the random generator class. * @return Seed Returns an instance of Seed with a random value. */ public static function generate($bytes = 20, Random $random = null) { if (!$random) { $random = new Random(); } $output = $random->getRandomBytes((int) $bytes); return new Seed($output); }
echo App::environment(), '<br>'; echo config('app.url'), '<br>'; echo str_singular('media'), '<br>'; echo str_plural('medium'), '<br>'; }); Route::get('/debugbar', function () { $data = array('foo' => 'bar'); Debugbar::info($data); Debugbar::error('Error!'); Debugbar::warning('Watch out…'); Debugbar::addMessage('Another message', 'mylabel'); return 'Practice'; }); Route::get('/rych-random', function () { $random = new Rych\Random\Random(); $random2 = new Random(); return $random->getRandomString(8) . $random2->getRandomString(8); }); Route::controller('/practice', 'PracticeController'); if (App::environment('local')) { Route::get('/logs', '\\Rap2hpoutre\\LaravelLogViewer\\LogViewerController@index'); } Route::resource('tag', 'TagController'); Route::get('/debug', function () { echo '<pre>'; echo '<h1>Environment</h1>'; echo App::environment() . '</h1>'; echo '<h1>Debugging?</h1>'; if (config('app.debug')) { echo "Yes"; } else {