VY
Size: a a a
VY
АЗ
АЗ
VY
VY
V
VY
Д
/App/Helpers/Helpers.php
public static function GetPrice($id)
{
$minPrice =
Value::where('product_id', $id)->min('price');
$maxPrice =
Value::where('product_id', $id)->max('price');
$price = $minPrice.'-'.$maxPrice;
if($minPrice == $maxPrice){
$price = $minPrice;
}
return $price;
}
Хочу протестить этот метод)use App\Helpers\Helpers;
class HelperGetPriceTest extends TestCase
{
/**
* A basic unit test example.
*
* @return void
*/
public function testGetPriceTest()
{
$function = Helpers::GetPrice(1);
}
}
Запускаю тестError: Call to a member function connection() on null
Вообще функция, та которую я тестирую должна возвращать строку..DZ
DZ
DZ
DZ
Д
Д
DZ
ML
Д
M
ML
K
$lamaz = Lamaz::whereDate('date', $today)->get();