Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.188.161.182
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
1 /
vendor /
musonza /
chat /
tests /
Feature /
Delete
Unzip
Name
Size
Permission
Date
Action
ConversationControllerTest.php
2.96
KB
-rw-r--r--
2021-02-02 18:21
ConversationMessageControllerTest.php
4.29
KB
-rw-r--r--
2021-02-02 18:21
ConversationParticipationControllerTest.php
3.51
KB
-rw-r--r--
2021-02-02 18:21
DataTransformersTest.php
1.07
KB
-rw-r--r--
2021-02-02 18:21
Save
Rename
<?php namespace Musonza\Chat\Tests\Feature; use Chat; use Musonza\Chat\Models\Conversation; use Musonza\Chat\Models\Participation; use Musonza\Chat\Tests\Helpers\Models\Client; use Musonza\Chat\Tests\Helpers\Models\User; use Musonza\Chat\Tests\TestCase; class ConversationParticipationControllerTest extends TestCase { public function testStore() { $conversation = factory(Conversation::class)->create(); $userModel = factory(User::class)->create(); $clientModel = factory(Client::class)->create(); $payload = [ 'participants' => [ ['id' => $userModel->getKey(), 'type' => $userModel->getMorphClass()], ['id' => $clientModel->getKey(), 'type' => $clientModel->getMorphClass()], ], ]; $this->postJson(route('conversations.participation.store', [$conversation->getKey()]), $payload) ->assertStatus(200); $this->assertCount(2, $conversation->participants); } public function testIndex() { $conversation = factory(Conversation::class)->create(); $userModel = factory(User::class)->create(); $clientModel = factory(Client::class)->create(); Chat::conversation($conversation)->addParticipants([$userModel, $clientModel]); $this->getJson(route('conversations.participation.index', [$conversation->getKey()])) ->assertStatus(200) ->assertJsonCount(2); } public function testShow() { $conversation = factory(Conversation::class)->create(); $userModel = factory(User::class)->create(); Chat::conversation($conversation)->addParticipants([$userModel]); /** @var Participation $participant */ $participant = $conversation->participants->first(); $this->getJson(route('conversations.participation.show', [$conversation->getKey(), $participant->getKey()])) ->assertStatus(200) ->assertJson([ 'messageable_type' => $userModel->getMorphClass(), ]); } public function testDestroy() { $conversation = factory(Conversation::class)->create(); $userModel = factory(User::class)->create(); $clientModel = factory(Client::class)->create(); Chat::conversation($conversation)->addParticipants([$userModel, $clientModel]); $this->assertCount(2, $conversation->participants); /** @var Participation $participant */ $participant = $conversation->participants->first(); $this->deleteJson(route('conversations.participation.destroy', [$conversation->getKey(), $participant->getKey()])) ->assertStatus(200) ->assertJsonCount(1); } public function testUpdate() { $conversation = factory(Conversation::class)->create(); $userModel = factory(User::class)->create(); $clientModel = factory(Client::class)->create(); Chat::conversation($conversation)->addParticipants([$userModel, $clientModel]); $this->assertCount(2, $conversation->participants); /** @var Participation $participant */ $participant = $conversation->participants->first(); $payload = [ 'settings' => [ 'mute_mentions' => true, ], ]; $this->putJson( route('conversations.participation.update', [$conversation->getKey(), $participant->getKey()]), $payload ) ->assertStatus(200) ->assertJson(['settings' => $payload['settings']]); } }