Skip to content

Commit faad433

Browse files
committed
add test code coverage
1 parent 6457806 commit faad433

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.DS_Store
33
vendor
44
composer.lock
5+
reports

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030
},
3131
"scripts": {
32-
"test": "phpunit"
32+
"test": "phpunit --coverage-text --coverage-html reports/"
3333
},
3434
"extra": {
3535
"laravel": {

tests/MnsQueueTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,18 @@ public function testGetQueueCanResolveWantedQueueNameOrReturnDefault()
194194
$this->assertEquals($this->queueName, $queue->getQueue(null));
195195
$this->assertEquals('somequeue', $queue->getQueue('somequeue'));
196196
}
197+
198+
public function testGetMnsCanReturnMnsAdapter()
199+
{
200+
$queue = new MnsQueue($this->mnsAdapter, $this->waitSeconds);
201+
$this->assertInstanceOf(MnsAdapter::class, $queue->getMns());
202+
}
203+
204+
public function testSizeShouldThrowException()
205+
{
206+
$queue = new MnsQueue($this->mnsAdapter, $this->waitSeconds);
207+
$this->expectException(\Exception::class);
208+
$this->expectExceptionMessage('The size method is not support for aliyun-mns');
209+
$queue->size();
210+
}
197211
}

0 commit comments

Comments
 (0)