What seems to be the problem:
Illuminate\Contracts\Container\BindingResolutionException : Target class [livewire] does not exist.
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Container\Container.php:811
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Container\Container.php:691
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:796
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Container\Container.php:637
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:781
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Container\Container.php:1284
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:198
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:166
E:\Programs\xampp\htdocs\lingua\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:255
E:\Programs\xampp\htdocs\lingua\tests\Feature\Http\Livewire\LinguaLivewireTest.php:21
Steps to Reproduce:
From a new scratch package development use the Livewire::test()
facade and execute the test.
Are you using the latest version of Livewire: yes.
Do you have any screenshots or code examples:
<?php
namespace alessandrobelli\Lingua\Tests\Feature\Http\Livewire;
use alessandrobelli\Lingua\Http\Livewire\TranslationInput;
use alessandrobelli\Lingua\Tests\TestCase;
use alessandrobelli\Lingua\Tests\User;
use alessandrobelli\Lingua\Translation;
use Livewire\Livewire;
class LinguaLivewireTest extends TestCase
{
/** @test */
public function can_update_locales()
{
$this->withoutExceptionHandling();
$newTranslation = "a";
$translation = Translation::create(['string' => 'test', 'locales' => '{}']);
$this->actingAs(factory(User::class)->create());
Livewire::test(TranslationInput::class,
['translation' => $translation->id, 'translationModel' => 'test', 'locale' => "de"])
->set('locales', "test")
->call('saveLocale');
$this->assertTrue(Translation::whereLocale($newTranslation)->exists());
}
}