This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
# The ServerName directive sets the request scheme, hostname and port that | |
# the server uses to identify itself. This is used when creating | |
# redirection URLs. In the context of virtual hosts, the ServerName | |
# specifies what hostname must appear in the request's Host: header to | |
# match this virtual host. For the default virtual host (this file) this | |
# value is not decisive as it is used as a last resort host regardless. | |
# However, you must set it for any further virtual host explicitly. | |
#ServerName www.example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Behat\Behat\Context\BehatContext; | |
/** | |
* Add Popup in Context | |
*/ | |
class Popup extends BehatContext | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generates IMEI code valid and random | |
* Generates 14 aleatory digits. These 14, multiplies the multiples of 2 by 2 and sum the result | |
* The result Must be divisible by 10, | |
* Then get the diference and genaretes the last digit | |
* | |
* @return int $imei | |
*/ | |
public function imeiRandom() { | |
$code = $this->intRandom(14); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Método para gerar CNPJ válido, com máscara ou não | |
* @example cnpjRandom(0) | |
* para retornar CNPJ sem máscar | |
* @param int $mascara | |
* @return string | |
*/ | |
public static function cnpjRandom($mascara = "1") { | |
$n1 = rand(0, 9); | |
$n2 = rand(0, 9); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param int $size | |
* @return interger | |
*/ | |
public function intRandom($size) { | |
$validCharacters = utf8_decode("0123456789"); | |
$validCharNumber = strlen($validCharacters); | |
$int = ''; | |
while (strlen($int) < $size) { | |
$index = mt_rand(0, $validCharNumber - 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param int $size | |
* @return string | |
*/ | |
public function stringRandom($size) { | |
$validCharacters = utf8_decode("abcdefghijklmnopqrstuvxwzABCDFGHIJKLMNOPQRSTUVXWZ"); | |
$validCharNumber = strlen($validCharacters); | |
$string = ''; | |
while (strlen($string) < $size) { | |
$index = mt_rand(0, $validCharNumber - 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param string $date | |
* @param string $format | |
* @return boolean | |
*/ | |
public function isValidDate($date, $format = 'dd.mm.yyyy') { | |
if (strlen($date) >= 6 && strlen($format) == 10) { | |
// find separator. Remove all other characters from $format | |
$separator_only = str_replace(array('m', 'd', 'y'), '', $format); |