Server IP : 66.29.132.124 / Your IP : 18.222.184.184 Web Server : LiteSpeed System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : wavevlvu ( 1524) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/wavevlvu/book24.ng/vendor/rap2hpoutre/laravel-log-viewer/tests/ |
Upload File : |
<?php namespace Rap2hpoutre\LaravelLogViewer; use Orchestra\Testbench\TestCase as OrchestraTestCase; /** * Class LaravelLogViewerTest * @package Rap2hpoutre\LaravelLogViewer */ class LaravelLogViewerTest extends OrchestraTestCase { public function setUp() { parent::setUp(); // Copy "laravel.log" file to the orchestra package. if (!file_exists(storage_path() . '/logs/laravel.log')) { copy(__DIR__ . '/laravel.log', storage_path() . '/logs/laravel.log'); } } /** * @throws \Exception */ public function testSetFile() { parent::setUp(); $laravel_log_viewer = new LaravelLogViewer(); try { $laravel_log_viewer->setFile("laravel.log"); } catch (\Exception $e) { throw new \Exception($e->getMessage()); } $this->assertEquals("laravel.log", $laravel_log_viewer->getFileName()); } public function testAll() { $laravel_log_viewer = new LaravelLogViewer(); $data = $laravel_log_viewer->all(); $this->assertEquals('local', $data[0]['context']); $this->assertEquals('error', $data[0]['level']); $this->assertEquals('danger', $data[0]['level_class']); $this->assertEquals('exclamation-triangle', $data[0]['level_img']); $this->assertEquals('2018-09-05 20:20:51', $data[0]['date']); } public function testGetFolderFiles() { $laravel_log_viewer = new LaravelLogViewer(); $data = $laravel_log_viewer->getFolderFiles(); $this->assertNotEmpty($data[0], "Folder files is null"); } }