Example #1
0
 /**
  * A basic functional test example.
  *
  * @return void
  */
 public function test_create_ticket()
 {
     $user = seed('User');
     $this->actingAs($user)->visit(route('tickets.create'))->type('Curso de VueJS', 'title')->press('Enviar solicitud');
     $this->see('Curso de VueJS');
     $this->seeInDatabase('tickets', ['title' => 'Curso de VueJS', 'status' => 'open']);
 }
function parag($min, $max)
{
    srand(seed());
    $parag = "";
    $words = array("theres", "such", "a", "place", "as", "yarrow", "thou", "whose", "fancies", "from", "afar", "are", "brought", "little", "flowerill", "make", "stir", "when", "all", "alive", "with", "merry", "chimes", "has", "it", "in", "her", "power", "again", "and", "fortune", "gifts", "lies", "garland", "of", "seven", "lilies", "wrought", "should", "life", "be", "dull", "spirits", "low", "that", "they", "wanton", "wooers", "but", "we", "will", "leave", "growing", "years", "to", "mother", "bring", "distress", "prophet", "delight", "mirth", "inhale", "deeply", "right", "until", "level", "the", "dust", "noble", "horde", "preserve", "for", "thee", "by", "individual", "water", "you", "can", "start", "he", "was", "free", "write", "on", "snow", "yet", "left", "conquered", "mountain", "peaks", "this", "is", "calm", "there", "cannot", "stayed", "pushkin", "never", "tried", "flee", "together", "plungd", "into", "deep", "legs", "move", "not", "if", "set", "signboard", "blaze", "weakstraight", "grave", "well", "wander", "scotland", "thorough", "strikes", "solitary", "sound", "what", "evil", "spirit", "deception", "my", "opponent", "played", "knows", "guess", "just", "lapped", "icecold", "milky", "way", "killing", "i", "have", "made", "myself", "perhaps", "quick", "eager", "visitings", "nor", "quit", "thy", "shore", "conspicuous", "object", "nations", "eye", "watched", "me", "rise", "awe", "neighborlowlifes", "shared", "while", "pattern", "knights", "dance", "under", "jedborough", "tower", "screams", "weak", "allow", "pass", "cheers", "melancholy", "mate", "let", "beeves", "homebred", "kine", "partake", "twas", "face", "did", "know", "stood", "against", "were", "sieving", "grain", "ossian", "last", "his", "race", "telling", "now", "worldly", "grandeur", "despise", "woman", "road", "met", "one", "chance", "look", "turn", "taken", "praise", "thine", "any", "burden", "soul", "pain", "keep", "squatting", "till", "drop", "darling", "passion", "approve", "slipped", "cliff", "better", "memory", "punish", "him", "constant", "checking", "selfsacrifice", "cover", "leaves", "children", "forlorn", "estate", "maytime", "chearful", "dawn", "queen", "greater", "than", "rest", "recollect", "doomd", "jostle", "unkindly", "shocks", "squares", "more", "like", "circles", "eyes", "sea", "grief", "splashing", "diffusion", "crown", "win", "stirring", "brake", "fern", "time", "before", "thrush", "ever", "deeds", "give", "birth", "bay", "quiet", "or", "unthoughtof", "obscurity", "sad", "sight", "shepherd", "sigh", "shake", "flowing", "rivers", "would", "hide", "she", "wait", "return", "pity", "whom", "must", "follow", "head", "fall", "starting", "duel", "so", "inane", "brothers", "reachd", "gateway", "who", "art", "light", "guide", "rod", "something", "deeper", "far", "these", "neither", "shape", "danger", "dismay", "lanes", "thoughts", "pursuing", "good", "men", "do", "sate", "denial", "restraint", "prize", "how", "nourishd", "here", "through", "long", "ground", "thankfulness", "halts", "searches", "smitten", "heart", "god", "only", "known", "some", "might", "say", "run", "cry", "nay", "us", "die", "oh", "strong", "forceful", "echo", "voice", "enwrought", "tempted", "able", "endure", "speak", "horn", "shall", "witness", "pasture", "expending", "vegetarian", "love", "sweet", "highland", "girl", "part", "an", "indian", "approach", "every", "angle", "sought", "moral", "creed", "deaf", "drooping", "doom", "hangover", "quickening", "thence", "also", "tenderness", "influence", "peculiar", "grace", "risen", "out", "many", "nownow", "along", "gap", "where", "edge", "very", "narrow", "been", "then", "thought", "joy", "wants", "eatand", "eat", "beg", "please", "your", "quite", "advanced", "died", "cabin", "small", "betwixt", "living", "dead", "oer", "lauras", "over", "hill", "hollow", "evolve", "havoc", "disease", "risk", "land", "sped", "horse", "away", "wounded", "game", "workman", "worthy", "sainted", "bold", "hubert", "lives", "glee", "scramble", "cities", "crowded", "streets", "apprehensions", "come", "crowds", "dweller", "savage", "ends", "maintain", "rights", "those", "rules", "saw", "upon", "nearer", "view", "said", "beneath", "cloak", "separation", "music", "bore", "beautiful", "verses", "their", "honor", "penned", "ages", "heirs", "value", "masters", "side", "murmur", "near", "silent", "lake", "yarrows", "banks", "herons", "feed", "towards", "people", "era", "grew", "colder", "night", "day", "at", "even", "morn", "brain", "wisdom", "greedy", "spider", "flower", "mine", "check", "erring", "reprove", "alas", "received", "cheerless", "murky", "space", "depleting", "gloomily", "gleaming", "harking", "talking", "man", "arms", "wish", "thing", "unreconciled", "pious", "bird", "scarlet", "breast", "bluecap", "colours", "bright", "ye", "thoughtless", "pair", "old", "unhappy", "faroff", "things", "above", "human", "estimate", "crawling", "lurking", "concealing", "others", "spilled", "blood", "moment", "stay", "brink", "paris", "france", "disapproved", "sharing", "see", "hamiltons", "ballad", "took", "jacket", "off", "effect", "no", "babe", "proposed", "castle", "trade", "board", "prove", "best", "heights", "boughs", "them", "closing", "commandment", "kill", "vain", "causeless", "led", "lucy", "spot", "continued", "rue", "posterngate", "slunk", "sun", "shade", "annoying", "crickets", "voluptuously", "luscious", "gods", "appointment", "sway", "heave", "after", "our", "first", "green", "pastures", "remain", "which", "nothing", "sweeter", "heard", "hungered", "fame", "accused", "gaiety", "courageous", "shows", "its", "hunting", "sinful", "demand", "roaring", "yelling", "peace", "disturbing", "contracted", "own", "hurried", "ran", "called", "though", "past", "prime", "feeling", "renderd", "compassionate", "grip", "pistol", "hand", "go", "spots", "bough", "grassy", "blade", "sweat", "tenseness", "wedding", "down", "rocks", "leap", "plaintive", "numbers", "flow", "lost", "weight", "slept", "fine", "gradually", "vanishing", "century", "lasting", "slowly", "passed", "strike", "take", "aim", "famous", "robin", "hood", "indeed", "claim", "principles", "amen", "poor", "yurik", "steph", "empty", "terrors", "overawe", "sweets", "burnmill", "meadow", "convent", "hermits", "cell", "wooden", "castles", "rooks", "bar", "closed", "months", "went", "smilingly", "repeats", "moan", "moss", "stone", "incapable", "vengeance", "refuse", "lineswithout", "doubt", "poet", "play", "awesome", "appetite", "works", "three", "four", "smiles", "motion", "sky", "serene", "pure", "almost", "could", "repine", "hadst", "boast", "didst", "foot", "had", "useless", "trunk", "various", "poems", "scene", "laid", "buds", "taught", "piece", "route", "falsely", "correctly", "single", "passd", "sir", "eustace", "present", "does", "bard", "sleep", "dilemma", "appeared", "warn", "comfort", "command", "countless", "warriors", "pale", "trembling", "denmark", "cast", "exceeding", "pleasure", "among", "farthest", "hebrides", "spite", "reason", "thoughtful", "herdsman", "strays", "stately", "passions", "burn", "fought", "lucies", "fair", "hangs", "apple", "frae", "rock", "second", "twilight", "looks", "gay", "although", "wild", "moor", "wood", "fairest", "creatures", "desire", "increase", "wind", "threw", "words", "pleasance", "transports", "advantage", "jab", "playmates", "sunny", "weather", "swap", "each", "figure", "liquor", "glass", "why", "am", "ignorant", "same", "awaking", "sleeping", "marching", "parading", "most", "important", "true", "solitude", "binnorie", "lie", "about", "feet", "moving", "back", "forth", "hath", "family", "outlaw", "daring", "mood", "egremonts", "domains", "death", "emerges", "done", "worldlings", "unmovd", "mind", "lanetheres", "morning", "rub", "yourself", "harder", "two", "simple", "phrases", "unfinished", "scenes", "need", "child", "eddying", "round", "sink", "flew", "during", "term", "hear", "neglect", "lower", "world", "descending", "bravery", "times", "conclusion", "drawn", "raw", "wet", "stirs", "doors", "brother", "seems", "singingbird", "gone", "picture", "wellspent", "seemd", "paltry", "indopakistani", "struggle", "highranking", "adolescents", "worse", "ourselves", "walk", "started", "perceive", "duller", "none", "tracks", "motions", "slow", "knowing", "think", "lofty", "woke", "forgive", "tough", "become", "favour", "sounded", "alone", "enormous", "barrier", "binds", "fast", "find", "longs", "get", "trapped", "fishermen", "net", "large", "droplets", "flowers", "laugh", "beds", "higher", "hast", "summoned", "melt", "pointed", "lance", "travel", "hours", "perfect", "gladsomeness", "rage", "rush", "around", "house", "pother", "young", "lambs", "fullgrown", "flocks", "beside", "heathy", "dell", "close", "behind", "frosty", "air", "fishers", "sisters", "johnny", "warned", "watch", "foresee", "moves", "surely", "surrender", "quality", "act", "tales", "whybecause", "rule", "steep", "up", "kind", "chaunt", "passing", "stave", "capable", "rate", "strange", "slight", "scorn", "fear", "clear", "weeds", "law", "depends", "port", "plane", "april", "still", "asking", "deceitful", "solution", "chime", "fancy", "wrong", "trod", "clyde", "tay", "skies", "stream", "flows", "bonny", "holms", "maimd", "mangled", "inhuman", "often", "sighd", "measure", "summers", "heat", "winters", "traveller", "whole", "summer", "fields", "peers", "whats", "arm", "bear", "vision", "sovereign", "enact", "winsome", "marrow", "tell", "everything", "closer", "fellowship", "count", "glittering", "countenance", "moved", "expressd", "lines", "yes", "endless", "problem", "answer", "seemed", "strife", "despair", "glorious", "ministry", "thats", "moon", "choice", "blurry", "meat", "bullets", "easy", "chewable", "food", "comprehends", "trust", "remnant", "uneasy", "crystal", "flakes", "brilliant", "glow", "wave", "fare", "talented", "hymns", "sings", "springtime", "cuckoobird", "oft", "nooks", "remote", "brave", "rob", "roy", "impossible", "doth", "won", "found", "hopeless", "honour", "gain", "creature", "lord", "friend", "tackle", "becoming", "irate", "gentle", "nature", "guard", "ill", "flaring", "unusual", "primroses", "glory", "branches", "quietly", "squealing", "joyous", "other", "stuff", "age", "twine", "brows", "fresh", "spring", "brings", "decay", "hell", "else", "bawling", "raving", "signing", "flirting", "july", "suns", "feels", "games", "giddy", "sprite", "darkness", "pleasd", "equal", "lay", "sights", "rough", "sounds", "rains", "comes", "sparkle", "cheek", "agile", "neat", "pansies", "kingcups", "daisies", "desperately", "try", "shot", "caught", "utmost", "bounty", "kindle", "fire", "new", "stirrd", "too", "sedate", "outward", "show", "kings", "aces", "disguise", "lonely", "deem", "unmeet", "news", "sleeps", "glen", "without", "someone", "attacked", "pretty", "kitten", "freaks", "leaf", "glowworm", "quickly", "may", "float", "double", "swan", "shadow", "daunted", "father", "recompence", "catch", "lips", "mazy", "unravelld", "really", "roam", "abides", "resolve", "stops", "lookd", "wanting", "once", "fish", "raves", "thus", "daily", "selfsurpast", "going", "hence", "livst", "less", "ambitious", "sprint", "fly", "crags", "repeat", "ravens", "croak", "bliss", "number", "funny", "droll", "repeating", "timid", "coming", "whence", "kindly", "unassuming", "cheer", "wings", "arch", "wily", "ways", "lead", "generous", "books", "course", "call", "household", "fitted", "needs", "lovely", "apparition", "sent", "hook", "jaw", "early", "breath", "tigerleap", "half", "late", "conceived", "proper", "curse", "lacked", "fully", "methods", "attack", "mad", "throughout", "conflict", "keeps", "forward", "persevering", "gallop", "horses", "peaceful", "bed", "because", "museand", "agree", "shoved", "unwelcome", "tasks", "word", "fulfilld", "singing", "hearts", "insane", "happened", "surgeon", "cut", "across", "thither", "rainbow", "cloud", "figurethere", "year", "dost", "confession", "askd", "forgiveness", "fellow", "feats", "vainly", "spreads", "lure", "inheritest", "lions", "den", "endurance", "foresight", "strength", "skill", "hid", "care", "thousand", "standersby", "evermore", "beguild", "whether", "blows", "western", "bound", "himself", "unbound", "ownd", "precipice", "front", "begin", "fro", "hurry", "fight", "rover", "suddenly", "agreed", "draw", "shone", "tree", "observed", "blunder", "enough", "earth", "heaven", "imagery", "lowlier", "gains", "rewards", "privileges", "loch", "ketterine", "evening", "sunset", "mien", "blending", "pawn", "standing", "proud", "country", "bred", "adopt", "homely", "dress", "within", "bud", "buriest", "content", "glitters", "plain", "pinfoldlike", "burialgrounds", "neglected", "desolate", "showers", "manna", "breaking", "defense", "told", "simply", "fidelity", "dog", "hovering", "nigh", "hospitably", "entertained", "weeks", "dismal", "guarding", "protecting", "meet", "pleasant", "build", "sides", "wishes", "carst", "naught", "longest", "appetizer", "use", "bottle", "sign", "fallen", "faculties", "english", "balladsingers", "transient", "sorrows", "wiles", "tender", "heir", "flight", "surrounded", "ancient", "heavens", "writing", "rhymes", "england", "hawk", "prey", "maiden", "dwelling", "yon", "lass", "yelping", "runs", "symphony", "austere", "hed", "today", "disgrace", "unwind", "drink", "sing", "blast", "utterd", "unskillfulness", "aid", "aside", "smoke", "image", "outlined", "hang", "rememberd", "blest", "got", "fastidious", "coronet", "riding", "home", "stormy", "louisa", "lets", "bad", "receives", "fiercely", "hunters", "line", "lightweight", "bishops", "feeble", "forms", "covert", "peep", "travellers", "shady", "haunt", "askest", "stared", "blink", "came", "clovenford", "few", "meagre", "vales", "confind", "joys", "spy", "bosom", "helvellyn", "rocky", "supplicate", "controul", "travelld", "unknown", "exposd", "suffering", "furnishes", "suspended", "defeat", "hanging", "tail", "step", "frost", "shew", "help", "frame", "listen", "tight", "thong", "later", "learned", "panic", "winds", "brook", "sits", "vacant", "shots", "being", "fired", "aims", "grass", "forgivn", "guards", "feel", "restless", "loudly", "grunting", "running", "painted", "robins", "breathed", "burthen", "fashiond", "dream", "knew", "matron", "due", "blasts", "wit", "towel", "spotted", "fruit", "unripe", "industrious", "folly", "patient", "primrose", "fault", "dusk", "ive", "seldom", "markd", "press", "likewise", "sons", "daughters", "dig", "inside", "plate", "throat", "walked", "throne", "deserved", "missing", "link", "glides", "dark", "hills", "nest", "cried", "loves", "friends", "trim", "hues", "filld", "tears", "whateer", "enjoyments", "dwell", "ripening", "innocence", "example", "gave", "looking", "snack", "records", "promises", "submit", "bowers", "playd", "gambol", "lifes", "falling", "state", "youth", "pathway", "cultivated", "heaved", "holding", "lover", "craved", "quell", "foes", "unfolding", "wide", "earthly", "cares", "asleep", "pyramid", "celandine", "bag", "lose", "shout", "whistle", "ear", "bitterness", "quietness", "thickets", "fifty", "greetings", "stirringly", "swimming", "walking", "repose", "twice", "consenting", "shed", "glance", "eagerness", "chasing", "mice", "health", "body", "pind", "theme", "sung", "another", "grizzly", "speech", "bit", "makes", "decoy", "chased", "harnesses", "high", "darts", "blame", "wildest", "scream", "ah", "already", "spent", "pride", "gazed", "conveyd", "wealthy", "treasure", "dread", "rustling", "utterly", "guise", "kept", "voyages", "delights", "mournful", "tale", "keen", "white", "great", "issues", "humankind", "spare", "conflicts", "fate", "unaware", "astronomer", "break", "silence", "throw", "needful", "knight", "verse", "steerd", "proclamationhorn", "mock", "apparel", "son", "humbled", "sit", "walls", "truth", "seem", "answerd", "soon", "question", "appearance", "meets", "sang", "battles", "soccer", "player", "tarn", "below", "wrongs", "scarcely", "heed", "blocked", "lane", "faery", "voyager", "both", "wise", "crush", "rival", "howsoever", "mean", "derived", "search", "starsigntaurus", "grasped", "immobility", "lithest", "gaudiest", "harlequin", "kisses", "touch", "sip", "separating", "opposing", "notion", "proved", "booze", "coffee", "charms", "seas", "thread", "ariadne", "scheme", "chef", "convinced", "scared", "steps", "virgin", "liberty", "days", "following", "husband", "govern", "record", "honest", "continuing", "imprisond", "hot", "sunshine", "inheritance", "twilights", "dusky", "hair", "whatsoeer", "sunbright", "full", "childish", "liveth", "despaird", "believd", "remains", "wearily", "length", "flaw", "unknowingly", "missed", "stirrups", "disciplined", "wicked", "sickle", "bending", "stop", "matter", "learn", "history", "bleak", "mild", "concerns", "ordinary", "winter", "wears", "proof", "roys", "alert", "planned", "plotted", "fierce", "row", "dauntless", "challenge", "ask", "apply", "beauty", "dower", "woe", "lintwhites", "chorus", "fellowtraveller", "cold", "ice", "worlds", "flu", "illnessthree", "region", "lucky", "bastard", "twill", "soothe", "sorrow", "polity", "sacrifice", "christ", "saviour", "sticking", "kerchiefplots", "mold", "name", "river", "bare", "wanderers", "thousands", "dollars", "effortless", "money", "fatherly", "concern", "pang", "vexd", "aver", "multitude", "sweetly", "reposing", "bands", "armsout", "trees", "veil", "withdrawn", "hut", "tour", "confuse", "debut", "godheads", "benignant", "andmoney", "needed", "ride", "barking", "cat", "plays", "neatly", "error", "unprofitable", "ophilia", "dear", "delighted", "sake", "replaced", "athletic", "prophy", "guessing", "tundra", "peter", "norway", "boors", "prison", "clinicmy", "seemliness", "complete", "sways", "seen", "tiviot", "dale", "familiar", "provokes", "lady", "shares", "wonder", "merits", "resolved", "eer", "champion", "brotherhood", "venerable", "damn", "fawns", "extacy", "buttercups", "unheard", "cull", "faculty", "storm", "turbulence", "happy", "genial", "barely", "cool", "diffuse", "blessd", "main", "embarrassd", "shy", "next", "sense", "persons", "advance", "hamilton", "beginning", "shield", "latest", "impearling", "lucie", "born", "figures", "braes", "humbly", "bloodshed", "miserable", "train", "courtesies", "wilt", "panting", "violets", "acted", "tidings", "woes", "end", "stars", "hungry", "surprised", "tells", "clamor", "stopped", "dries", "used", "severe", "since", "untowardness", "poets", "mere", "mostly", "rooted", "chair", "livd", "lands", "soothed", "milder", "airs", "stranger", "seemingly", "civil", "harmless", "stand", "straight", "nervous", "daisy", "blessed", "rising", "collapse", "reaping", "herself", "remember", "amazing", "palms", "infants", "laughing", "puzzled", "blinded", "immediately", "leaps", "feeding", "appletree", "superstition", "worth", "taking", "sympathy", "heeds", "trace", "upstarting", "affright", "greetst", "fowls", "ref", "hadn", "opened", "score", "nobody", "posterity", "renownd", "unexciting", "vice", "guests", "listend", "fill", "reaper", "bushes", "mournfully", "eggs", "gaze", "places", "hurrythree", "flourish", "seeking", "school", "scannd", "dewdrop", "unto", "lowly", "pursue", "pox", "turns", "necessity", "beloved", "possess", "grotto", "particular", "exquisite", "baby", "chains", "tie", "befal", "yellow", "rouzd", "vale", "holiday", "flutterd", "perchd", "thank", "mechanic", "whip", "lash", "striking", "force", "applying", "muscles", "shaped", "wake", "highlands", "troubles", "beyond", "relief", "untimely", "joyousness", "hideandseek", "homefelt", "pleasures", "itself", "common", "breeds", "liked", "greeting", "mountains", "eagle", "seventythree", "nighttime", "short", "hither", "straightway", "behold", "seehis", "fork", "begins", "rattle", "boat", "graven", "read", "fathers", "courtesy", "runaway", "beautifully", "outstandingly", "clever", "prettiest", "tumbler", "infant");
    if ($min == 1) {
        return $words[array_rand($words)];
    } else {
        $words_idx = array_rand($words, rand($min, $max));
        $first_upc = 1;
        $parag = array();
        foreach ($words_idx as $idx) {
            $word = $words[$idx];
            $rnd_num = rand(0, 1);
            $sym = "";
            if ($rnd_num) {
                $rnd_sym = array(",", " -", ":", ".");
                $rnd_num = rand(0, count($rnd_sym) - 1);
                $sym = $rnd_sym[$rnd_num];
                $word .= $sym;
            }
            if ($first_upc) {
                array_push($parag, ucfirst($word));
                $first_upc = 0;
            } else {
                array_push($parag, $word);
            }
            if ($sym == "." || $sym == ":") {
                $first_upc = 1;
            }
        }
        array_push($parag, $words[array_rand($words)]);
    }
    return implode(" ", $parag) . ".";
}
Example #3
0
 /**
  * A basic test example.
  *
  * @return void
  */
 public function test_see_popular_tickets()
 {
     $popularTicket = seed('Ticket');
     $ticket = seed('Ticket');
     seed('TicketVote', 10, ['ticket_id' => $popularTicket->id]);
     seed('TicketVote', 2, ['ticket_id' => $ticket->id]);
     $this->visit('/')->click('Populares')->seeInElement('h1', 'Solicitudes populares')->see($popularTicket->title)->see('10 votos')->dontSee($ticket->title)->dontSee('2 votos');
 }
