Skip to content

Commit 11e89fb

Browse files
authored
Merge pull request #1 from paingheinthu/support_6.0
Support laravel 6.9
2 parents e46b179 + 1271b38 commit 11e89fb

File tree

4 files changed

+42
-39
lines changed

4 files changed

+42
-39
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
language: php
2-
2+
33
php:
44
- 5.4
55
- 5.5
66
- 5.6
7+
- 7.2
78
- hhvm
8-
9+
910
before_script:
1011
- composer self-update
1112
- composer install --prefer-source --no-interaction --dev
12-
13+
1314
# script: build.sh
1415
script: phpunit --configuration phpunit.xml --coverage-text

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.4.7",
14+
"php": ">=5.4.7 || 7.2",
1515
"php-amqplib/php-amqplib": "2.*",
16-
"illuminate/support": "5.*"
16+
"illuminate/support": "5.* || 6.0"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "4.0.*",
19+
"phpunit/phpunit": "4.0.* || ^7.5",
2020
"mockery/mockery": "dev-master"
2121
},
2222
"autoload": {
2323
"psr-4": {
2424
"Mookofe\\Tail\\": "src/"
2525
}
26-
},
26+
},
2727
"minimum-stability": "stable"
28-
}
28+
}

phpunit.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false">
10+
stopOnFailure="false">
1211
<testsuites>
1312
<testsuite name="Package Test Suite">
1413
<directory suffix=".php">./tests/</directory>

tests/testBaseOptions.php

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,78 @@
22

33
use Mockery;
44
use Mookofe\Tail\BaseOptions;
5+
use PHPUnit\Framework\TestCase;
6+
use Mookofe\Tail\Exceptions\InvalidOptionException;
57

68

79
/**
810
* Test base option class
911
*
10-
* @author Victor Cruz <cruzrosario@gmail.com>
12+
* @author Victor Cruz <cruzrosario@gmail.com>
1113
*/
12-
class testBaseOptions extends \PHPUnit_Framework_TestCase
14+
class testBaseOptions extends TestCase
1315
{
14-
15-
protected $input;
16-
17-
public function __construct()
18-
{
19-
$this->input = Mockery::mock('Illuminate\Config\Repository');
20-
21-
}
22-
23-
public function tearDown()
24-
{
25-
Mockery::close();
26-
}
27-
2816
public function testValidateOptions()
2917
{
30-
$options = array('queue_name' => 'this_queue');
31-
$baseOptions = new BaseOptions($this->input);
18+
$input = Mockery::mock('Illuminate\Config\Repository');
3219

20+
$options = array('queue_name' => 'this_queue');
21+
$baseOptions = new BaseOptions($input);
3322
$result = $baseOptions->validateOptions($options);
3423

3524
//Asserts
3625
$this->assertInstanceOf('Mookofe\Tail\BaseOptions', $result);
26+
27+
Mockery::close();
3728
}
3829

3930
/**
40-
* @expectedException Mookofe\Tail\Exceptions\InvalidOptionException
31+
* ExpectedException Mookofe\Tail\Exceptions\InvalidOptionException
4132
*/
4233
public function testValidateOptionsInvalid()
4334
{
35+
$input = Mockery::mock('Illuminate\Config\Repository');
36+
37+
//Assert
38+
$this->expectException(InvalidOptionException::class);
39+
4440
$options = array('invalid_field' => 'this_is_invalid_field');
45-
$baseOptions = new BaseOptions($this->input);
41+
$baseOptions = new BaseOptions($input);
42+
$result = $baseOptions->validateOptions($options);
4643

47-
$result = $baseOptions->validateOptions($options);
44+
Mockery::close();
4845
}
4946

5047
public function testSetOptions()
5148
{
52-
$options = array('queue_name' => 'this_queue');
53-
$baseOptions = new BaseOptions($this->input);
49+
$input = Mockery::mock('Illuminate\Config\Repository');
5450

51+
$options = array('queue_name' => 'this_queue');
52+
$baseOptions = new BaseOptions($input);
5553
$baseOptions->setOptions($options);
5654

57-
//Assertss
55+
//Assertss
5856
$this->assertObjectHasAttribute('queue_name', $baseOptions);
5957
$this->assertEquals($baseOptions->queue_name, $options['queue_name']);
58+
Mockery::close();
6059
}
6160

6261
public function testBuildConnectionOptions()
6362
{
63+
64+
$input = Mockery::mock('Illuminate\Config\Repository');
6465
//Mock Input object
65-
$this->input->shouldReceive('get')->once()->andReturn('just_to_return');
66-
$this->input->shouldReceive('get')->once()->andReturn(array());
67-
66+
$input->shouldReceive('get')->once()->andReturn('just_to_return');
67+
$input->shouldReceive('get')->once()->andReturn(array());
68+
6869
//Setup enviroment
69-
$baseOptions = new BaseOptions($this->input);
70+
$baseOptions = new BaseOptions($input);
7071
$options = $baseOptions->buildConnectionOptions();
7172

7273
//Asserts
73-
$this->assertInternalType('array', $options);
74+
$this->assertIsArray($options);
7475
$this->assertArrayHasKey('queue_name', $options);
76+
77+
Mockery::close();
7578
}
7679
}

0 commit comments

Comments
 (0)