/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/Database/EloquentPivotWithoutTimestampTest.php
37 строк
1 KB
Mior Muhammad Zaki
Test Improvements (#58432)
20 янв 2026, 18:07
Не верифицирован
20 янв 2026, 18:07
e212b33
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\Database; use Illuminate\Tests\Integration\Database\EloquentPivotWithoutTimestampTest as App; use Orchestra\Testbench\Attributes\WithConfig; use Orchestra\Testbench\Attributes\WithMigration; use Orchestra\Testbench\Concerns\WithFixtures; #[WithConfig('auth.providers.users.model', App\User::class)] #[WithMigration] class EloquentPivotWithoutTimestampTest extends DatabaseTestCase { use WithFixtures; protected function afterRefreshingDatabase() { App\migrate(); } public function testAttachingModelWithoutTimestamps() { $now = $this->freezeSecond(); $user = App\User::factory()->create(); $role = App\Role::factory()->create(); $user->roles()->attach($role->getKey(), ['notes' => 'Laravel']); $this->assertDatabaseHas('role_user', [ 'user_id' => $user->getKey(), 'role_id' => $role->getKey(), 'notes' => 'Laravel', 'created_at' => $now, ]); } }