reorganize and cleanup php server code

This commit is contained in:
2026-02-06 13:12:38 +01:00
parent bf2f18f847
commit a6785f26db
3103 changed files with 494 additions and 351462 deletions
+51
View File
@@ -0,0 +1,51 @@
<?php
namespace Tests;
use Facades\Tests\Setup\UserFactory;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
/**
* Assert that session has provided error.
* @param $message
*/
protected function assertSessionHasError($message)
{
$errors = session()->get('errors')->getBag('default');
$this->assertEquals($message, $errors->first());
}
/**
* Assert that session has provided error.
* @param $message
*/
protected function assertSessionHasSuccess($message)
{
$this->assertEquals($message, session()->get('success'));
}
/**
* Create and log in an admin user.
* @return TestCase
*/
protected function beAdmin()
{
return $this->actingAsAdmin();
}
/**
* Create and log in an admin user.
* @return TestCase
*/
protected function actingAsAdmin()
{
$this->be(UserFactory::admin()->create());
return $this;
}
}