[Messenger] Typecast the auto-setup as a bool.
This commit is contained in:
parent
833909bd68
commit
566a8be35b
@ -218,6 +218,6 @@ class Connection
|
|||||||
|
|
||||||
private function shouldSetup(): bool
|
private function shouldSetup(): bool
|
||||||
{
|
{
|
||||||
return !array_key_exists('auto-setup', $this->connectionCredentials) || 'false' !== $this->connectionCredentials['auto-setup'];
|
return !array_key_exists('auto-setup', $this->connectionCredentials) || !in_array($this->connectionCredentials['auto-setup'], array(false, 'false'), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,6 +182,12 @@ class ConnectionTest extends TestCase
|
|||||||
|
|
||||||
$connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key', array('auto-setup' => 'false'), true, $factory);
|
$connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key', array('auto-setup' => 'false'), true, $factory);
|
||||||
$connection->publish('body');
|
$connection->publish('body');
|
||||||
|
|
||||||
|
$connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key', array('auto-setup' => false), true, $factory);
|
||||||
|
$connection->publish('body');
|
||||||
|
|
||||||
|
$connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key&auto-setup=false', array(), true, $factory);
|
||||||
|
$connection->publish('body');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user