$controller = new My\Controller();
$request = Request::create('/', 'GET', ['name' => 'test']);
$this->assertEquals('test', $controller->sendVeryficationEmail($request));
$request = \Mockery::mock(Request::class);
$request->shouldReceive('input')->once()->andReturn('VasyaPupkin');
$continer->instance(Request::class, $request);
$response = $this->call('post', '/user/registerrequest');
$this->assertEquals('VasyaPupkin', $response);
import {module_name}.{module}
sys.path.append(PROJECT_ROOT)
пробовал оба варианта, и они работают. Долго не мог понять в чем причина. $sort_types = ['type', 'country', 'price'];
$sign_for_query = ['type' => '=', 'price' => '>', 'country' => '='];
$sql = '';
$data = $_POST['filters'];
foreach($sort_types as $type) {
if(array_key_exists($type, $data)) {
$sql[] = '`'.$type . '` ' . $sign_for_query[$type] . ' ' .$data[$type];
}
}
implode(' AND ', $sql)
$specials = ['price' => 'min({val})'];
foreach($sort_types as $type) {
if(array_key_exists($type, $data)) {
if(array_key_exists($type, $specials)) {
$sql[] = str_replace('{val}', $el, $specials[$el]);
} else {
$sql[] = '`'.$type . '` ' . $sign_for_query[$type] . ' ' .$data[$type];
}
}
}
if (Auth::attempt(array('email' => $email, 'password' => $password)))
public function getAuthIdentifier(); // который возвращает по стандарту id(primary key)
public function getAuthPassword(); // который возвращает пароль ($this->password)
return $this->pass
Hash::make($password);