/** * @runInSeparateProcess */ function testGet() { $_SERVER['REQUEST_METHOD'] = 'POST'; $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/hello'; $this->assertNotTrue(Route::get('/hello', function () { return new Response(); })); $_SERVER['REQUEST_METHOD'] = 'GET'; $this->assertTrue(Route::get('/hello', function () { return new Response(); })); }
$style = Input::get('style', $default); $html = <<<EOT <body style='text-align: left;'> <table><tr> <td valign=top> <div> <form method=get action="display"> <textarea name="style" cols="60" rows="30"> {$style} </textarea> <br /><br /> <input type="text" name="q" size=30 /><br /> <input type="submit" value="go" /> </form> </div> </td> <td valign=top> <div style='text-align: center; display:table-cell; background-position:center middle; vertical-align: middle; width:480px; height: 640px; background-image:url(http://d3gbrb95pfitbz.cloudfront.net/message_photo/1436241183_5447329.jpeg); margin:0px; padding:0px;background-size: cover;'> EOT; $style = urlencode($style); $html .= "<img width=480px src='image?style={$style}&q={$string}' /></div></td></tr></table></body>"; return (new Response())->setContentType('text/html')->setContent($html); }); require 'route_editor.php'; Route::get('/', function () { return (new Response())->setContentType('image/gif')->setContent(Shout::emptyImage()); });