Skip to content

Commit 33a7d9b

Browse files
committed
Add Test
1 parent 3136da8 commit 33a7d9b

File tree

7 files changed

+127
-7
lines changed

7 files changed

+127
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/.idea/
33

44
/vendor/
5+
composer.lock

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CHANGE LOG
2+
==========
3+
4+
## v1.1.3
5+
6+
* [ Added ] Test
7+
8+
## v1.1.2
9+
10+
* [ Fixed ] Apply fixes from StyleCI
11+
12+
## v1.1.1
13+
14+
* [ Fixed ] composer.json
15+
16+
## v1.1
17+
18+
* [ Feature ] Add File Share
19+
* [ Feature ] Accept Message Request
20+
21+
## v1.0.1
22+
23+
* [ Added ] Add Incoming Video Modal
24+
25+
## v1.0
26+
27+
* [ Feature ] One To One Chat ( With Video Call )
28+
* [ Feature ] Group Chat

composer.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
"require": {
2121
"php": ">=5.6.4",
2222
"predis/predis": "^1.1",
23-
"dflydev/apache-mime-types": "^1.0"
23+
"dflydev/apache-mime-types": "^1.0",
24+
"illuminate/support": "^5.5",
25+
"illuminate/database": "^5.5",
26+
"illuminate/contracts": "^5.5"
2427
},
2528
"autoload": {
2629
"psr-4": {
@@ -30,6 +33,11 @@
3033
"helper/helpers.php"
3134
]
3235
},
36+
"autoload-dev": {
37+
"psr-4": {
38+
"PhpJunior\\LaravelVideoChat\\Tests\\": "tests/"
39+
}
40+
},
3341
"extra": {
3442
"laravel": {
3543
"providers": [
@@ -39,5 +47,9 @@
3947
"Chat": "PhpJunior\\LaravelVideoChat\\Facades\\Chat"
4048
}
4149
}
50+
},
51+
"require-dev": {
52+
"phpunit/phpunit": "^6.4",
53+
"graham-campbell/testbench": "^4.0"
4254
}
4355
}

phpunit.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
beStrictAboutTestsThatDoNotTestAnything="true"
5+
beStrictAboutOutputDuringTests="true"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
11+
failOnRisky="true"
12+
failOnWarning="true"
13+
processIsolation="false"
14+
stopOnError="false"
15+
stopOnFailure="false"
16+
verbose="true"
17+
>
18+
<testsuites>
19+
<testsuite name="Package Test Suite">
20+
<directory suffix="Test.php">./tests</directory>
21+
</testsuite>
22+
</testsuites>
23+
<filter>
24+
<whitelist processUncoveredFilesFromWhitelist="true">
25+
<directory suffix=".php">./src</directory>
26+
</whitelist>
27+
</filter>
28+
</phpunit>

src/Services/Chat.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
22

33
namespace PhpJunior\LaravelVideoChat\Services;
44

5+
use Illuminate\Contracts\Config\Repository;
56
use PhpJunior\LaravelVideoChat\Repositories\Conversation\ConversationRepository;
67
use PhpJunior\LaravelVideoChat\Repositories\GroupConversation\GroupConversationRepository;
78

89
class Chat
910
{
10-
private $config;
11+
protected $config;
1112

12-
private $conversation;
13+
protected $conversation;
1314

14-
private $userId;
15+
protected $userId;
1516
/**
1617
* @var GroupConversationRepository
1718
*/
18-
private $group;
19+
protected $group;
1920

2021
/**
2122
* Chat constructor.
2223
*
23-
* @param $config
24+
* @param Repository $config
2425
* @param ConversationRepository $conversation
2526
* @param GroupConversationRepository $group
2627
*/
2728
public function __construct(
28-
$config,
29+
Repository $config,
2930
ConversationRepository $conversation,
3031
GroupConversationRepository $group
3132
) {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: nyinyilwin
5+
* Date: 11/10/17
6+
* Time: 1:20 AM
7+
*/
8+
9+
namespace PhpJunior\LaravelVideoChat\Tests;
10+
11+
12+
use GrahamCampbell\TestBenchCore\ServiceProviderTrait;
13+
use PhpJunior\LaravelVideoChat\Services\Chat;
14+
15+
class LaravelVideoChatServiceProviderTest extends TestCase
16+
{
17+
use ServiceProviderTrait;
18+
19+
public function testChatIsInjectable()
20+
{
21+
$this->assertIsInjectable(Chat::class);
22+
}
23+
}

tests/TestCase.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: nyinyilwin
5+
* Date: 11/10/17
6+
* Time: 1:18 AM
7+
*/
8+
9+
namespace PhpJunior\LaravelVideoChat\Tests;
10+
11+
use GrahamCampbell\TestBench\AbstractPackageTestCase;
12+
use PhpJunior\LaravelVideoChat\LaravelVideoChatServiceProvider;
13+
14+
abstract class TestCase extends AbstractPackageTestCase
15+
{
16+
/**
17+
* Get the service provider class.
18+
*
19+
* @param \Illuminate\Contracts\Foundation\Application $app
20+
*
21+
* @return string
22+
*/
23+
protected function getServiceProviderClass($app)
24+
{
25+
return LaravelVideoChatServiceProvider::class;
26+
}
27+
}

0 commit comments

Comments
 (0)