/** * 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); }
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 { echo "No";