| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- declare(strict_types=1);
- /**
- * This file is part of Hyperf.
- *
- * @link https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact group@hyperf.io
- * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
- */
- namespace HyperfTest\Cases;
- use App\Model\SysMessageModel;
- use Carbon\Carbon;
- use HyperfTest\HttpTestCase;
- /**
- * @internal
- * @coversNothing
- */
- class SysMessageTest extends HttpTestCase
- {
- public function setUp(): void
- {
- parent::setUp(); // TODO: Change the autogenerated stub
- }
- public function tearDown(): void
- {
- parent::tearDown(); // TODO: Change the autogenerated stub
- }
- public function testCreateOne()
- {
- $setarr = [
- 'subject' => '',
- 'struct_type' => 'text',
- 'content' => [
- 'text' => '一段话而已',
- ],
- 'expired_at' => Carbon::now()->addMonths(1)->toDateTimeString(),
- ];
- // for ($i = 0; $i < 100; $i++) {
- // $setarr['subject'] = 'i_'. strval($i) . '_'. random(10);
- // $obj = SysMessageModel::query()->create($setarr);
- // }
- $obj = SysMessageModel::query()->create($setarr);
- var_dump($obj->toArray());
- $this->assertTrue(true);
- }
- }
|