PheanstalkQueueTest::createHandler()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Phive Queue package.
5
 *
6
 * (c) Eugene Leonovich <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phive\Queue\Tests\Queue;
13
14
use Phive\Queue\Tests\Handler\PheanstalkHandler;
15
16
class PheanstalkQueueTest extends QueueTest
17
{
18
    use Performance;
19
    use Concurrency;
20
21
    protected $supportsExpiredEta = false;
22
23
    protected function getUnsupportedItemTypes()
24
    {
25
        return [Types::TYPE_ARRAY, Types::TYPE_OBJECT];
26
    }
27
28
    /**
29
     * @dataProvider provideItemsOfUnsupportedTypes
30
     * @expectedException PHPUnit_Framework_Error_Warning
31
     * @expectedExceptionMessage expects parameter 1 to be string
32
     */
33
    public function testUnsupportedItemType($item)
34
    {
35
        $this->queue->push($item);
36
    }
37
38
    public static function createHandler(array $config)
39
    {
40
        return new PheanstalkHandler([
41
            'host'      => $config['PHIVE_BEANSTALK_HOST'],
42
            'port'      => $config['PHIVE_BEANSTALK_PORT'],
43
            'tube_name' => $config['PHIVE_BEANSTALK_TUBE_NAME'],
44
        ]);
45
    }
46
}
47