function makeResearch() { if (!isset($_POST)) { return false; } $query = new SearchController($_POST); return json_encode($query->make_research()); }
public function testRequestSearchValue() { \Input::shouldReceive('only')->andReturn(['words' => 'hello']); \Input::shouldReceive('get')->andReturn(1); \Input::shouldReceive('input')->andReturn(''); $reflectionProperty = $this->getProtectProperty($this->controller, 'layout'); $reflectionProperty->setValue($this->controller, new \stdClass()); $reflectionMethod = $this->getProtectMethod($this->controller, 'view'); $reflectionMethod->invokeArgs($this->controller, ['home.search.index']); $this->assertNull($this->controller->getIndex()); }
use App\Controllers\ErrorController; use App\Controllers\AuthenticationController; use App\Controllers\CommentsController; use App\Controllers\ProfileController; use App\Controllers\SearchController; use App\Services\Exceptions\InsufficientPrivilegesException; use App\Models\Exceptions\ModelNotFoundException; $page = isset($_GET['page']) ? $_GET['page'] : 'threads'; try { switch ($page) { case "profile": $controller = new ProfileController(); $controller->show(); break; case "search": $controller = new SearchController(); $controller->search(); break; //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// case "login": $controller = new AuthenticationController(); $controller->login(); break; case "auth.attempt": $controller = new AuthenticationController(); $controller->attempt(); break; case "register": $controller = new AuthenticationController(); $controller->register();