File: D:/HostingSpaces/SBogers10/mountadvies.komma.pro/vendor/komma/kms/tests/Unit/ActionLoggerTest.php
<?php
//TODO move to a location where all prerequisites (e.g laravel etc) are available.
//
//namespace Tests\Unit;
//
//use Illuminate\Foundation\Testing\DatabaseTransactions;
//use Komma\KMS\ActionLog\ActionLogModelService;
//use Komma\KMS\ActionLog\Models\ActionLog;
//use Komma\KMS\Users\Models\KmsUser;
//use Tests\TestCase;
//
//class ActionLoggerTest extends TestCase
//{
// use DatabaseTransactions; //Automatically rolls back database actions after tests
//
// /**
// * @group ActionLogService
// * @test
// */
// public function instanceCreationTest()
// {
// $actionLogger = new ActionLogModelService();
// $this->assertInstanceOf(ActionLogModelService::class, $actionLogger);
// }
//
// /**
// * @group ActionLogService
// * @test
// * @throws \Exception
// */
// public function logTestSpecificKmsUser()
// {
// $user = KmsUser::first();
//
// $action = ActionLogModelService::Log('Phpunit testing', null, $user);
//
// $this->assertTrue($action->exists());
// $this->assertInstanceOf(ActionLog::class, $action);
// $this->assertEquals('Phpunit testing', $action->action);
//
// $this->assertEquals(true, $action->hasAuthenticatable());
// $this->assertEquals($user->id, $action->authenticatable()->first()->id);
// }
//
// /**
// * @group ActionLogService
// * @test
// * @throws \Exception
// */
// public function logTestAnonymous()
// {
// $action = ActionLogModelService::Log('Phpunit testing');
//
// $this->assertTrue($action->exists());
// $this->assertInstanceOf(ActionLog::class, $action);
// $this->assertEquals('Phpunit testing', $action->action);
// $this->assertFalse($action->hasAuthenticatable());
// }
//
// /**
// * @group ActionLogService
// * @test
// * @throws \Exception
// */
// public function logTestPayload()
// {
// $payload = ['metadata' => ['info' => 'just testing']];
// $action = ActionLogModelService::Log('Phpunit testing', $payload);
//
// $this->assertTrue($action->exists());
// $this->assertInstanceOf(ActionLog::class, $action);
// $this->assertEquals('Phpunit testing', $action->action);
// $this->assertEquals($payload, $action->payload);
// $this->assertFalse($action->hasAuthenticatable());
// }
//}