CaiWuXiTong/tests/Feature/Wizard/CompaniesTest.php
WuYongJie 9595267ee7
Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
chore: 导入 Akaunting 初始源码与团队协作规则
2026-07-20 18:20:25 +08:00

43 lines
1.1 KiB
PHP

<?php
namespace Tests\Feature\Wizard;
use Illuminate\Http\UploadedFile;
use Tests\Feature\FeatureTestCase;
class CompaniesTest extends FeatureTestCase
{
public function testItShouldSeeCompanyUpdatePage()
{
$this->loginAs()
->get(route('wizard.companies.edit'))
->assertStatus(200)
->assertSeeText(trans('general.wizard'));
}
public function testItShouldUpdateCompany()
{
$request = $this->getRequest();
$message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 2)]);
$this->loginAs()
->post(route('wizard.companies.update'), $request)
->assertStatus(200)
->assertJson([
'success' => true,
'message' => $message,
]);
}
public function getRequest()
{
return [
'financial_start' => '01-04',
'address' => $this->faker->address,
'tax_number' => $this->faker->randomNumber(9),
//'logo' => UploadedFile::fake()->image('akaunting-logo.jpg'),
];
}
}