Skip to content

Commit 3665071

Browse files
committed
Add tests
1 parent eb400cd commit 3665071

File tree

4 files changed

+60
-4
lines changed

4 files changed

+60
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: php
22

33
php:
4-
- 5.5
4+
- 5.5.9
55
- 5.6
66
- 7.0
77
- 7.1

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"longman/telegram-bot": "^0.53.0"
2929
},
3030
"require-dev": {
31-
"mockery/mockery": "0.9.*",
32-
"phpunit/phpunit": "~4.8|~5.7",
31+
"mockery/mockery": "0.9.*|~1.0",
32+
"phpunit/phpunit": "~4.8|~5.7|~6.3",
3333
"longman/php-code-style": "^1.0",
34-
"graham-campbell/testbench": "^3.4"
34+
"graham-campbell/testbench": "^3.4|^4.0"
3535
},
3636
"autoload": {
3737
"psr-4": {

tests/Unit/AbstractTestCase.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Tests\Unit;
4+
5+
use GrahamCampbell\TestBench\AbstractPackageTestCase;
6+
use PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider;
7+
8+
abstract class AbstractTestCase extends AbstractPackageTestCase
9+
{
10+
/**
11+
* Get the service provider class.
12+
*
13+
* @param \Illuminate\Contracts\Foundation\Application $app
14+
* @return string
15+
*/
16+
protected function getServiceProviderClass($app)
17+
{
18+
return PhpTelegramBotServiceProvider::class;
19+
}
20+
}

tests/Unit/ServiceProviderTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace Tests\Unit;
4+
5+
use GrahamCampbell\TestBenchCore\ServiceProviderTrait;
6+
use Illuminate\Config\Repository;
7+
use Illuminate\Database\DatabaseManager as Database;
8+
9+
class ServiceProviderTest extends AbstractTestCase
10+
{
11+
use ServiceProviderTrait;
12+
13+
/**
14+
* @test
15+
*/
16+
public function config_is_injectable()
17+
{
18+
$this->assertIsInjectable(Repository::class);
19+
}
20+
21+
/**
22+
* @test
23+
*/
24+
public function database_is_injectable()
25+
{
26+
$this->assertIsInjectable(Database::class);
27+
}
28+
29+
/**
30+
* @test
31+
*/
32+
public function provides()
33+
{
34+
$this->testProvides();
35+
}
36+
}

0 commit comments

Comments
 (0)