Example #4
0
 /**
  * A basic functional test example.
  *
  * @return void
  */
 public function test_user_login()
 {
     //HAVING
     $user = seed('User', ['email' => '*****@*****.**', 'password' => 'secret', 'role' => 'admin', 'active' => 1, 'confirmation_token' => null]);
     //WHEN
     $this->visit('/')->see('Inicia Sesión por favor')->type($user->email, 'email')->type('secret', 'password')->press('Entrar');
     //THEN
     $this->see('Usuarios')->seePageis('/admin/users');
 }
Example #5
0
 public static function random($model)
 {
     if (!static::collectionExist($model)) {
         // If no objects are registered in the given
         // collection attempt to create a new one
         return seed($model);
     }
     return static::$pool[$model]->random();
 }
Example #6
0
 /**
  * A basic test example.
  *
  * @return void
  */
 public function testExample()
 {
     $duilio = seed('User', ['name' => 'Duilio', 'email' => '*****@*****.**']);
     $jeffer = seed('User', ['name' => 'Jeffer', 'email' => '*****@*****.**']);
     $jesus = seed('User', ['name' => 'Jesus', 'email' => '*****@*****.**']);
     seed('User', ['name' => 'Clemir', 'email' => '*****@*****.**']);
     seed('User', ['name' => 'Dimitri', 'email' => '*****@*****.**']);
     seed('User', ['name' => 'Rafael', 'email' => '*****@*****.**']);
     $this->get('autocomplete/users?term=duilio')->seeStatusCode(200)->seeJsonEquals([['id' => $duilio->id, 'name' => 'Duilio', 'email' => '*****@*****.**']]);
     $this->get('autocomplete/users?term=je')->seeStatusCode(200)->seeJsonEquals([['id' => $jeffer->id, 'name' => 'Jeffer', 'email' => '*****@*****.**'], ['id' => $jesus->id, 'name' => 'Jesus', 'email' => '*****@*****.**']]);
 }
