OptionControllerTest.php 861 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Tests\Common\Http\Controllers;
  3. use Modules\Common\Http\Controllers\OptionController;
  4. use Modules\Common\Support\Trace\TraceContext;
  5. use PHPUnit\Framework\TestCase;
  6. class OptionControllerTest extends \Tests\TestCase
  7. {
  8. public function testIndex()
  9. {
  10. $res = $this->get('http://localhost/api/options/xiaoming');
  11. // $res->dump();
  12. dump(app(TraceContext::class)->getTraceInfo());
  13. dump(app(TraceContext::class)->getTraceInfo());
  14. dump($info1 = app(TraceContext::class)->getTraceInfo());
  15. $channel = \Log::build([
  16. 'driver' => 'daily',
  17. 'path' => storage_path('logs/aa.log'),
  18. 'level' => 'debug'
  19. ]);
  20. \Log::stack([$channel])->info('hellow', ['traceInfo' => $info1]);
  21. \Log::stack([$channel])->debug('hellow', ['traceInfo' => $info1]);
  22. }
  23. }