@@ 6-38 (lines=33) @@ | ||
3 | namespace Aimeos\MW\MQueue\Message; |
|
4 | ||
5 | ||
6 | class AMQPTest extends \PHPUnit_Framework_TestCase |
|
7 | { |
|
8 | private $object; |
|
9 | ||
10 | ||
11 | protected function setUp() |
|
12 | { |
|
13 | if( class_exists( '\PhpAmqpLib\Message\AMQPMessage' ) === false ) { |
|
14 | $this->markTestSkipped( 'Please install the "php-amqplib" library via composer first' ); |
|
15 | } |
|
16 | ||
17 | $msg = new \PhpAmqpLib\Message\AMQPMessage( 'test' ); |
|
18 | $this->object = new \Aimeos\MW\MQueue\Message\AMQP( $msg ); |
|
19 | } |
|
20 | ||
21 | ||
22 | protected function tearDown() |
|
23 | { |
|
24 | unset( $this->object ); |
|
25 | } |
|
26 | ||
27 | ||
28 | public function testGetBody() |
|
29 | { |
|
30 | $this->assertEquals( 'test', $this->object->getBody() ); |
|
31 | } |
|
32 | ||
33 | ||
34 | public function testGetObject() |
|
35 | { |
|
36 | $this->assertInstanceOf( '\PhpAmqpLib\Message\AMQPMessage', $this->object->getObject() ); |
|
37 | } |
|
38 | } |
|
39 |
@@ 6-38 (lines=33) @@ | ||
3 | namespace Aimeos\MW\MQueue\Message; |
|
4 | ||
5 | ||
6 | class BeanstalkTest extends \PHPUnit_Framework_TestCase |
|
7 | { |
|
8 | private $object; |
|
9 | ||
10 | ||
11 | protected function setUp() |
|
12 | { |
|
13 | if( class_exists( '\Pheanstalk\Job' ) === false ) { |
|
14 | $this->markTestSkipped( 'Please install the "pheanstalk" library via composer first' ); |
|
15 | } |
|
16 | ||
17 | $msg = new \Pheanstalk\Job( 1, 'test' ); |
|
18 | $this->object = new \Aimeos\MW\MQueue\Message\Beanstalk( $msg ); |
|
19 | } |
|
20 | ||
21 | ||
22 | protected function tearDown() |
|
23 | { |
|
24 | unset( $this->object ); |
|
25 | } |
|
26 | ||
27 | ||
28 | public function testGetBody() |
|
29 | { |
|
30 | $this->assertEquals( 'test', $this->object->getBody() ); |
|
31 | } |
|
32 | ||
33 | ||
34 | public function testGetObject() |
|
35 | { |
|
36 | $this->assertInstanceOf( '\Pheanstalk\Job', $this->object->getObject() ); |
|
37 | } |
|
38 | } |
|
39 |
@@ 6-38 (lines=33) @@ | ||
3 | namespace Aimeos\MW\MQueue\Message; |
|
4 | ||
5 | ||
6 | class StompTest extends \PHPUnit_Framework_TestCase |
|
7 | { |
|
8 | private $object; |
|
9 | ||
10 | ||
11 | protected function setUp() |
|
12 | { |
|
13 | if( class_exists( '\StompFrame' ) === false ) { |
|
14 | $this->markTestSkipped( 'Please install the Stomp PHP extension first' ); |
|
15 | } |
|
16 | ||
17 | $msg = new \StompFrame( 'COMMAND', array(), 'test' ); |
|
18 | $this->object = new \Aimeos\MW\MQueue\Message\Stomp( $msg ); |
|
19 | } |
|
20 | ||
21 | ||
22 | protected function tearDown() |
|
23 | { |
|
24 | unset( $this->object ); |
|
25 | } |
|
26 | ||
27 | ||
28 | public function testGetBody() |
|
29 | { |
|
30 | $this->assertEquals( 'test', $this->object->getBody() ); |
|
31 | } |
|
32 | ||
33 | ||
34 | public function testGetObject() |
|
35 | { |
|
36 | $this->assertInstanceOf( '\StompFrame', $this->object->getObject() ); |
|
37 | } |
|
38 | } |
|
39 |