ExampleTest.php
Код: Выделить всё
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$response = $this->get('/');
$response->assertStatus(200);
}
}
Код: Выделить всё
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
./tests/Unit
./tests/Feature
./app
Код: Выделить всё
PHPUnit 7.4.0 by Sebastian Bergmann and contributors.
.F 2 / 2 (100%)
Time: 1.86 seconds, Memory: 20.00MB
There was 1 failure:
1) Tests\Feature\ExampleTest::testBasicTest
Expected status code 200 but received 500.
Failed asserting that false is true.
/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:133
/var/www/html/tests/Feature/ExampleTest.php:19
FAILURES!
Tests: 2, Assertions: 2, Failures: 1.
Код: Выделить всё
[2018-10-15 20:56:09] testing.ERROR: Call to a member function load() on null (View: /var/www/html/resources/views/app.blade.php) {"exception":"[object] (ErrorException(code: 0): Call to a member function load() on null (View: /var/www/html/resources/views/app.blade.php) at /var/www/html/app/Ezybyz/Configuration/ProvidesScriptVariables.php:46, Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function load() on null at /var/www/html/app/Ezybyz/Configuration/ProvidesScriptVariables.php:46)
Код: Выделить всё
@php
$config = array_merge(
Ezybyz::scriptVariables(), [
// Add key and value here if you want to added to initial state
]
)
@endphp
@extends('layouts.main')
@push('meta')
{{-- Fix for chunk error in Webpack and Vue-Router --}}
@endpush
@push('favicon')
@endpush
@push('css')
@endpush
@push('header_js')
{{-- EzyByz initial state provider --}}
window.App = @json($config)
{{-- Add whitelisted routes for making API calls --}}
@routes
@endpush
@push('title')
{{ config('app.name') }}
@endpush
@section('content')
@endsection
@push('footer_js')
@if(config('echo.realtime'))
{{-- Load socket.io --}}
@endif
@endpush
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/52825048/phpunit-test-expected-status-200-but-received-500[/url]