public function testRabbitMqExtensions() { $spec = new QueueSpecification(array('match_headers_exchange' => 'all', 'ha_policy' => 'all', 'ha_policy_params' => array('user@hostname', 'user2@hostname'), 'expires' => 20, 'message_ttl' => 10, 'dead_letter_exchange' => 'bar', 'dead_letter_routing_key' => 'baz', 'max_length' => 1024)); $this->assertSame('all', $spec->getMatchHeadersExchange()); $this->assertSame('all', $spec->getHaPolicy()); $this->assertEquals(array('user@hostname', 'user2@hostname'), $spec->getHaPolicyParams()); $this->assertSame(20, $spec->getExpires()); $this->assertSame(10, $spec->getMessageTtl()); $this->assertSame('bar', $spec->getDeadLetterExchange()); $this->assertSame('baz', $spec->getDeadLetterRoutingKey()); $this->assertSame(1024, $spec->getMaxLength()); $this->assertEquals(array('x-match' => 'all'), $spec->getBindArguments()); $this->assertEquals(array('x-ha-policy' => "all", 'x-ha-policy-params' => array("user@hostname", "user2@hostname"), 'x-expires' => 20, 'x-message-ttl' => 10, 'x-dead-letter-exchange' => "bar", 'x-dead-letter-routing-key' => "baz", 'x-max-length' => 1024), $spec->getArguments()); // reset all $spec->setMatchHeadersExchange(null); $spec->setHaPolicy(null); $spec->setHaPolicyParams(null); $spec->setExpires(null); $spec->setMessageTtl(null); $spec->setDeadLetterExchange(null); $spec->setDeadLetterRoutingKey(null); $spec->setMaxLength(null); $this->assertEmpty($spec->getArguments()); $this->assertEmpty($spec->getBindArguments()); $this->assertFalse($spec->getMatchHeadersExchange()); $this->assertFalse($spec->getHaPolicy()); $this->assertFalse($spec->getHaPolicyParams()); $this->assertFalse($spec->getExpires()); $this->assertFalse($spec->getMessageTtl()); $this->assertFalse($spec->getDeadLetterExchange()); $this->assertFalse($spec->getDeadLetterRoutingKey()); $this->assertFalse($spec->getMaxLength()); }