Example #7
0
 public function test_select_resource()
 {
     // Having
     $user = seed('User');
     $ticket = seed('Ticket', ['title' => $this->title, 'user_id' => $user->id, 'status' => 'open']);
     $comment = seed('TicketComment', ['ticket_id' => $ticket->id, 'link' => $this->link]);
     // When
     $this->actingAs($user)->visit(route('tickets.details', $ticket))->press('Seleccionar tutorial');
     // Then
     $this->seeInDatabase('tickets', ['id' => $ticket->id, 'status' => 'closed', 'link' => $this->link]);
     $this->seeInDatabase('ticket_comments', ['id' => $comment->id, 'selected' => true]);
     $this->seePageIs(route('tickets.details', $ticket));
     $this->seeLink('Ver recurso', $this->link);
 }
Example #8
0
 public function test_administrator_select_two_resources()
 {
     // Having
     $user = seed('User', ['role' => 'admin']);
     $ticket = seed('Ticket', ['user_id' => $user->id]);
     $comment1 = seed('TicketComment', ['ticket_id' => $ticket->id, 'link' => 'https://styde.net']);
     $comment2 = seed('TicketComment', ['ticket_id' => $ticket->id, 'link' => 'https://twitter.com/StydeNet']);
     // When
     $ticket->assignResource($comment1);
     $ticket->assignResource($comment2);
     // Then
     $this->seeInDatabase('tickets', ['id' => $ticket->id, 'link' => 'https://twitter.com/StydeNet']);
     $this->seeInDatabase('ticket_comments', ['id' => $comment1->id, 'selected' => false]);
     $this->seeInDatabase('ticket_comments', ['id' => $comment2->id, 'selected' => true]);
 }
  </tr>
  <tr>
    <td height="15" colspan="6"><span class="STYLE7">时间:<?php 
