@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * Removes the message from the queue |
69 | 69 | * |
70 | - * @param \Aimeos\MW\MQueue\Message\Iface $msg Message object |
|
70 | + * @param \Aimeos\MW\MQueue\Message\AMQP $msg Message object |
|
71 | 71 | * @throws \Aimeos\MW\MQueue\Exception |
72 | 72 | */ |
73 | 73 | public function del( \Aimeos\MW\MQueue\Message\Iface $msg ) |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * Returns the next message from the queue |
85 | 85 | * |
86 | - * @return \Aimeos\MW\MQueue\Message\Iface|null Message object or null if none is available |
|
86 | + * @return \Aimeos\MW\MQueue\Message\AMQP|null Message object or null if none is available |
|
87 | 87 | * @throws \Aimeos\MW\MQueue\Exception |
88 | 88 | */ |
89 | 89 | public function get() |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | * @param string $queue Message queue name |
17 | 17 | * @throws \Aimeos\MW\MQueue\Exception |
18 | 18 | */ |
19 | - public function __construct( \PhpAmqpLib\Channel\AMQPChannel $channel, $queue ) |
|
19 | + public function __construct(\PhpAmqpLib\Channel\AMQPChannel $channel, $queue) |
|
20 | 20 | { |
21 | 21 | try |
22 | 22 | { |
23 | - $channel->queue_declare( $queue, false, true, false, false ); |
|
24 | - $channel->basic_qos( null, 1, null ); |
|
23 | + $channel->queue_declare($queue, false, true, false, false); |
|
24 | + $channel->basic_qos(null, 1, null); |
|
25 | 25 | } |
26 | - catch( \Exception $e ) |
|
26 | + catch (\Exception $e) |
|
27 | 27 | { |
28 | - throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
|
28 | + throw new \Aimeos\MW\MQueue\Exception($e->getMessage()); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | $this->channel = $channel; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | try { |
42 | 42 | $this->channel->close(); |
43 | - } catch( \Exception $e ) { ; } |
|
43 | + } catch (\Exception $e) {; } |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -50,16 +50,16 @@ discard block |
||
50 | 50 | * @param string $msg Message, e.g. JSON encoded data |
51 | 51 | * @throws \Aimeos\MW\MQueue\Exception |
52 | 52 | */ |
53 | - public function add( $msg ) |
|
53 | + public function add($msg) |
|
54 | 54 | { |
55 | 55 | try |
56 | 56 | { |
57 | - $message = new \PhpAmqpLib\Message\AMQPMessage( $msg, array( 'delivery_mode' => 2 ) ); |
|
58 | - $this->channel->basic_publish( $message, '', $this->queue ); |
|
57 | + $message = new \PhpAmqpLib\Message\AMQPMessage($msg, array('delivery_mode' => 2)); |
|
58 | + $this->channel->basic_publish($message, '', $this->queue); |
|
59 | 59 | } |
60 | - catch( \Exception $e ) |
|
60 | + catch (\Exception $e) |
|
61 | 61 | { |
62 | - throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
|
62 | + throw new \Aimeos\MW\MQueue\Exception($e->getMessage()); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | * @param \Aimeos\MW\MQueue\Message\Iface $msg Message object |
71 | 71 | * @throws \Aimeos\MW\MQueue\Exception |
72 | 72 | */ |
73 | - public function del( \Aimeos\MW\MQueue\Message\Iface $msg ) |
|
73 | + public function del(\Aimeos\MW\MQueue\Message\Iface $msg) |
|
74 | 74 | { |
75 | 75 | try { |
76 | - $this->channel->basic_ack( $msg->getObject()->delivery_info['delivery_tag'] ); |
|
77 | - } catch( \Exception $e ) { |
|
78 | - throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
|
76 | + $this->channel->basic_ack($msg->getObject()->delivery_info['delivery_tag']); |
|
77 | + } catch (\Exception $e) { |
|
78 | + throw new \Aimeos\MW\MQueue\Exception($e->getMessage()); |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | { |
91 | 91 | try |
92 | 92 | { |
93 | - if( ( $msg = $this->channel->basic_get( $this->queue ) ) !== null ) { |
|
94 | - return new \Aimeos\MW\MQueue\Message\AMQP( $msg ); |
|
93 | + if (($msg = $this->channel->basic_get($this->queue)) !== null) { |
|
94 | + return new \Aimeos\MW\MQueue\Message\AMQP($msg); |
|
95 | 95 | } |
96 | 96 | } |
97 | - catch( \Exception $e ) |
|
97 | + catch (\Exception $e) |
|
98 | 98 | { |
99 | - throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
|
99 | + throw new \Aimeos\MW\MQueue\Exception($e->getMessage()); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | } |
@@ -22,8 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $channel->queue_declare( $queue, false, true, false, false ); |
24 | 24 | $channel->basic_qos( null, 1, null ); |
25 | - } |
|
26 | - catch( \Exception $e ) |
|
25 | + } catch( \Exception $e ) |
|
27 | 26 | { |
28 | 27 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
29 | 28 | } |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | { |
57 | 56 | $message = new \PhpAmqpLib\Message\AMQPMessage( $msg, array( 'delivery_mode' => 2 ) ); |
58 | 57 | $this->channel->basic_publish( $message, '', $this->queue ); |
59 | - } |
|
60 | - catch( \Exception $e ) |
|
58 | + } catch( \Exception $e ) |
|
61 | 59 | { |
62 | 60 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
63 | 61 | } |
@@ -93,8 +91,7 @@ discard block |
||
93 | 91 | if( ( $msg = $this->channel->basic_get( $this->queue ) ) !== null ) { |
94 | 92 | return new \Aimeos\MW\MQueue\Message\AMQP( $msg ); |
95 | 93 | } |
96 | - } |
|
97 | - catch( \Exception $e ) |
|
94 | + } catch( \Exception $e ) |
|
98 | 95 | { |
99 | 96 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
100 | 97 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * Removes the message from the queue |
55 | 55 | * |
56 | - * @param \Aimeos\MW\MQueue\Message\Iface $msg Message object |
|
56 | + * @param \Aimeos\MW\MQueue\Message\Stomp $msg Message object |
|
57 | 57 | * @throws \Aimeos\MW\MQueue\Exception |
58 | 58 | */ |
59 | 59 | public function del( \Aimeos\MW\MQueue\Message\Iface $msg ) |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * Returns the next message from the queue |
69 | 69 | * |
70 | - * @return \Aimeos\MW\MQueue\Message\Iface|null Message object or null if none is available |
|
70 | + * @return \Aimeos\MW\MQueue\Message\Stomp|null Message object or null if none is available |
|
71 | 71 | * @throws \Aimeos\MW\MQueue\Exception |
72 | 72 | */ |
73 | 73 | public function get() |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | * @param string $queue Message queue name |
17 | 17 | * @throws \Aimeos\MW\MQueue\Exception |
18 | 18 | */ |
19 | - public function __construct( \Stomp $client, $queue ) |
|
19 | + public function __construct(\Stomp $client, $queue) |
|
20 | 20 | { |
21 | - if( $client->subscribe( $queue ) === false ) { |
|
22 | - throw new \Aimeos\MW\MQueue\Exception( $client->error() ); |
|
21 | + if ($client->subscribe($queue) === false) { |
|
22 | + throw new \Aimeos\MW\MQueue\Exception($client->error()); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $this->client = $client; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function __destruct() |
34 | 34 | { |
35 | - $this->client->unsubscribe( $this->queue ); |
|
35 | + $this->client->unsubscribe($this->queue); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | * @param string $msg Message, e.g. JSON encoded data |
43 | 43 | * @throws \Aimeos\MW\MQueue\Exception |
44 | 44 | */ |
45 | - public function add( $msg ) |
|
45 | + public function add($msg) |
|
46 | 46 | { |
47 | - if( $this->client->send( $this->queue, $msg ) === false ) { |
|
48 | - throw new \Aimeos\MW\MQueue\Exception( $this->client->error() ); |
|
47 | + if ($this->client->send($this->queue, $msg) === false) { |
|
48 | + throw new \Aimeos\MW\MQueue\Exception($this->client->error()); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | * @param \Aimeos\MW\MQueue\Message\Iface $msg Message object |
57 | 57 | * @throws \Aimeos\MW\MQueue\Exception |
58 | 58 | */ |
59 | - public function del( \Aimeos\MW\MQueue\Message\Iface $msg ) |
|
59 | + public function del(\Aimeos\MW\MQueue\Message\Iface $msg) |
|
60 | 60 | { |
61 | - if( $this->client->ack( $msg->getObject() ) === false ) { |
|
62 | - throw new \Aimeos\MW\MQueue\Exception( $this->client->error() ); |
|
61 | + if ($this->client->ack($msg->getObject()) === false) { |
|
62 | + throw new \Aimeos\MW\MQueue\Exception($this->client->error()); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | { |
75 | 75 | try |
76 | 76 | { |
77 | - if( $this->client->hasFrame() ) { |
|
78 | - return new \Aimeos\MW\MQueue\Message\Stomp( $this->client->readFrame() ); |
|
77 | + if ($this->client->hasFrame()) { |
|
78 | + return new \Aimeos\MW\MQueue\Message\Stomp($this->client->readFrame()); |
|
79 | 79 | } |
80 | 80 | } |
81 | - catch( \StompException $e ) |
|
81 | + catch (\StompException $e) |
|
82 | 82 | { |
83 | - throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
|
83 | + throw new \Aimeos\MW\MQueue\Exception($e->getMessage()); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -77,8 +77,7 @@ |
||
77 | 77 | if( $this->client->hasFrame() ) { |
78 | 78 | return new \Aimeos\MW\MQueue\Message\Stomp( $this->client->readFrame() ); |
79 | 79 | } |
80 | - } |
|
81 | - catch( \StompException $e ) |
|
80 | + } catch( \StompException $e ) |
|
82 | 81 | { |
83 | 82 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
84 | 83 | } |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | $includepaths = $aimeos->getIncludePaths(); |
20 | 20 | $includepaths[] = get_include_path(); |
21 | - set_include_path( implode( PATH_SEPARATOR, $includepaths ) ); |
|
21 | + set_include_path(implode(PATH_SEPARATOR, $includepaths)); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | - public static function getContext( $site = 'unittest' ) |
|
25 | + public static function getContext($site = 'unittest') |
|
26 | 26 | { |
27 | - if( !isset( self::$context[$site] ) ) { |
|
28 | - self::$context[$site] = self::createContext( $site ); |
|
27 | + if (!isset(self::$context[$site])) { |
|
28 | + self::$context[$site] = self::createContext($site); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return clone self::$context[$site]; |
@@ -34,58 +34,58 @@ discard block |
||
34 | 34 | |
35 | 35 | private static function getAimeos() |
36 | 36 | { |
37 | - if( !isset( self::$aimeos ) ) |
|
37 | + if (!isset(self::$aimeos)) |
|
38 | 38 | { |
39 | 39 | require_once 'Bootstrap.php'; |
40 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
40 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
41 | 41 | |
42 | - $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
|
43 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
42 | + $extdir = dirname(dirname(dirname(__DIR__))); |
|
43 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return self::$aimeos; |
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | - private static function createContext( $site ) |
|
50 | + private static function createContext($site) |
|
51 | 51 | { |
52 | 52 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
53 | 53 | $aimeos = self::getAimeos(); |
54 | 54 | |
55 | 55 | |
56 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
56 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
57 | 57 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
58 | 58 | |
59 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
60 | - $ctx->setConfig( $conf ); |
|
59 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
60 | + $ctx->setConfig($conf); |
|
61 | 61 | |
62 | 62 | |
63 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
64 | - $ctx->setDatabaseManager( $dbm ); |
|
63 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
64 | + $ctx->setDatabaseManager($dbm); |
|
65 | 65 | |
66 | 66 | |
67 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
68 | - $ctx->setLogger( $logger ); |
|
67 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
68 | + $ctx->setLogger($logger); |
|
69 | 69 | |
70 | 70 | |
71 | 71 | $cache = new \Aimeos\MW\Cache\None(); |
72 | - $ctx->setCache( $cache ); |
|
72 | + $ctx->setCache($cache); |
|
73 | 73 | |
74 | 74 | |
75 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
76 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
75 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
76 | + $ctx->setI18n(array('de' => $i18n)); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | $session = new \Aimeos\MW\Session\None(); |
80 | - $ctx->setSession( $session ); |
|
80 | + $ctx->setSession($session); |
|
81 | 81 | |
82 | 82 | |
83 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
84 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
83 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
84 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
85 | 85 | |
86 | - $ctx->setLocale( $localeItem ); |
|
86 | + $ctx->setLocale($localeItem); |
|
87 | 87 | |
88 | - $ctx->setEditor( 'ai-mqueue:unittest' ); |
|
88 | + $ctx->setEditor('ai-mqueue:unittest'); |
|
89 | 89 | |
90 | 90 | return $ctx; |
91 | 91 | } |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( class_exists( '\Pheanstalk\Pheanstalk' ) === false ) { |
|
11 | - $this->markTestSkipped( 'Please install the "pheanstalk" library via composer first' ); |
|
10 | + if (class_exists('\Pheanstalk\Pheanstalk') === false) { |
|
11 | + $this->markTestSkipped('Please install the "pheanstalk" library via composer first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
@@ -17,42 +17,42 @@ discard block |
||
17 | 17 | { |
18 | 18 | try |
19 | 19 | { |
20 | - $mqueue = new \Aimeos\MW\MQueue\Beanstalk( array( 'conntimeout' => 1, 'readtimeout' => 1 ) ); |
|
21 | - $queue = $mqueue->getQueue( 'aimeos_unittest' ); |
|
20 | + $mqueue = new \Aimeos\MW\MQueue\Beanstalk(array('conntimeout' => 1, 'readtimeout' => 1)); |
|
21 | + $queue = $mqueue->getQueue('aimeos_unittest'); |
|
22 | 22 | } |
23 | - catch( \Aimeos\MW\MQueue\Exception $e ) |
|
23 | + catch (\Aimeos\MW\MQueue\Exception $e) |
|
24 | 24 | { |
25 | - $this->markTestSkipped( 'No Stomp compliant server available at "localhost"' ); |
|
25 | + $this->markTestSkipped('No Stomp compliant server available at "localhost"'); |
|
26 | 26 | } |
27 | 27 | |
28 | - $queue->add( 'testmsg' ); |
|
28 | + $queue->add('testmsg'); |
|
29 | 29 | $msg = $queue->get(); |
30 | - $queue->del( $msg ); |
|
30 | + $queue->del($msg); |
|
31 | 31 | |
32 | - $this->assertNull( $queue->get() ); |
|
32 | + $this->assertNull($queue->get()); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testSingleConnection() |
37 | 37 | { |
38 | - $object = new \Aimeos\MW\MQueue\Beanstalk( array( 'host' => '192.168.255.255', 'conntimeout' => 1 ) ); |
|
39 | - $this->assertInstanceOf( '\Aimeos\MW\MQueue\Iface', $object ); |
|
38 | + $object = new \Aimeos\MW\MQueue\Beanstalk(array('host' => '192.168.255.255', 'conntimeout' => 1)); |
|
39 | + $this->assertInstanceOf('\Aimeos\MW\MQueue\Iface', $object); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | public function testMultiConnection() |
44 | 44 | { |
45 | - $config = array( 'host' => array( '192.168.254.255', '192.168.255.255' ), 'conntimeout' => 1 ); |
|
46 | - $object = new \Aimeos\MW\MQueue\Beanstalk( $config ); |
|
47 | - $this->assertInstanceOf( '\Aimeos\MW\MQueue\Iface', $object ); |
|
45 | + $config = array('host' => array('192.168.254.255', '192.168.255.255'), 'conntimeout' => 1); |
|
46 | + $object = new \Aimeos\MW\MQueue\Beanstalk($config); |
|
47 | + $this->assertInstanceOf('\Aimeos\MW\MQueue\Iface', $object); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | public function testGetQueue() |
52 | 52 | { |
53 | - $object = new \Aimeos\MW\MQueue\Beanstalk( array( 'host' => '192.168.255.255', 'conntimeout' => 1 ) ); |
|
53 | + $object = new \Aimeos\MW\MQueue\Beanstalk(array('host' => '192.168.255.255', 'conntimeout' => 1)); |
|
54 | 54 | |
55 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
56 | - $object->getQueue( 'test' ); |
|
55 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
56 | + $object->getQueue('test'); |
|
57 | 57 | } |
58 | 58 | } |
@@ -19,8 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $mqueue = new \Aimeos\MW\MQueue\Beanstalk( array( 'conntimeout' => 1, 'readtimeout' => 1 ) ); |
21 | 21 | $queue = $mqueue->getQueue( 'aimeos_unittest' ); |
22 | - } |
|
23 | - catch( \Aimeos\MW\MQueue\Exception $e ) |
|
22 | + } catch( \Aimeos\MW\MQueue\Exception $e ) |
|
24 | 23 | { |
25 | 24 | $this->markTestSkipped( 'No Stomp compliant server available at "localhost"' ); |
26 | 25 | } |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | { |
8 | 8 | protected function setUp() |
9 | 9 | { |
10 | - if( class_exists( '\Stomp' ) === false ) { |
|
11 | - $this->markTestSkipped( 'Please install the "stomp" PHP extension first' ); |
|
10 | + if (class_exists('\Stomp') === false) { |
|
11 | + $this->markTestSkipped('Please install the "stomp" PHP extension first'); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
@@ -17,49 +17,49 @@ discard block |
||
17 | 17 | { |
18 | 18 | try |
19 | 19 | { |
20 | - $config = array( 'username' => 'guest', 'password' => 'guest' ); |
|
21 | - $mqueue = new \Aimeos\MW\MQueue\Stomp( $config ); |
|
22 | - $queue = $mqueue->getQueue( 'aimeos_unittest' ); |
|
20 | + $config = array('username' => 'guest', 'password' => 'guest'); |
|
21 | + $mqueue = new \Aimeos\MW\MQueue\Stomp($config); |
|
22 | + $queue = $mqueue->getQueue('aimeos_unittest'); |
|
23 | 23 | } |
24 | - catch( \Aimeos\MW\MQueue\Exception $e ) |
|
24 | + catch (\Aimeos\MW\MQueue\Exception $e) |
|
25 | 25 | { |
26 | - $this->markTestSkipped( 'No Stomp compliant server available at "localhost"' ); |
|
26 | + $this->markTestSkipped('No Stomp compliant server available at "localhost"'); |
|
27 | 27 | } |
28 | 28 | |
29 | - $queue->add( 'testmsg' ); |
|
29 | + $queue->add('testmsg'); |
|
30 | 30 | $msg = $queue->get(); |
31 | - $queue->del( $msg ); |
|
31 | + $queue->del($msg); |
|
32 | 32 | |
33 | - $this->assertNull( $queue->get() ); |
|
33 | + $this->assertNull($queue->get()); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testGetQueueSingleConnection() |
38 | 38 | { |
39 | - $object = new \Aimeos\MW\MQueue\Stomp( array( 'host' => 'tcp://127.0.0.1:61616' ) ); |
|
39 | + $object = new \Aimeos\MW\MQueue\Stomp(array('host' => 'tcp://127.0.0.1:61616')); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | public function testGetQueueMultiConnection() |
44 | 44 | { |
45 | - $object = new \Aimeos\MW\MQueue\Stomp( array( 'host' => array( 'tcp://127.0.0.1:61616', 'tcp://127.0.0.1:61617' ) ) ); |
|
45 | + $object = new \Aimeos\MW\MQueue\Stomp(array('host' => array('tcp://127.0.0.1:61616', 'tcp://127.0.0.1:61617'))); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetQueue() |
50 | 50 | { |
51 | - $client = $this->getMockBuilder( '\Stomp' ) |
|
51 | + $client = $this->getMockBuilder('\Stomp') |
|
52 | 52 | ->disableOriginalConstructor() |
53 | 53 | ->getMock(); |
54 | 54 | |
55 | - $object = $this->getMockBuilder( '\Aimeos\MW\MQueue\Stomp' ) |
|
56 | - ->setMethods( array( 'connect' ) ) |
|
55 | + $object = $this->getMockBuilder('\Aimeos\MW\MQueue\Stomp') |
|
56 | + ->setMethods(array('connect')) |
|
57 | 57 | ->disableOriginalConstructor() |
58 | 58 | ->getMock(); |
59 | 59 | |
60 | - $object->expects( $this->once() )->method( 'connect' ) |
|
61 | - ->will( $this->returnValue( $client ) ); |
|
60 | + $object->expects($this->once())->method('connect') |
|
61 | + ->will($this->returnValue($client)); |
|
62 | 62 | |
63 | - $this->assertInstanceOf( '\Aimeos\MW\MQueue\Queue\Iface', $object->getQueue( 'test' ) ); |
|
63 | + $this->assertInstanceOf('\Aimeos\MW\MQueue\Queue\Iface', $object->getQueue('test')); |
|
64 | 64 | } |
65 | 65 | } |
@@ -20,8 +20,7 @@ |
||
20 | 20 | $config = array( 'username' => 'guest', 'password' => 'guest' ); |
21 | 21 | $mqueue = new \Aimeos\MW\MQueue\Stomp( $config ); |
22 | 22 | $queue = $mqueue->getQueue( 'aimeos_unittest' ); |
23 | - } |
|
24 | - catch( \Aimeos\MW\MQueue\Exception $e ) |
|
23 | + } catch( \Aimeos\MW\MQueue\Exception $e ) |
|
25 | 24 | { |
26 | 25 | $this->markTestSkipped( 'No Stomp compliant server available at "localhost"' ); |
27 | 26 | } |
@@ -11,96 +11,96 @@ |
||
11 | 11 | |
12 | 12 | protected function setUp() |
13 | 13 | { |
14 | - if( class_exists( '\Pheanstalk\Pheanstalk' ) === false ) { |
|
15 | - $this->markTestSkipped( 'Please install the "pheanstalk" library via composer first' ); |
|
14 | + if (class_exists('\Pheanstalk\Pheanstalk') === false) { |
|
15 | + $this->markTestSkipped('Please install the "pheanstalk" library via composer first'); |
|
16 | 16 | } |
17 | 17 | |
18 | - $this->mock = $this->getMockBuilder( '\Pheanstalk\Pheanstalk' ) |
|
19 | - ->setMethods( array( 'useTube', 'watch', 'put', 'delete', 'reserve' ) ) |
|
18 | + $this->mock = $this->getMockBuilder('\Pheanstalk\Pheanstalk') |
|
19 | + ->setMethods(array('useTube', 'watch', 'put', 'delete', 'reserve')) |
|
20 | 20 | ->disableOriginalConstructor() |
21 | 21 | ->getMock(); |
22 | 22 | |
23 | - $this->mock->expects( $this->any() )->method( 'useTube' ) |
|
24 | - ->will( $this->returnValue( $this->mock ) ); |
|
23 | + $this->mock->expects($this->any())->method('useTube') |
|
24 | + ->will($this->returnValue($this->mock)); |
|
25 | 25 | |
26 | - $this->object = new \Aimeos\MW\MQueue\Queue\Beanstalk( $this->mock, 'test' ); |
|
26 | + $this->object = new \Aimeos\MW\MQueue\Queue\Beanstalk($this->mock, 'test'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - unset( $this->object ); |
|
32 | + unset($this->object); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testConstructorException() |
37 | 37 | { |
38 | - $this->mock->expects( $this->once() )->method( 'watch' ) |
|
39 | - ->will( $this->throwException( new \Pheanstalk\Exception() ) ); |
|
38 | + $this->mock->expects($this->once())->method('watch') |
|
39 | + ->will($this->throwException(new \Pheanstalk\Exception())); |
|
40 | 40 | |
41 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
42 | - new \Aimeos\MW\MQueue\Queue\Beanstalk( $this->mock, 'test' ); |
|
41 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
42 | + new \Aimeos\MW\MQueue\Queue\Beanstalk($this->mock, 'test'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | public function testAdd() |
47 | 47 | { |
48 | - $this->mock->expects( $this->once() )->method( 'put' ); |
|
48 | + $this->mock->expects($this->once())->method('put'); |
|
49 | 49 | |
50 | - $this->object->add( 'test' ); |
|
50 | + $this->object->add('test'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testAddException() |
55 | 55 | { |
56 | - $this->mock->expects( $this->once() )->method( 'put' ) |
|
57 | - ->will( $this->throwException( new \Pheanstalk\Exception() ) ); |
|
56 | + $this->mock->expects($this->once())->method('put') |
|
57 | + ->will($this->throwException(new \Pheanstalk\Exception())); |
|
58 | 58 | |
59 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
60 | - $this->object->add( 'test' ); |
|
59 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
60 | + $this->object->add('test'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testDel() |
65 | 65 | { |
66 | - $msg = new \Pheanstalk\Job( 1, 'test' ); |
|
67 | - $message = new \Aimeos\MW\MQueue\Message\Beanstalk( $msg ); |
|
66 | + $msg = new \Pheanstalk\Job(1, 'test'); |
|
67 | + $message = new \Aimeos\MW\MQueue\Message\Beanstalk($msg); |
|
68 | 68 | |
69 | - $this->mock->expects( $this->once() )->method( 'delete' ); |
|
69 | + $this->mock->expects($this->once())->method('delete'); |
|
70 | 70 | |
71 | - $this->object->del( $message ); |
|
71 | + $this->object->del($message); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
75 | 75 | public function testDelException() |
76 | 76 | { |
77 | - $msg = new \Pheanstalk\Job( 1, 'test' ); |
|
78 | - $message = new \Aimeos\MW\MQueue\Message\Beanstalk( $msg ); |
|
77 | + $msg = new \Pheanstalk\Job(1, 'test'); |
|
78 | + $message = new \Aimeos\MW\MQueue\Message\Beanstalk($msg); |
|
79 | 79 | |
80 | - $this->mock->expects( $this->once() )->method( 'delete' ) |
|
81 | - ->will( $this->throwException( new \Pheanstalk\Exception() ) ); |
|
80 | + $this->mock->expects($this->once())->method('delete') |
|
81 | + ->will($this->throwException(new \Pheanstalk\Exception())); |
|
82 | 82 | |
83 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
84 | - $this->object->del( $message ); |
|
83 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
84 | + $this->object->del($message); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | 88 | public function testGet() |
89 | 89 | { |
90 | - $msg = new \Pheanstalk\Job( 1, 'test' ); |
|
90 | + $msg = new \Pheanstalk\Job(1, 'test'); |
|
91 | 91 | |
92 | - $this->mock->expects( $this->once() )->method( 'reserve' ) |
|
93 | - ->will( $this->returnValue( $msg ) ); |
|
92 | + $this->mock->expects($this->once())->method('reserve') |
|
93 | + ->will($this->returnValue($msg)); |
|
94 | 94 | |
95 | - $this->assertInstanceOf( '\Aimeos\MW\MQueue\Message\Iface', $this->object->get() ); |
|
95 | + $this->assertInstanceOf('\Aimeos\MW\MQueue\Message\Iface', $this->object->get()); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
99 | 99 | public function testGetNone() |
100 | 100 | { |
101 | - $this->mock->expects( $this->once() )->method( 'reserve' ) |
|
102 | - ->will( $this->returnValue( false ) ); |
|
101 | + $this->mock->expects($this->once())->method('reserve') |
|
102 | + ->will($this->returnValue(false)); |
|
103 | 103 | |
104 | - $this->assertNull( $this->object->get() ); |
|
104 | + $this->assertNull($this->object->get()); |
|
105 | 105 | } |
106 | 106 | } |
@@ -11,115 +11,115 @@ |
||
11 | 11 | |
12 | 12 | protected function setUp() |
13 | 13 | { |
14 | - if( class_exists( '\Stomp' ) === false ) { |
|
15 | - $this->markTestSkipped( 'Please install the "Stomp" PHP extension first' ); |
|
14 | + if (class_exists('\Stomp') === false) { |
|
15 | + $this->markTestSkipped('Please install the "Stomp" PHP extension first'); |
|
16 | 16 | } |
17 | 17 | |
18 | - $this->mock = $this->getMockBuilder( '\Stomp' ) |
|
19 | - ->setMethods( array( 'subscribe', 'unsubscribe', 'send', 'ack', 'hasFrame', 'readFrame', 'error', '__destruct' ) ) |
|
18 | + $this->mock = $this->getMockBuilder('\Stomp') |
|
19 | + ->setMethods(array('subscribe', 'unsubscribe', 'send', 'ack', 'hasFrame', 'readFrame', 'error', '__destruct')) |
|
20 | 20 | ->disableOriginalConstructor() |
21 | 21 | ->getMock(); |
22 | 22 | |
23 | - $this->object = new \Aimeos\MW\MQueue\Queue\Stomp( $this->mock, 'test' ); |
|
23 | + $this->object = new \Aimeos\MW\MQueue\Queue\Stomp($this->mock, 'test'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() |
28 | 28 | { |
29 | - unset( $this->object ); |
|
29 | + unset($this->object); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testConstructorException() |
34 | 34 | { |
35 | - $this->mock->expects( $this->once() )->method( 'subscribe' ) |
|
36 | - ->will( $this->returnValue( false ) ); |
|
35 | + $this->mock->expects($this->once())->method('subscribe') |
|
36 | + ->will($this->returnValue(false)); |
|
37 | 37 | |
38 | - $this->mock->expects( $this->once() )->method( 'error' ) |
|
39 | - ->will( $this->returnValue( 'exception' ) ); |
|
38 | + $this->mock->expects($this->once())->method('error') |
|
39 | + ->will($this->returnValue('exception')); |
|
40 | 40 | |
41 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
42 | - new \Aimeos\MW\MQueue\Queue\Stomp( $this->mock, 'test' ); |
|
41 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
42 | + new \Aimeos\MW\MQueue\Queue\Stomp($this->mock, 'test'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | public function testAdd() |
47 | 47 | { |
48 | - $this->mock->expects( $this->once() )->method( 'send' ); |
|
48 | + $this->mock->expects($this->once())->method('send'); |
|
49 | 49 | |
50 | - $this->object->add( 'test' ); |
|
50 | + $this->object->add('test'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testAddException() |
55 | 55 | { |
56 | - $this->mock->expects( $this->once() )->method( 'send' ) |
|
57 | - ->will( $this->returnValue( false ) ); |
|
56 | + $this->mock->expects($this->once())->method('send') |
|
57 | + ->will($this->returnValue(false)); |
|
58 | 58 | |
59 | - $this->mock->expects( $this->once() )->method( 'error' ) |
|
60 | - ->will( $this->returnValue( 'exception' ) ); |
|
59 | + $this->mock->expects($this->once())->method('error') |
|
60 | + ->will($this->returnValue('exception')); |
|
61 | 61 | |
62 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
63 | - $this->object->add( 'test' ); |
|
62 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
63 | + $this->object->add('test'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | |
67 | 67 | public function testDel() |
68 | 68 | { |
69 | - $msg = new \StompFrame( 'COMMAND', array(), 'test' ); |
|
70 | - $message = new \Aimeos\MW\MQueue\Message\Stomp( $msg ); |
|
69 | + $msg = new \StompFrame('COMMAND', array(), 'test'); |
|
70 | + $message = new \Aimeos\MW\MQueue\Message\Stomp($msg); |
|
71 | 71 | |
72 | - $this->mock->expects( $this->once() )->method( 'ack' ); |
|
72 | + $this->mock->expects($this->once())->method('ack'); |
|
73 | 73 | |
74 | - $this->object->del( $message ); |
|
74 | + $this->object->del($message); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testDelException() |
79 | 79 | { |
80 | - $msg = new \StompFrame( 'COMMAND', array(), 'test' ); |
|
81 | - $message = new \Aimeos\MW\MQueue\Message\Stomp( $msg ); |
|
80 | + $msg = new \StompFrame('COMMAND', array(), 'test'); |
|
81 | + $message = new \Aimeos\MW\MQueue\Message\Stomp($msg); |
|
82 | 82 | |
83 | - $this->mock->expects( $this->once() )->method( 'ack' ) |
|
84 | - ->will( $this->returnValue( false ) ); |
|
83 | + $this->mock->expects($this->once())->method('ack') |
|
84 | + ->will($this->returnValue(false)); |
|
85 | 85 | |
86 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
87 | - $this->object->del( $message ); |
|
86 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
87 | + $this->object->del($message); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
91 | 91 | public function testGet() |
92 | 92 | { |
93 | - $msg = new \StompFrame( 'test' ); |
|
93 | + $msg = new \StompFrame('test'); |
|
94 | 94 | |
95 | - $this->mock->expects( $this->once() )->method( 'hasFrame' ) |
|
96 | - ->will( $this->returnValue( true ) ); |
|
95 | + $this->mock->expects($this->once())->method('hasFrame') |
|
96 | + ->will($this->returnValue(true)); |
|
97 | 97 | |
98 | - $this->mock->expects( $this->once() )->method( 'readFrame' ) |
|
99 | - ->will( $this->returnValue( $msg ) ); |
|
98 | + $this->mock->expects($this->once())->method('readFrame') |
|
99 | + ->will($this->returnValue($msg)); |
|
100 | 100 | |
101 | - $this->assertInstanceOf( '\Aimeos\MW\MQueue\Message\Iface', $this->object->get() ); |
|
101 | + $this->assertInstanceOf('\Aimeos\MW\MQueue\Message\Iface', $this->object->get()); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
105 | 105 | public function testGetNone() |
106 | 106 | { |
107 | - $this->mock->expects( $this->once() )->method( 'hasFrame' ) |
|
108 | - ->will( $this->returnValue( false ) ); |
|
107 | + $this->mock->expects($this->once())->method('hasFrame') |
|
108 | + ->will($this->returnValue(false)); |
|
109 | 109 | |
110 | - $this->assertNull( $this->object->get() ); |
|
110 | + $this->assertNull($this->object->get()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
114 | 114 | public function testGetException() |
115 | 115 | { |
116 | - $this->mock->expects( $this->once() )->method( 'hasFrame' ) |
|
117 | - ->will( $this->returnValue( true ) ); |
|
116 | + $this->mock->expects($this->once())->method('hasFrame') |
|
117 | + ->will($this->returnValue(true)); |
|
118 | 118 | |
119 | - $this->mock->expects( $this->once() )->method( 'readFrame' ) |
|
120 | - ->will( $this->throwException( new \StompException() ) ); |
|
119 | + $this->mock->expects($this->once())->method('readFrame') |
|
120 | + ->will($this->throwException(new \StompException())); |
|
121 | 121 | |
122 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
122 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
123 | 123 | $this->object->get(); |
124 | 124 | } |
125 | 125 | } |
@@ -11,107 +11,107 @@ |
||
11 | 11 | |
12 | 12 | protected function setUp() |
13 | 13 | { |
14 | - if( class_exists( '\PhpAmqpLib\Channel\AMQPChannel' ) === false ) { |
|
15 | - $this->markTestSkipped( 'Please install the "php-amqplib" library via composer first' ); |
|
14 | + if (class_exists('\PhpAmqpLib\Channel\AMQPChannel') === false) { |
|
15 | + $this->markTestSkipped('Please install the "php-amqplib" library via composer first'); |
|
16 | 16 | } |
17 | 17 | |
18 | - $this->mock = $this->getMockBuilder( '\PhpAmqpLib\Channel\AMQPChannel' ) |
|
19 | - ->setMethods( array( 'queue_declare', 'basic_qos', 'basic_publish', 'basic_get', 'basic_ack' ) ) |
|
18 | + $this->mock = $this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel') |
|
19 | + ->setMethods(array('queue_declare', 'basic_qos', 'basic_publish', 'basic_get', 'basic_ack')) |
|
20 | 20 | ->disableOriginalConstructor() |
21 | 21 | ->getMock(); |
22 | 22 | |
23 | - $this->object = new \Aimeos\MW\MQueue\Queue\AMQP( $this->mock, 'test' ); |
|
23 | + $this->object = new \Aimeos\MW\MQueue\Queue\AMQP($this->mock, 'test'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() |
28 | 28 | { |
29 | - unset( $this->object ); |
|
29 | + unset($this->object); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testConstructorException() |
34 | 34 | { |
35 | - $this->mock->expects( $this->once() )->method( 'queue_declare' ) |
|
36 | - ->will( $this->throwException( new \Exception() ) ); |
|
35 | + $this->mock->expects($this->once())->method('queue_declare') |
|
36 | + ->will($this->throwException(new \Exception())); |
|
37 | 37 | |
38 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
39 | - new \Aimeos\MW\MQueue\Queue\AMQP( $this->mock, 'test' ); |
|
38 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
39 | + new \Aimeos\MW\MQueue\Queue\AMQP($this->mock, 'test'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | public function testAdd() |
44 | 44 | { |
45 | - $this->mock->expects( $this->once() )->method( 'basic_publish' ); |
|
45 | + $this->mock->expects($this->once())->method('basic_publish'); |
|
46 | 46 | |
47 | - $this->object->add( 'test' ); |
|
47 | + $this->object->add('test'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | public function testAddException() |
52 | 52 | { |
53 | - $this->mock->expects( $this->once() )->method( 'basic_publish' ) |
|
54 | - ->will( $this->throwException( new \Exception() ) ); |
|
53 | + $this->mock->expects($this->once())->method('basic_publish') |
|
54 | + ->will($this->throwException(new \Exception())); |
|
55 | 55 | |
56 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
57 | - $this->object->add( 'test' ); |
|
56 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
57 | + $this->object->add('test'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | public function testDel() |
62 | 62 | { |
63 | - $msg = new \PhpAmqpLib\Message\AMQPMessage( 'test' ); |
|
64 | - $msg->delivery_info = array( 'channel' => $this->mock, 'delivery_tag' => 'test' ); |
|
63 | + $msg = new \PhpAmqpLib\Message\AMQPMessage('test'); |
|
64 | + $msg->delivery_info = array('channel' => $this->mock, 'delivery_tag' => 'test'); |
|
65 | 65 | |
66 | - $message = new \Aimeos\MW\MQueue\Message\AMQP( $msg ); |
|
66 | + $message = new \Aimeos\MW\MQueue\Message\AMQP($msg); |
|
67 | 67 | |
68 | - $this->mock->expects( $this->once() )->method( 'basic_ack' ); |
|
68 | + $this->mock->expects($this->once())->method('basic_ack'); |
|
69 | 69 | |
70 | - $this->object->del( $message ); |
|
70 | + $this->object->del($message); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | 74 | public function testDelException() |
75 | 75 | { |
76 | - $msg = new \PhpAmqpLib\Message\AMQPMessage( 'test' ); |
|
77 | - $msg->delivery_info = array( 'channel' => $this->mock, 'delivery_tag' => 'test' ); |
|
76 | + $msg = new \PhpAmqpLib\Message\AMQPMessage('test'); |
|
77 | + $msg->delivery_info = array('channel' => $this->mock, 'delivery_tag' => 'test'); |
|
78 | 78 | |
79 | - $message = new \Aimeos\MW\MQueue\Message\AMQP( $msg ); |
|
79 | + $message = new \Aimeos\MW\MQueue\Message\AMQP($msg); |
|
80 | 80 | |
81 | - $this->mock->expects( $this->once() )->method( 'basic_ack' ) |
|
82 | - ->will( $this->throwException( new \Exception() ) ); |
|
81 | + $this->mock->expects($this->once())->method('basic_ack') |
|
82 | + ->will($this->throwException(new \Exception())); |
|
83 | 83 | |
84 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
85 | - $this->object->del( $message ); |
|
84 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
85 | + $this->object->del($message); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testGet() |
90 | 90 | { |
91 | - $msg = new \PhpAmqpLib\Message\AMQPMessage( 'test' ); |
|
91 | + $msg = new \PhpAmqpLib\Message\AMQPMessage('test'); |
|
92 | 92 | |
93 | - $this->mock->expects( $this->once() )->method( 'basic_get' ) |
|
94 | - ->will( $this->returnValue( $msg ) ); |
|
93 | + $this->mock->expects($this->once())->method('basic_get') |
|
94 | + ->will($this->returnValue($msg)); |
|
95 | 95 | |
96 | - $this->assertInstanceOf( '\Aimeos\MW\MQueue\Message\Iface', $this->object->get() ); |
|
96 | + $this->assertInstanceOf('\Aimeos\MW\MQueue\Message\Iface', $this->object->get()); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
100 | 100 | public function testGetNone() |
101 | 101 | { |
102 | - $this->mock->expects( $this->once() )->method( 'basic_get' ) |
|
103 | - ->will( $this->returnValue( null ) ); |
|
102 | + $this->mock->expects($this->once())->method('basic_get') |
|
103 | + ->will($this->returnValue(null)); |
|
104 | 104 | |
105 | - $this->assertNull( $this->object->get() ); |
|
105 | + $this->assertNull($this->object->get()); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | 109 | public function testGetException() |
110 | 110 | { |
111 | - $this->mock->expects( $this->once() )->method( 'basic_get' ) |
|
112 | - ->will( $this->throwException( new \Exception() ) ); |
|
111 | + $this->mock->expects($this->once())->method('basic_get') |
|
112 | + ->will($this->throwException(new \Exception())); |
|
113 | 113 | |
114 | - $this->setExpectedException( '\Aimeos\MW\MQueue\Exception' ); |
|
114 | + $this->setExpectedException('\Aimeos\MW\MQueue\Exception'); |
|
115 | 115 | $this->object->get(); |
116 | 116 | } |
117 | 117 | } |
@@ -10,29 +10,29 @@ |
||
10 | 10 | |
11 | 11 | protected function setUp() |
12 | 12 | { |
13 | - if( class_exists( '\Pheanstalk\Job' ) === false ) { |
|
14 | - $this->markTestSkipped( 'Please install the "pheanstalk" library via composer first' ); |
|
13 | + if (class_exists('\Pheanstalk\Job') === false) { |
|
14 | + $this->markTestSkipped('Please install the "pheanstalk" library via composer first'); |
|
15 | 15 | } |
16 | 16 | |
17 | - $msg = new \Pheanstalk\Job( 1, 'test' ); |
|
18 | - $this->object = new \Aimeos\MW\MQueue\Message\Beanstalk( $msg ); |
|
17 | + $msg = new \Pheanstalk\Job(1, 'test'); |
|
18 | + $this->object = new \Aimeos\MW\MQueue\Message\Beanstalk($msg); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | |
22 | 22 | protected function tearDown() |
23 | 23 | { |
24 | - unset( $this->object ); |
|
24 | + unset($this->object); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | public function testGetBody() |
29 | 29 | { |
30 | - $this->assertEquals( 'test', $this->object->getBody() ); |
|
30 | + $this->assertEquals('test', $this->object->getBody()); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | public function testGetObject() |
35 | 35 | { |
36 | - $this->assertInstanceOf( '\Pheanstalk\Job', $this->object->getObject() ); |
|
36 | + $this->assertInstanceOf('\Pheanstalk\Job', $this->object->getObject()); |
|
37 | 37 | } |
38 | 38 | } |