echo date("Y-m-d H:i:s");
?>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单号(NO):
	<?php 
//给报表生成一个随机数
//seed用户自定义函数以微秒作为种子
function seed()
{
    list($msec, $sec) = explode(' ', microtime());
    return (double) $sec;
}
//播下随机数发生器种子,用srand函数调用seed函数的返回结果
srand(seed());
//输出产生的随机数,随机数的范围为10~10000
echo rand(10, 10000);
?>
	</span></td>
  </tr>
  <tr>
    <td width="28" rowspan="3"><div align="center"><strong><span class="STYLE4">付款人</span></strong></div></td>
    <td width="96" height="23"><div align="center"><span class="STYLE4">业主姓名</span></div></td>
    <td width="131">&nbsp;<?php 
echo $业主;
?>
</td>
    <td width="28" rowspan="3"><div align="center"><span class="STYLE5">规格</span></div></td>
    <td width="108"><div align="center" class="STYLE4">车牌号</div></td>
    <td width="142">&nbsp;<?php 
Example #10
0
function seed($depth, $player)
{
    if ($depth == 0) {
        return 1;
    } else {
        if ($player % 2) {
            // impair
            return seed($depth - 1, intval(($player + 1) / 2));
        } else {
            return pow(2, $depth) + 1 - seed($depth - 1, intval(($player + 1) / 2));
        }
    }
}
Example #11
0
         $selectlist .= "";
     }
 }
 echo "<table cellspacing=2 cellpadding=2 border=0>";
 echo "<tr><td class=title colspan=7 align=middle>1/{$finale} {$strFinale}</td></tr>";
 $db->select("*");
 $db->from("{$dbprefix}matchs");
 $db->where("type = 'W'");
 $db->where("finale = {$finale}");
 $db->where("tournois = {$s_tournois}");
 $matchs = $db->exec();
 /** pour tous les matchs de 1/finale **/
 while ($match = $db->fetch($matchs)) {
     echo "<tr>";
     $seed1 = seed($match->equipe1, $s_tournois);
     $seed2 = seed($match->equipe2, $s_tournois);
     if ($match->equipe1) {
         echo "<td class=info><a href=?page=finales&op=delete&id={$match->id}&side=1>[{$strS}]</a></td>";
         echo "<td class=text align=left width=120>" . $show($match->equipe1, $op, '', $seed1) . "</td>";
     } elseif ($list == 1) {
         echo "<td class=info></td><td class=text align=center width=120>";
         echo "<form method=post>";
         echo "<input type=hidden name=op value=add>";
         echo "<input type=hidden name=id value={$match->id}>";
         echo "<input type=hidden name=side value=1>";
         echo "<select name=participant onchange=submit()>{$selectlist}</select></td></form>";
     } else {
         echo "<td class=info></td><td class=text align=center width=120></td>";
     }
     echo "<td class=nullfinale width=15>-</td>";
     echo "<td class=text>{$strVS}</td>";
Example #12
0
     /*** traitement des manches ***/
     /*$db->select("*");
     			$db->from("${dbprefix}manches_report");
     			$db->where("matchi = $id");
     			$db->where("equipe = ".$moi%2 + 1);
     			$manches=$db->exec();
     
     			if($db->num_rows($manches)!=0) {
     
     
     			}*/
 } else {
     /*** affichage de la popup ***/
     echo "<SCRIPT>\r\n\t\t\t\tfunction oneOrNoCheckboxGroup (checkbox) {\r\n\t\t\t\t\tvar checkboxGroup = checkbox.form[checkbox.name];\r\n\t\t\t\t\tfor (var c = 0; c < checkboxGroup.length; c++)\r\n\t\t\t\t\t\tif (checkboxGroup[c] != checkbox)\r\n\t\t\t\t\t\t\tcheckboxGroup[c].checked = false;\r\n\t\t\t\t}\r\n\t\t\t\t</SCRIPT>";
     $seed2 = seed($match->equipe2, $match->tournois);
     $seed1 = seed($match->equipe1, $match->tournois);
     echo '<form name="form" method="post">';
     echo '<input type="hidden" name="op" value="do_report">';
     echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">";
     echo "<table border=0 cellpadding=0 cellspacing=0 class=bordure1><tr><td>";
     echo "<table cellspacing=1 cellpadding=0 border=0 class=fiche>";
     if ($match->type == 'P') {
         echo "<tr><td class=headerfiche>{$strMatch} {$strPoule} {$match->poule} - {$strTour} {$match->tour}</td></tr>";
     } elseif ($match->type == 'W' || $match->type == 'L') {
         if ($match->type == 'W') {
             $type = $strWinner;
         } elseif ($match->type == 'L') {
             $type = $strLooser;
         }
         if ($match->finale > 1) {
             echo "<tr><td class=headerfiche>{$strMatch} 1/{$match->finale} {$strFinale} {$type} #{$match->numero}</td></tr>";
function update_details_global($contest, $contest_id, $contest_type, $cid)
{
    //adding contest details
    //creating object of api
    echo "inside update global details ";
    $provider = "hackerearth";
    $api_table = new api_table();
    $api = new api($api_table->get_api_url($provider), $api_table->get_client_id($provider), $api_table->get_client_secret($provider));
    $json_data = $api->connect_api($contest_id);
    //creating object of data for getting valuable information from json data
    $data = new data();
    $coders_size = $data->coders_participated($json_data);
    echo $coders_size;
    if ($coders_size == 0) {
        die("Problem in connection with hackererth api : Reload to try again ");
    }
    //creating object of coders main table
    //$coders = new coders();
    //creating object of coders rating table
    //$rating = new rating();
    //check for tables if not present then create them
    $candidate = new candidate_api($api_table->get_client_id($provider), $api_table->get_client_secret($provider));
    $coders = new coders();
    $rating = new rating();
    //$res=$candidate->connect_api(11902,"*****@*****.**");
    //looping to add new coders details
    $candidates_data = array();
    $index = 0;
    for ($i = 0; $i < $coders_size; $i++) {
        $hacker_id = $data->hacker_id($json_data, $i);
        $name = $data->name($json_data, $i);
        $email = $data->email($json_data, $i);
        $res = $candidate->connect_api($contest_id, $email);
        $institute = $data->institute($res);
        $pos1 = strpos($institute, "silchar");
        $pos2 = strpos($institute, "sichar");
        if ($pos1 != false || $pos2 != false) {
            $candidates_data[$index]['hacker_id'] = $hacker_id;
            $candidates_data[$index]['name'] = $name;
            $index++;
            echo 1 + $index . " " . $name . "<br>";
            if (!$coders->is_coder_present($hacker_id)) {
                $coders->add_new_coder($hacker_id, $name);
                echo "new coder added " . $name . "<br>";
            }
        }
        //if(!$coders->is_coder_present($hacker_id)){
        //	$coders->add_new_coder($hacker_id,$name);
        //$rating->add_new_coder($hacker_id);
        //echo "new coder added ".$name."<br>";
    }
    echo "<pre>";
    print_r($candidates_data);
    $rating_val = array();
    for ($i = 0; $i < $index; $i++) {
        $hacker_id = $candidates_data[$i]['hacker_id'];
        $rate = $coders->get_final_rating($hacker_id);
        $rating_val[$hacker_id] = $rate;
    }
    echo "<pre>";
    print_r($rating_val);
    //array storing new calculated seed values
    $seed = seed($rating_val, $index, $coders);
    echo "<pre>";
    print_r($seed);
    //array for storing new rating values
    $new_rating = array();
    for ($i = 0; $i < $index; $i++) {
        $hacker_id = $candidates_data[$i]['hacker_id'];
        $new_rating[$hacker_id] = new_rating($seed[$hacker_id], $i + 1, $contest_type, $rating_val[$hacker_id], $index);
    }
    echo "<pre>";
    print_r($new_rating);
    //adding a new column in coders rating table
    //updating new rating for each participated contest
    foreach ($new_rating as $key => $value) {
        $uid = $coders->get_uid($key);
        $coders->update_rating($key, $value);
        $rating->insert_new_rating($cid, $uid, $value);
        //echo "rating updated";
    }
    //updating new coders to old
    $coders->new_to_old();
    //updating that contest is evaluated
    $contest->rate_contest($contest_id);
    //header('Location:../pages/viewUsers.php');
}
Example #14
0
             for ($j = $i; $j < count($tab_participants); $j = $j + $config['col_' . $equipesX]) {
                 $date = date_participe($tab_participants[$j]->id, $s_tournois);
                 if ($date != 0) {
                     $date = strftime(DATESTRING1, $date);
                 } else {
                     $date = 'N/A';
                 }
                 echo "<tr>";
                 echo "<td class=textliste align=center>" . $tab_participants[$j]->id . "<input type=hidden name=id_" . $tab_participants[$j]->id . " value=" . $tab_participants[$j]->id . "></td>";
                 echo "<td class=textliste>" . $show($tab_participants[$j]->id, $op) . "</a></td>";
                 echo '<td class="textliste" align="center"><input type="checkbox" name="participe_' . $tab_participants[$j]->id . '" value="1"';
                 if (participe($tab_participants[$j]->id, $s_tournois)) {
                     echo ' CHECKED';
                 }
                 echo ' style="border=0px;background-color:transparent;"></td>';
                 echo "<td class=textliste align=center><input type=text maxlength=3 size=2 name=seed_" . $tab_participants[$j]->id . " value=\"" . seed($tab_participants[$j]->id, $s_tournois) . "\"></td>";
                 echo "<td class=textliste align=center>" . $date . "</td>";
                 echo "</tr>";
             }
             echo "</table>";
             echo "</td></tr></table>";
             echo "</td>";
         }
         echo "</tr></table>";
         echo "<table cellspacing=1 cellpadding=2 border=0>";
         echo "<tr><td class=text align=center><a href=javascript:select_all('liste')>{$strToutSelectionner}<a/> - <a href=javascript:unselect_all('liste')>{$strToutDeselectionner}<a/></td></tr>";
         echo "<tr><td class=text align=center><input type=submit value=\"{$strValider}\"></td></tr>";
         echo "</form></table>";
     }
 } else {
     $db->select("id, status, date, IFNULL(seed,10000) as seed");
Example #15
0
function prep_match($match, $side)
{
    echo '<div class="match' . $side;
    if (get_match_status($match['id']) == "running") {
        echo ' live_match';
    }
    echo '" id="match' . $match['id'] . '">
    <dl>
    <dt class="band1' . winner($match['band1_id'], $match['id']) . '"><span class="seed">' . seed($match['band1_id']) . "</span><span class='band_abbr'>" . get_band_abbr($match['band1_id']) . "</span>";
    if ($match['show_score']) {
        echo "<span class='percentage'>" . vote_percentage($match['band1_votes'], $match['band2_votes']) . "</span>";
    }
    echo '</dt><dt class="band2' . winner($match['band2_id'], $match['id']) . '"><span class="seed">' . seed($match['band2_id']) . "</span><span class='band_abbr'>" . get_band_abbr($match['band2_id']) . "</span>";
    if ($match['show_score']) {
        echo "<span class='percentage'>" . vote_percentage($match['band2_votes'], $match['band1_votes']) . "</span>";
    }
    echo " </dt>\n</dl>\n</div>\n";
}
Example #16
0
function show_match_poule($id, $op = '')
{
    global $db, $dbprefix, $s_joueur, $strVS, $strScore, $strMap;
    global $strCache, $strActif, $strEnCours, $strValidation, $strConflit, $strTermine, $grade;
    $match = match($id);
    if (!$match) {
        return;
    }
    /*** verification securite ***/
    //if($op=='admin') verif_admin_tournois($s_joueur,$match->tournois);
    if ($op == 'admin') {
        verif_admin_tournois($s_joueur, $match->tournois, $grade['a'], $grade['b'], $grade['t']);
    }
    /*** r&eacute;cup&eacute;ration des infos ***/
    $seed1 = seed($match->equipe1, $match->tournois);
    $seed2 = seed($match->equipe2, $match->tournois);
    $modeequipe_tournois = modeequipe_tournois($match->tournois);
    $modescore_tournois = modescore_tournois($match->tournois);
    if ($modeequipe_tournois == 'E') {
        $show = "show_equipe";
    } else {
        $show = "show_joueur";
    }
    if ($op != 'admin' && $match->status == 'C') {
        $match = '';
    }
    if ($op) {
        $op_str = "&op={$op}";
    } else {
        $op_str = '';
    }
    if ($match->status == "C") {
        $title = $strCache;
    }
    if ($match->status == "A") {
        $title = $strActif;
    }
    if ($match->status == "D") {
        $title = $strEnCours;
    }
    if ($match->status == "V") {
        $title = $strValidation;
    }
    if ($match->status == "F") {
        $title = $strConflit;
    }
    if ($match->status == "T") {
        $title = $strTermine;
    }
    // info du match
    echo '<table cellspacing="0" cellpadding="0" border="0"><tr><td>';
    echo '<table cellspacing="0" cellpadding="0" border="0"><tr valign=center>';
    if ($op == 'admin') {
        echo "<td class=\"info\">{$match->status}</td>";
        $hauteur = 450;
    } elseif ($op == 'report') {
        $hauteur = 400;
    } else {
        $hauteur = 350;
    }
    echo "<td class=\"info\"><input type=\"radio\" name=\"match\" value=\"{$match->id}\" onclick=\"javascript:ouvrir_fenetre('?page=matchs_gestion{$op_str}&id={$match->id}&header=win','match',{$hauteur},500)\" style=\"border: 0px;background-color:transparent;\" title=\"{$title}\">";
    if ($op == 'admin' && ($match->status == 'C' || $match->status == 'A' || $match->status == 'D' && ($modescore_tournois == 'M4' || $modescore_tournois == 'AB'))) {
        echo "<td class=\"info\"><input type=\"checkbox\" name=\"tab_matches[]\" value=\"{$match->id}\" style=\"border: 0px;background-color:transparent;\"></td>";
    }
    echo '</tr>';
    echo '</table>';
    echo '</td>';
    // ekip 1
    echo '<td class="text" align="left" width="120">';
    if ($match->statusequipe == 'F1') {
        echo $show($match->equipe1, $op, 'F', $seed1);
    } elseif ($match->statusequipe == 'D1') {
        echo $show($match->equipe1, $op, 'D', $seed1);
    } else {
        echo $show($match->equipe1, $op, '', $seed1);
    }
    echo '</td>';
    echo show_score1($match->score1, $match->score2, $match->frags1, $match->frags2, $match->type, $match->status, $match->statusequipe, $match->modematchscore);
    echo '<td class="text" align="center" width="20">' . $strVS . '</td>';
    echo show_score2($match->score1, $match->score2, $match->frags1, $match->frags2, $match->type, $match->status, $match->statusequipe, $match->modematchscore);
    // ekip 2
    echo '<td class="text" align="right" width="120">';
    if ($match->statusequipe == 'F2') {
        echo $show($match->equipe2, $op, 'F', $seed2, 'right');
    } elseif ($match->statusequipe == 'D2') {
        echo $show($match->equipe2, $op, 'D', $seed2, 'right');
    } else {
        echo $show($match->equipe2, $op, '', $seed2, 'right');
    }
    echo '</td>';
    echo '</tr>';
    /** info du match **/
    if ($op != 'report' && ($match->status != 'T' && $match->status != 'F' && $match->status != 'V' || $op == 'admin')) {
        $map = '';
        /** manche **/
        if ($match->status == 'A') {
            $manches = manches($match->id);
            for ($i = 0; $i < count($manches); $i++) {
                if ($manches[$i]->map) {
                    $map .= $manches[$i]->map . ',';
                }
            }
            $map = substr($map, 0, -1);
        } elseif ($match->status == 'D') {
            $mancheactive = manche_active($match->id);
            if ($mancheactive->map) {
                $map = $mancheactive->map;
                if (nb_manches($match->id) > 1) {
                    $map .= ': ' . $mancheactive->score1 . '/' . $mancheactive->score2;
                }
            }
        }
        if ($map) {
            $map = "- {$map}";
        }
        /** date **/
        /*$date_now = time();
        		$date=strftime(DATESTRING, $match->date);
        		if(!$match->date) $date='';
        
        		if($match->date < $date_now && ($match->status=='C' || $match->status=='A'))
        			$date='<font color="red">'.$date.'</font>';
        
        		if($match->date && ($match->status=='C' || $match->status=='A')) $date="- $date";
        		else $date='';*/
        echo '<tr height="10">';
        echo '<td></td>';
        echo '<td class="info" colspan="5" nowrap ><img src="images/next.gif" border="0" align="absmiddle" alt="next"><small>' . $match->id . ' ' . $map . '</small></td>';
        echo '</tr>';
    }
    echo '</td></tr></table>';
}